diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-09-10 23:42:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-11 10:54:24 +0100 |
commit | 3e635c3368c23608bac471970f18d1d64684a147 (patch) | |
tree | bcd3c3896b079b16fd26ef826d44c9a93dde41bc /sd | |
parent | c0c7fb66985a9a3e8f9b7a796c1e0489e407879b (diff) |
XubString->rtl::OUString
Change-Id: If7e5d015c95f8f173750ca32e061d69f56e2d93e
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/sdpage.hxx | 6 | ||||
-rw-r--r-- | sd/source/core/drawdoc3.cxx | 10 | ||||
-rw-r--r-- | sd/source/core/sdpage.cxx | 18 | ||||
-rw-r--r-- | sd/source/core/sdpage2.cxx | 8 | ||||
-rw-r--r-- | sd/source/core/stlfamily.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/controls/DocumentHelper.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/view/drviews1.cxx | 17 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsb.cxx | 2 |
9 files changed, 36 insertions, 37 deletions
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx index 9b1236a73a7e..8089e9a058e3 100644 --- a/sd/inc/sdpage.hxx +++ b/sd/inc/sdpage.hxx @@ -127,7 +127,7 @@ protected: sal_uInt32 mnTime; ///< Display time in seconds sal_Bool mbSoundOn; ///< with / without sound. sal_Bool mbExcluded; ///< will (not) be displayed during show. - String maLayoutName; ///< Name of the layout + OUString maLayoutName; ///< Name of the layout String maSoundFile; ///< Path to sound file (MSDOS notation). bool mbLoopSound; bool mbStopSound; @@ -273,8 +273,8 @@ public: virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect); - void SetLayoutName(String aName); - virtual String GetLayoutName() const { return maLayoutName; } + void SetLayoutName(OUString aName); + virtual OUString GetLayoutName() const { return maLayoutName; } void SetFileName(const String& aName) { maFileName = aName; } virtual String GetFileName() const { return maFileName; } diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 27e9197c0cd6..ab8b0e5e82c6 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1258,7 +1258,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool { // Do not delete master pages that have their precious flag set. sal_Bool bDeleteMaster = !pMaster->IsPrecious(); - String aLayoutName = pMaster->GetLayoutName(); + OUString aLayoutName = pMaster->GetLayoutName(); if(bOnlyDuplicatePages ) { @@ -1419,11 +1419,11 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, } else { - String aSearchFor(rLayoutName); - aSearchFor.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR )); - aSearchFor.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ; + OUStringBuffer aBuf(rLayoutName); + aBuf.append(SD_LT_SEPARATOR).append(SdResId(STR_LAYOUT_OUTLINE).toString()); + OUString aSearchFor(aBuf.makeStringAndClear()); - for (sal_uInt16 nMP = 0; nMP < pSourceDoc->GetMasterPageCount(); nMP++) + for (sal_uInt16 nMP = 0; nMP < pSourceDoc->GetMasterPageCount(); ++nMP) { SdPage* pMP = (SdPage*) pSourceDoc->GetMasterPage(nMP); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 0432f5403700..0d44e14e3029 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -118,9 +118,9 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, StarBASIC* pBasic, sal_Bool bMasterPage) // Der Layoutname der Seite wird von SVDRAW benutzt, um die Praesentations- // vorlagen der Gliederungsobjekte zu ermitteln. Darum enthaelt er bereits // den Bezeichner fuer die Gliederung (STR_LAYOUT_OUTLINE). - maLayoutName = String(SdResId(STR_LAYOUT_DEFAULT_NAME)); - maLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR )); - maLayoutName += String(SdResId(STR_LAYOUT_OUTLINE)); + OUStringBuffer aBuf(SdResId(STR_LAYOUT_DEFAULT_NAME).toString()); + aBuf.append(SD_LT_SEPARATOR).append(SdResId(STR_LAYOUT_OUTLINE).toString()); + maLayoutName = aBuf.makeStringAndClear(); Size aPageSize(GetSize()); @@ -2494,18 +2494,16 @@ void SdPage::SetLinkData(const String&, const String& ) |* Layoutname setzen |* \************************************************************************/ -void SdPage::SetLayoutName(String aName) +void SdPage::SetLayoutName(OUString aName) { maLayoutName = aName; if( mbMaster ) { - String aSep( RTL_CONSTASCII_USTRINGPARAM(SD_LT_SEPARATOR) ); - sal_uInt16 nPos = maLayoutName.Search( aSep ); - if ( nPos != STRING_NOTFOUND ) - { - FmFormPage::SetName(maLayoutName.Copy(0, nPos)); - } + OUString aSep(SD_LT_SEPARATOR); + sal_Int32 nPos = maLayoutName.indexOf(aSep); + if (nPos != -1) + FmFormPage::SetName(maLayoutName.copy(0, nPos)); } } diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index d8ec4ec7a52d..f44cbcede000 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -90,10 +90,10 @@ void SdPage::SetPresentationLayout(const String& rLayoutName, /********************************************************************* |* Layoutname der Seite \********************************************************************/ - String aOldLayoutName(maLayoutName); // merken - maLayoutName = rLayoutName; - maLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR )); - maLayoutName += String(SdResId(STR_LAYOUT_OUTLINE)); + OUString aOldLayoutName(maLayoutName); // merken + OUStringBuffer aBuf(rLayoutName); + aBuf.append(SD_LT_SEPARATOR).append(SdResId(STR_LAYOUT_OUTLINE).toString()); + maLayoutName = aBuf.makeStringAndClear(); /********************************************************************* |* ggf. Masterpage suchen und setzen diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx index 7b32a4b2abd9..5024a8134730 100644 --- a/sd/source/core/stlfamily.cxx +++ b/sd/source/core/stlfamily.cxx @@ -62,7 +62,7 @@ typedef std::map< rtl::OUString, rtl::Reference< SdStyleSheet > > PresStyleMap; struct SdStyleFamilyImpl { SdrPageWeakRef mxMasterPage; - String maLayoutName; + OUString maLayoutName; PresStyleMap& getStyleSheets(); rtl::Reference< SfxStyleSheetPool > mxPool; diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx index 65ac625f1d34..10eec0451aa4 100644 --- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx +++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx @@ -315,7 +315,7 @@ void DocumentHelper::AssignMasterPageToPageList ( // Make the layout name by stripping ouf the layout postfix from the // layout name of the given master page. - String sFullLayoutName (pMasterPage->GetLayoutName()); + OUString sFullLayoutName(pMasterPage->GetLayoutName()); String sBaseLayoutName (sFullLayoutName); sBaseLayoutName.Erase (sBaseLayoutName.SearchAscii (SD_LT_SEPARATOR)); @@ -329,8 +329,7 @@ void DocumentHelper::AssignMasterPageToPageList ( for (iPage=rpPageList->begin(); iPage!=rpPageList->end(); ++iPage) { OSL_ASSERT(*iPage!=NULL && (*iPage)->GetModel() == &rTargetDocument); - if (*iPage != NULL - && (*iPage)->GetLayoutName().CompareTo(sFullLayoutName)!=0) + if (*iPage != NULL && (*iPage)->GetLayoutName() != sFullLayoutName) { aCleanedList.push_back(*iPage); } diff --git a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx index 117bc36c3626..5a00b6f11603 100644 --- a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx +++ b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx @@ -351,14 +351,13 @@ void MasterPagesSelector::AssignMasterPageToAllSlides (SdPage* pMasterPage) // Get a list of all pages. As a little optimization we only // include pages that do not already have the given master page // assigned. - String sFullLayoutName (pMasterPage->GetLayoutName()); + OUString sFullLayoutName(pMasterPage->GetLayoutName()); ::sd::slidesorter::SharedPageSelection pPageList ( new ::sd::slidesorter::SlideSorterViewShell::PageSelection()); for (sal_uInt16 nPageIndex=0; nPageIndex<nPageCount; nPageIndex++) { SdPage* pPage = mrDocument.GetSdPage (nPageIndex, PK_STANDARD); - if (pPage != NULL - && pPage->GetLayoutName().CompareTo(sFullLayoutName)!=0) + if (pPage != NULL && pPage->GetLayoutName() != sFullLayoutName) { pPageList->push_back (pPage); } diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 54874de15129..183779a4f798 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -891,9 +891,10 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) if( pNewPage ) { SdrPageView* pPV = mpDrawView->GetSdrPageView(); - - String sPageText (pNewPage->GetLayoutName()); - sPageText.Erase(sPageText.SearchAscii(SD_LT_SEPARATOR)); + OUString sPageText(pNewPage->GetLayoutName()); + sal_Int32 nPos = sPageText.indexOf(SD_LT_SEPARATOR); + if (nPos != -1) + sPageText = sPageText.copy(0, nPos); if (pPV && pNewPage == dynamic_cast< SdPage* >( pPV->GetPage() ) && sPageText == maTabControl.GetPageText(nSelectedPage+1)) @@ -918,7 +919,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) SdPage* pCurrentPage = dynamic_cast< SdPage* >( pPV->GetPage()); if (pPV && pNewPage == pCurrentPage - && pNewPage->GetName() == maTabControl.GetPageText(nSelectedPage+1)) + && maTabControl.GetPageText(nSelectedPage+1).equals(pNewPage->GetName())) { // this slide is already visible return sal_True; @@ -1049,7 +1050,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) } maTabControl.SetCurPageId(nSelectedPage+1); - String aPageName = mpActualPage->GetName(); + OUString aPageName = mpActualPage->GetName(); if (maTabControl.GetPageText(nSelectedPage+1) != aPageName) { @@ -1117,8 +1118,10 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) } } - String aLayoutName(pMaster->GetLayoutName()); - aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR)); + OUString aLayoutName(pMaster->GetLayoutName()); + sal_Int32 nPos = aLayoutName.indexOf(SD_LT_SEPARATOR); + if (nPos != -1) + aLayoutName = aLayoutName.copy(0, nPos); maTabControl.SetCurPageId(nSelectedPage+1); diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx index 0628fe7bcaa1..a4264199a0d1 100644 --- a/sd/source/ui/view/drviewsb.cxx +++ b/sd/source/ui/view/drviewsb.cxx @@ -825,7 +825,7 @@ void DrawViewShell::ModifyLayer ( for( nPos = 0; nPos < nPageCount; nPos++ ) { sal_uInt16 nId = GetLayerTabControl()->GetPageId( nPos ); - if( pLayer->GetName() == GetLayerTabControl()->GetPageText( nId ) ) + if (GetLayerTabControl()->GetPageText(nId).equals(pLayer->GetName())) { nCurPage = nId; break; |