sd/source/ui/inc/PreviewRenderer.hxx | 8 sd/source/ui/inc/unomodel.hxx | 2 sd/source/ui/presenter/PresenterTextView.cxx | 2 sd/source/ui/sidebar/RecentMasterPagesSelector.cxx | 1 sd/source/ui/slideshow/slideshow.cxx | 2 sd/source/ui/slideshow/slideshowimpl.cxx | 2 sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx | 1 sd/source/ui/tools/PreviewRenderer.cxx | 10 sd/source/ui/unoidl/unoobj.cxx | 4 sd/source/ui/unoidl/unopage.cxx | 114 ++++------ sd/source/ui/unoidl/unopage.hxx | 6 11 files changed, 73 insertions(+), 79 deletions(-)
New commits: commit 5d6a994ccccb336365017d0bb54ebc5dabac7d99 Author: Ivan Timofeev <[email protected]> Date: Mon Sep 2 17:38:31 2013 +0400 String->OUString Change-Id: Ic7e61d002638991f2d69462d343f1b29bc9b0040 diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 5d476e8..6495c64 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -57,7 +57,7 @@ class DrawDocShell; } extern OUString getPageApiName( SdPage* pPage ); -extern OUString getPageApiNameFromUiName( const String& rUIName ); +extern OUString getPageApiNameFromUiName( const OUString& rUIName ); /*********************************************************************** * * diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index a510589..9abf0aa 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -68,7 +68,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::animations; using namespace ::com::sun::star::drawing::framework; -extern String getUiNameFromPageApiNameImpl( const OUString& rApiName ); +extern OUString getUiNameFromPageApiNameImpl( const OUString& rApiName ); namespace { diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index bf4e57e..8db58e2 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -93,7 +93,7 @@ using namespace ::com::sun::star::presentation; using namespace ::com::sun::star::beans; extern void NotifyDocumentEvent( SdDrawDocument* pDocument, const OUString& rEventName ); -extern String getUiNameFromPageApiNameImpl( const OUString& rApiName ); +extern OUString getUiNameFromPageApiNameImpl( const OUString& rApiName ); namespace sd { diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 2444d69..72a3b49 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -89,8 +89,8 @@ using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; using ::com::sun::star::drawing::XShape; -extern OUString getPageApiNameFromUiName( const String& rUIName ); -extern String getUiNameFromPageApiNameImpl( const OUString& rApiName ); +extern OUString getPageApiNameFromUiName( const OUString& rUIName ); +extern OUString getUiNameFromPageApiNameImpl( const OUString& rApiName ); /////////////////////////////////////////////////////////////////////// diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 29356b6..6e0a78a 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -400,9 +400,9 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const Reference< drawing::XShap if( NULL == SvxFmDrawPage::mpPage || !xShape.is() ) return NULL; - String aType( xShape->getShapeType() ); - const String aPrefix( "com.sun.star.presentation." ); - if( aType.CompareTo( aPrefix, aPrefix.Len() ) != 0 ) + OUString aType( xShape->getShapeType() ); + const OUString aPrefix( "com.sun.star.presentation." ); + if( !aType.startsWith( aPrefix ) ) { SdrObject* pObj = SvxFmDrawPage::_CreateSdrObject( xShape ); if( pObj && ( (pObj->GetObjInventor() != SdrInventor) || (pObj->GetObjIdentifier() != OBJ_PAGE) ) ) @@ -414,78 +414,78 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const Reference< drawing::XShap return pObj; } - aType = aType.Copy( aPrefix.Len() ); + aType = aType.copy( aPrefix.getLength() ); PresObjKind eObjKind = PRESOBJ_NONE; - if( aType.EqualsAscii( "TitleTextShape" ) ) + if( aType == "TitleTextShape" ) { eObjKind = PRESOBJ_TITLE; } - else if( aType.EqualsAscii( "OutlinerShape" ) ) + else if( aType == "OutlinerShape" ) { eObjKind = PRESOBJ_OUTLINE; } - else if( aType.EqualsAscii( "SubtitleShape" ) ) + else if( aType == "SubtitleShape" ) { eObjKind = PRESOBJ_TEXT; } - else if( aType.EqualsAscii( "OLE2Shape" ) ) + else if( aType == "OLE2Shape" ) { eObjKind = PRESOBJ_OBJECT; } - else if( aType.EqualsAscii( "ChartShape" ) ) + else if( aType == "ChartShape" ) { eObjKind = PRESOBJ_CHART; } - else if( aType.EqualsAscii( "CalcShape" ) ) + else if( aType == "CalcShape" ) { eObjKind = PRESOBJ_CALC; } - else if( aType.EqualsAscii( "TableShape" ) ) + else if( aType == "TableShape" ) { eObjKind = PRESOBJ_TABLE; } - else if( aType.EqualsAscii( "GraphicObjectShape" ) ) + else if( aType == "GraphicObjectShape" ) { eObjKind = PRESOBJ_GRAPHIC; } - else if( aType.EqualsAscii( "OrgChartShape" ) ) + else if( aType == "OrgChartShape" ) { eObjKind = PRESOBJ_ORGCHART; } - else if( aType.EqualsAscii( "PageShape" ) ) + else if( aType == "PageShape" ) { if( GetPage()->GetPageKind() == PK_NOTES && GetPage()->IsMasterPage() ) eObjKind = PRESOBJ_TITLE; else eObjKind = PRESOBJ_PAGE; } - else if( aType.EqualsAscii( "NotesShape" ) ) + else if( aType == "NotesShape" ) { eObjKind = PRESOBJ_NOTES; } - else if( aType.EqualsAscii( "HandoutShape" ) ) + else if( aType == "HandoutShape" ) { eObjKind = PRESOBJ_HANDOUT; } - else if( aType.EqualsAscii( "FooterShape" ) ) + else if( aType == "FooterShape" ) { eObjKind = PRESOBJ_FOOTER; } - else if( aType.EqualsAscii( "HeaderShape" ) ) + else if( aType == "HeaderShape" ) { eObjKind = PRESOBJ_HEADER; } - else if( aType.EqualsAscii( "SlideNumberShape" ) ) + else if( aType == "SlideNumberShape" ) { eObjKind = PRESOBJ_SLIDENUMBER; } - else if( aType.EqualsAscii( "DateTimeShape" ) ) + else if( aType == "DateTimeShape" ) { eObjKind = PRESOBJ_DATETIME; } - else if( aType.EqualsAscii( "MediaShape" ) ) + else if( aType == "MediaShape" ) { eObjKind = PRESOBJ_MEDIA; } @@ -1531,10 +1531,10 @@ void SdGenericDrawPage::setBookmarkURL( OUString& rURL ) sal_Int32 nIndex = rURL.indexOf( (sal_Unicode)'#' ); if( nIndex != -1 ) { - const String aFileName( rURL.copy( 0, nIndex ) ); - const String aBookmarkName( SdDrawPage::getUiNameFromPageApiName( rURL.copy( nIndex+1 ) ) ); + const OUString aFileName( rURL.copy( 0, nIndex ) ); + const OUString aBookmarkName( SdDrawPage::getUiNameFromPageApiName( rURL.copy( nIndex+1 ) ) ); - if( aFileName.Len() && aBookmarkName.Len() ) + if( !aFileName.isEmpty() && !aBookmarkName.isEmpty() ) { static_cast<SdPage*>(SvxFmDrawPage::mpPage)->DisconnectLink(); static_cast<SdPage*>(SvxFmDrawPage::mpPage)->SetFileName( aFileName ); @@ -1897,10 +1897,10 @@ sal_Bool SAL_CALL SdPageLinkTargets::hasElements() while( aIter.IsMore() ) { SdrObject* pObj = aIter.Next(); - String aStr( pObj->GetName() ); - if( !aStr.Len() && pObj->ISA( SdrOle2Obj ) ) + OUString aStr( pObj->GetName() ); + if( aStr.isEmpty() && pObj->ISA( SdrOle2Obj ) ) aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); - if( aStr.Len() ) + if( !aStr.isEmpty() ) return sal_True; } } @@ -1944,10 +1944,10 @@ Sequence< OUString > SAL_CALL SdPageLinkTargets::getElementNames() while( aIter.IsMore() ) { SdrObject* pObj = aIter.Next(); - String aStr( pObj->GetName() ); - if( !aStr.Len() && pObj->ISA( SdrOle2Obj ) ) + OUString aStr( pObj->GetName() ); + if( aStr.isEmpty() && pObj->ISA( SdrOle2Obj ) ) aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); - if( aStr.Len() ) + if( !aStr.isEmpty() ) nObjCount++; } } @@ -1961,10 +1961,10 @@ Sequence< OUString > SAL_CALL SdPageLinkTargets::getElementNames() while( aIter.IsMore() ) { SdrObject* pObj = aIter.Next(); - String aStr( pObj->GetName() ); - if( !aStr.Len() && pObj->ISA( SdrOle2Obj ) ) + OUString aStr( pObj->GetName() ); + if( aStr.isEmpty() && pObj->ISA( SdrOle2Obj ) ) aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); - if( aStr.Len() ) + if( !aStr.isEmpty() ) *pStr++ = aStr; } } @@ -1980,7 +1980,7 @@ sal_Bool SAL_CALL SdPageLinkTargets::hasByName( const OUString& aName ) return FindObject( aName ) != NULL; } -SdrObject* SdPageLinkTargets::FindObject( const String& rName ) const throw() +SdrObject* SdPageLinkTargets::FindObject( const OUString& rName ) const throw() { SdPage* pPage = mpUnoPage->GetPage(); if( pPage == NULL ) @@ -1991,10 +1991,10 @@ SdrObject* SdPageLinkTargets::FindObject( const String& rName ) const throw() while( aIter.IsMore() ) { SdrObject* pObj = aIter.Next(); - String aStr( pObj->GetName() ); - if( !aStr.Len() && pObj->ISA( SdrOle2Obj ) ) + OUString aStr( pObj->GetName() ); + if( aStr.isEmpty() && pObj->ISA( SdrOle2Obj ) ) aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); - if( aStr.Len() && (aStr == rName) ) + if( !aStr.isEmpty() && (aStr == rName) ) return pObj; } @@ -2157,17 +2157,16 @@ OUString getPageApiName( SdPage* pPage ) } -OUString getPageApiNameFromUiName( const String& rUIName ) +OUString getPageApiNameFromUiName( const OUString& rUIName ) { OUString aApiName; - String aDefPageName(SdResId(STR_PAGE)); - aDefPageName += sal_Unicode( ' ' ); + OUString aDefPageName(SD_RESSTR(STR_PAGE) + " "); - if( rUIName.Equals( aDefPageName, 0, aDefPageName.Len() ) ) + if( rUIName.startsWith( aDefPageName ) ) { aApiName = OUString( sEmptyPageName ); - aApiName += rUIName.Copy( aDefPageName.Len() ); + aApiName += rUIName.copy( aDefPageName.getLength() ); } else { @@ -2177,17 +2176,17 @@ OUString getPageApiNameFromUiName( const String& rUIName ) return aApiName; } -OUString SdDrawPage::getPageApiNameFromUiName( const String& rUIName ) +OUString SdDrawPage::getPageApiNameFromUiName( const OUString& rUIName ) { return ::getPageApiNameFromUiName( rUIName ); } -String getUiNameFromPageApiNameImpl( const OUString& rApiName ) +OUString getUiNameFromPageApiNameImpl( const OUString& rApiName ) { - const String aDefPageName( sEmptyPageName ); - if( rApiName.compareTo( aDefPageName, aDefPageName.Len() ) == 0 ) + const OUString aDefPageName( sEmptyPageName ); + if( rApiName.startsWith( aDefPageName ) ) { - OUString aNumber( rApiName.copy( sizeof( sEmptyPageName ) - 1 ) ); + OUString aNumber( rApiName.copy( aDefPageName.getLength() ) ); // create the page number sal_Int32 nPageNumber = aNumber.toInt32(); @@ -2220,7 +2219,7 @@ String getUiNameFromPageApiNameImpl( const OUString& rApiName ) return rApiName; } -String SdDrawPage::getUiNameFromPageApiName( const OUString& rApiName ) +OUString SdDrawPage::getUiNameFromPageApiName( const OUString& rApiName ) { return getUiNameFromPageApiNameImpl( rApiName ); } @@ -2295,9 +2294,8 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName ) } else { - String aDefaultPageName( SdResId(STR_PAGE) ); - aDefaultPageName += sal_Unicode( ' ' ); - if( aName.compareTo( aDefaultPageName, aDefaultPageName.Len() ) == 0 ) + OUString aDefaultPageName( SD_RESSTR(STR_PAGE) + " " ); + if( aName.startsWith( aDefaultPageName ) ) aName = OUString(); } @@ -2932,8 +2930,8 @@ void SdMasterPage::setBackground( const Any& rValue ) SfxStyleSheetBasePool* pSSPool = (SfxStyleSheetBasePool*)pDoc->GetStyleSheetPool(); if(pSSPool) { - String aLayoutName( static_cast< SdPage* >( SvxFmDrawPage::mpPage )->GetLayoutName() ); - aLayoutName.Erase(aLayoutName.Search(String(SD_LT_SEPARATOR))+4); + OUString aLayoutName( static_cast< SdPage* >( SvxFmDrawPage::mpPage )->GetLayoutName() ); + aLayoutName = aLayoutName.copy(0, aLayoutName.indexOf(SD_LT_SEPARATOR)+4); aLayoutName += SD_RESSTR(STR_LAYOUT_BACKGROUND); SfxStyleSheetBase* pStyleSheet = pSSPool->Find( aLayoutName, SD_STYLE_FAMILY_MASTERPAGE ); @@ -2976,8 +2974,8 @@ void SdMasterPage::getBackground( Any& rValue ) throw() SfxStyleSheetBasePool* pSSPool = (SfxStyleSheetBasePool*)pDoc->GetStyleSheetPool(); if(pSSPool) { - String aLayoutName( static_cast< SdPage* >(SvxFmDrawPage::mpPage)->GetLayoutName() ); - aLayoutName.Erase( aLayoutName.Search(String(SD_LT_SEPARATOR))+4); + OUString aLayoutName( static_cast< SdPage* >(SvxFmDrawPage::mpPage)->GetLayoutName() ); + aLayoutName = aLayoutName.copy(0, aLayoutName.indexOf(SD_LT_SEPARATOR)+4); aLayoutName += SD_RESSTR(STR_LAYOUT_BACKGROUND); SfxStyleSheetBase* pStyleSheet = pSSPool->Find( aLayoutName, SD_STYLE_FAMILY_MASTERPAGE ); @@ -3068,10 +3066,8 @@ OUString SAL_CALL SdMasterPage::getName( ) if(SvxFmDrawPage::mpPage) { - String aLayoutName( GetPage()->GetLayoutName() ); - aLayoutName = aLayoutName.Erase(aLayoutName.Search( String(SD_LT_SEPARATOR))); - - return aLayoutName; + OUString aLayoutName( GetPage()->GetLayoutName() ); + return aLayoutName.copy(0, aLayoutName.indexOf(SD_LT_SEPARATOR)); } return OUString(); diff --git a/sd/source/ui/unoidl/unopage.hxx b/sd/source/ui/unoidl/unopage.hxx index a2b3a48..936d2b7 100644 --- a/sd/source/ui/unoidl/unopage.hxx +++ b/sd/source/ui/unoidl/unopage.hxx @@ -173,8 +173,8 @@ public: UNO3_GETIMPLEMENTATION_DECL( SdDrawPage ) static OUString getPageApiName( SdPage* pPage ); - static OUString getPageApiNameFromUiName( const String& rUIName ); - static String getUiNameFromPageApiName( const OUString& rApiName ); + static OUString getPageApiNameFromUiName( const OUString& rUIName ); + static OUString getUiNameFromPageApiName( const OUString& rApiName ); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); @@ -285,7 +285,7 @@ public: virtual ~SdPageLinkTargets() throw(); // intern - SdrObject* FindObject( const String& rName ) const throw(); + SdrObject* FindObject( const OUString& rName ) const throw(); // XServiceInfo virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); commit 96ad9c965b479d81e42ebefcd92a0a384433fa9c Author: Ivan Timofeev <[email protected]> Date: Mon Sep 2 16:57:39 2013 +0400 String->OUString Change-Id: I0557dcc191aab97adb6aa68ebee1970a11600f4f diff --git a/sd/source/ui/inc/PreviewRenderer.hxx b/sd/source/ui/inc/PreviewRenderer.hxx index dfd02e4..7acc7a6 100644 --- a/sd/source/ui/inc/PreviewRenderer.hxx +++ b/sd/source/ui/inc/PreviewRenderer.hxx @@ -79,7 +79,7 @@ public: Image RenderPage ( const SdPage* pPage, const sal_Int32 nWidth, - const String& sSubstitutionText, + const OUString& sSubstitutionText, const bool bObeyHighContrastMode = true, const bool bDisplayPresentationObjects = true); @@ -104,7 +104,7 @@ public: Image RenderPage ( const SdPage* pPage, const Size aPreviewPixelSize, - const String& sSubstitutionText, + const OUString& sSubstitutionText, const bool bObeyHighContrastMode = true, const bool bDisplayPresentationObjects = true); @@ -115,7 +115,7 @@ public: */ Image RenderSubstitution ( const Size& rPreviewPixelSize, - const String& sSubstitutionText); + const OUString& sSubstitutionText); /** Scale the given bitmap by keeping its aspect ratio to the desired width. Add a frame to it afterwards. @@ -145,7 +145,7 @@ private: void PaintPage ( const SdPage* pPage, const bool bDisplayPresentationObjects); - void PaintSubstitutionText (const String& rSubstitutionText); + void PaintSubstitutionText (const OUString& rSubstitutionText); void PaintFrame (void); /** Set up the map mode so that the given page is renderer into a bitmap diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index cb12432..f770498 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -116,7 +116,7 @@ private: Size maSize; Color maBackgroundColor; Color maTextColor; - String msText; + OUString msText; sal_Int32 mnTop; sal_Int32 mnTotalHeight; diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index 64b17f0..1b88f8a 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -100,7 +100,7 @@ PreviewRenderer::~PreviewRenderer (void) Image PreviewRenderer::RenderPage ( const SdPage* pPage, const sal_Int32 nWidth, - const String& rSubstitutionText, + const OUString& rSubstitutionText, const bool bObeyHighContrastMode, const bool bDisplayPresentationObjects) { @@ -129,7 +129,7 @@ Image PreviewRenderer::RenderPage ( Image PreviewRenderer::RenderPage ( const SdPage* pPage, Size aPixelSize, - const String& rSubstitutionText, + const OUString& rSubstitutionText, const bool bObeyHighContrastMode, const bool bDisplayPresentationObjects) { @@ -167,7 +167,7 @@ Image PreviewRenderer::RenderPage ( Image PreviewRenderer::RenderSubstitution ( const Size& rPreviewPixelSize, - const String& rSubstitutionText) + const OUString& rSubstitutionText) { Image aPreview; @@ -352,9 +352,9 @@ void PreviewRenderer::PaintPage ( -void PreviewRenderer::PaintSubstitutionText (const String& rSubstitutionText) +void PreviewRenderer::PaintSubstitutionText (const OUString& rSubstitutionText) { - if (rSubstitutionText.Len() > 0) + if (!rSubstitutionText.isEmpty()) { // Set the font size. const Font& rOriginalFont (mpPreviewDevice->GetFont()); commit 45b757f1c6af983e1825c09047974d32c2f0376f Author: Ivan Timofeev <[email protected]> Date: Mon Sep 2 16:36:48 2013 +0400 remove unused vars Change-Id: I2e7caabbc8464a2a6ee214085e7ea43ba436e030 diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx index f556aff..2d9b7cd5 100644 --- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx @@ -116,7 +116,6 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList) if (pMasterPage != NULL) aCurrentNames.insert (pMasterPage->GetName()); } - MasterPageObserver::MasterPageNameSet::iterator aI; // Insert the recently used master pages that are currently not used. RecentlyUsedMasterPages& rInstance (RecentlyUsedMasterPages::Instance()); diff --git a/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx index e866a63..1dd3d10 100644 --- a/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx +++ b/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx @@ -87,7 +87,6 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList) if (pMasterPage != NULL) aCurrentNames.insert (pMasterPage->GetName()); } - MasterPageObserver::MasterPageNameSet::iterator aI; // Insert the recently used master pages that are currently not used. RecentlyUsedMasterPages& rInstance (RecentlyUsedMasterPages::Instance()); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
