diff options
author | Noel Grandin <noel@peralex.com> | 2013-09-18 15:17:39 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-09-19 10:14:23 +0200 |
commit | 001080ae7010767f515723abe725182d98fbac0f (patch) | |
tree | 227361cf63394ff8bb24e6f927317ea3cc53021a /sd | |
parent | 15b3fbf9385835df4636ec7f10e1d2b94754eab0 (diff) |
convert some .cxx files in sd from String to OUString
Change-Id: I3f3ba3521b72d78887e01970192f353cdc866626
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/toolpanel/controls/MasterPageContainerFiller.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/sddetect.cxx | 36 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unocpres.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 78 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unoobj.cxx | 19 |
7 files changed, 73 insertions, 76 deletions
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainerFiller.cxx b/sd/source/ui/toolpanel/controls/MasterPageContainerFiller.cxx index 1aa244a3fba7..666666bbedec 100644 --- a/sd/source/ui/toolpanel/controls/MasterPageContainerFiller.cxx +++ b/sd/source/ui/toolpanel/controls/MasterPageContainerFiller.cxx @@ -45,9 +45,9 @@ MasterPageContainerFiller::MasterPageContainerFiller (ContainerAdapter& rpAdapte SharedMasterPageDescriptor pDescriptor (new MasterPageDescriptor( MasterPageContainer::DEFAULT, 0, - String(), - String(), - String(), + OUString(), + OUString(), + OUString(), false, ::boost::shared_ptr<PageObjectProvider>(new DefaultPageObjectProvider()), ::boost::shared_ptr<PreviewProvider>(new PagePreviewProvider()))); @@ -162,7 +162,7 @@ MasterPageContainerFiller::State MasterPageContainerFiller::AddTemplate (void) mnIndex, mpLastAddedEntry->msPath, mpLastAddedEntry->msTitle, - String(), + OUString(), false, ::boost::shared_ptr<PageObjectProvider>( new TemplatePageObjectProvider(mpLastAddedEntry->msPath)), diff --git a/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx index 1dd3d10a33d2..dc483a5d7a97 100644 --- a/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx +++ b/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx @@ -100,8 +100,8 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList) MasterPageContainer::Token aToken (rInstance.GetTokenForIndex(nIndex)); if (aToken != MasterPageContainer::NIL_TOKEN) { - String sStyleName (mpContainer->GetStyleNameForToken(aToken)); - if (sStyleName.Len()==0 + OUString sStyleName (mpContainer->GetStyleNameForToken(aToken)); + if (sStyleName.isEmpty() || aCurrentNames.find(sStyleName) == aCurrentNames.end()) { rItemList.push_back(aToken); diff --git a/sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.cxx b/sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.cxx index 0e6d95803bdb..7969bbd7fc70 100644 --- a/sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.cxx +++ b/sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.cxx @@ -206,7 +206,7 @@ void RecentlyUsedMasterPages::LoadPersistentValues (void) MasterPageContainer::TEMPLATE, -1, sURL, - String(), + OUString(), sName, false, ::boost::shared_ptr<PageObjectProvider>( diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx index e3a93da6ea1a..e340e017dbd8 100644 --- a/sd/source/ui/unoidl/sddetect.cxx +++ b/sd/source/ui/unoidl/sddetect.cxx @@ -107,10 +107,10 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< beans::PropertyValue >& lDes Reference< XInputStream > xStream; Reference< XContent > xContent; Reference< XInteractionHandler > xInteraction; - String aURL; + OUString aURL; OUString sTemp; OUString aTypeName; // a name describing the type (from MediaDescriptor, usually from flat detection) - String aPreselectedFilterName; // a name describing the filter to use (from MediaDescriptor, usually from UI action) + OUString aPreselectedFilterName; // a name describing the filter to use (from MediaDescriptor, usually from UI action) OUString aDocumentTitle; // interesting only if set in this method @@ -141,7 +141,7 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< beans::PropertyValue >& lDes lDescriptor[nProperty].Value >>= sTemp; aURL = sTemp; } - else if( !aURL.Len() && lDescriptor[nProperty].Name == "FileName" ) + else if( aURL.isEmpty() && lDescriptor[nProperty].Name == "FileName" ) { lDescriptor[nProperty].Value >>= sTemp; aURL = sTemp; @@ -189,22 +189,22 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< beans::PropertyValue >& lDes bWasReadOnly = pItem && pItem->GetValue(); const SfxFilter* pFilter = 0; - String aPrefix = OUString("private:factory/"); - if( aURL.Match( aPrefix ) == aPrefix.Len() ) + OUString aPrefix = OUString("private:factory/"); + if( aURL.startsWith( aPrefix ) ) { if( SvtModuleOptions().IsImpress() ) { - String aPattern( aPrefix ); - aPattern += OUString("simpress"); - if ( aURL.Match( aPattern ) >= aPattern.Len() ) + OUString aPattern( aPrefix ); + aPattern += "simpress"; + if ( aURL.startsWith( aPattern ) ) pFilter = SfxFilter::GetDefaultFilterFromFactory( aURL ); } if( !pFilter && SvtModuleOptions().IsDraw() ) { - String aPattern( aPrefix ); - aPattern += OUString("sdraw"); - if ( aURL.Match( aPattern ) >= aPattern.Len() ) + OUString aPattern( aPrefix ); + aPattern += "sdraw"; + if ( aURL.startsWith( aPattern ) ) pFilter = SfxFilter::GetDefaultFilterFromFactory( aURL ); } } @@ -213,7 +213,7 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< beans::PropertyValue >& lDes // ctor of SfxMedium uses owner transition of ItemSet SfxMedium aMedium( aURL, bWasReadOnly ? STREAM_STD_READ : STREAM_STD_READWRITE, NULL, pSet ); aMedium.UseInteractionHandler( sal_True ); - if ( aPreselectedFilterName.Len() ) + if ( !aPreselectedFilterName.isEmpty() ) pFilter = SfxFilter::GetFilterByName( aPreselectedFilterName ); else if (!aTypeName.isEmpty()) { @@ -400,17 +400,17 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< beans::PropertyValue >& lDes } else { - String aShortName( aDesc.GetImportFormatShortName( aDesc.GetFileFormat() ) ); + OUString aShortName( aDesc.GetImportFormatShortName( aDesc.GetFileFormat() ) ); GraphicFilter &rGrfFilter = GraphicFilter::GetGraphicFilter(); - const String aName( rGrfFilter.GetImportFormatTypeName( rGrfFilter.GetImportFormatNumberForShortName( aShortName ) ) ); + const OUString aName( rGrfFilter.GetImportFormatTypeName( rGrfFilter.GetImportFormatNumberForShortName( aShortName ) ) ); - if ( pFilter && aShortName.EqualsIgnoreCaseAscii( "PCD" ) ) // there is a multiple pcd selection possible + if ( pFilter && aShortName.equalsIgnoreAsciiCase( "PCD" ) ) // there is a multiple pcd selection possible { sal_Int32 nBase = 2; // default Base0 - String aFilterTypeName( pFilter->GetRealTypeName() ); - if ( aFilterTypeName.CompareToAscii( "pcd_Photo_CD_Base4" ) == COMPARE_EQUAL ) + OUString aFilterTypeName( pFilter->GetRealTypeName() ); + if ( aFilterTypeName == "pcd_Photo_CD_Base4" ) nBase = 1; - else if ( aFilterTypeName.CompareToAscii( "pcd_Photo_CD_Base16" ) == COMPARE_EQUAL ) + else if ( aFilterTypeName == "pcd_Photo_CD_Base16" ) nBase = 0; FilterConfigItem aFilterConfigItem( "Office.Common/Filter/Graphic/Import/PCD" ); aFilterConfigItem.WriteInt32( "Resolution" , nBase ); diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx index f0f0117a0e66..ce3e77ab67e2 100644 --- a/sd/source/ui/unoidl/unocpres.cxx +++ b/sd/source/ui/unoidl/unocpres.cxx @@ -481,7 +481,7 @@ SdCustomShow * SdXCustomPresentationAccess::getSdCustomShow( const OUString& Nam SdCustomShowList* pList = GetCustomShowList(); const sal_uInt32 nCount = pList ? pList->size() : 0; - const String aName( Name ); + const OUString aName( Name ); while( nIdx < nCount ) { diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 6a55af3ad1f3..055fb00f22bb 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -484,8 +484,8 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, sal_Bool bDuplicate sal_uInt16 nStandardPageNum = pPreviousStandardPage->GetPageNum() + 2; SdPage* pPreviousNotesPage = (SdPage*) mpDoc->GetPage( nStandardPageNum - 1 ); sal_uInt16 nNotesPageNum = nStandardPageNum + 1; - String aStandardPageName; - String aNotesPageName; + OUString aStandardPageName; + OUString aNotesPageName; /************************************************************** * standard page @@ -966,78 +966,78 @@ uno::Reference< uno::XInterface > SAL_CALL SdXImpressDocument::createInstance( c uno::Reference< uno::XInterface > xRet; - const String aType( aServiceSpecifier ); - if( aType.EqualsAscii( "com.sun.star.presentation.", 0, 26 ) ) + if( aServiceSpecifier.startsWith( "com.sun.star.presentation.") ) { + const OUString aType( aServiceSpecifier.copy(26) ); SvxShape* pShape = NULL; sal_uInt16 nType = OBJ_TEXT; // create a shape wrapper - if( aType.EqualsAscii( "TitleTextShape", 26, 14 ) ) + if( aType.startsWith( "TitleTextShape" ) ) { nType = OBJ_TEXT; } - else if( aType.EqualsAscii( "OutlinerShape", 26, 13 ) ) + else if( aType.startsWith( "OutlinerShape" ) ) { nType = OBJ_TEXT; } - else if( aType.EqualsAscii( "SubtitleShape", 26, 13 ) ) + else if( aType.startsWith( "SubtitleShape" ) ) { nType = OBJ_TEXT; } - else if( aType.EqualsAscii( "GraphicObjectShape", 26, 18 ) ) + else if( aType.startsWith( "GraphicObjectShape" ) ) { nType = OBJ_GRAF; } - else if( aType.EqualsAscii( "PageShape", 26, 9 ) ) + else if( aType.startsWith( "PageShape" ) ) { nType = OBJ_PAGE; } - else if( aType.EqualsAscii( "OLE2Shape", 26, 9 ) ) + else if( aType.startsWith( "OLE2Shape" ) ) { nType = OBJ_OLE2; } - else if( aType.EqualsAscii( "ChartShape", 26, 10 ) ) + else if( aType.startsWith( "ChartShape" ) ) { nType = OBJ_OLE2; } - else if( aType.EqualsAscii( "CalcShape", 26, 9 ) ) + else if( aType.startsWith( "CalcShape" ) ) { nType = OBJ_OLE2; } - else if( aType.EqualsAscii( "TableShape", 26, 10 ) ) + else if( aType.startsWith( "TableShape" ) ) { nType = OBJ_TABLE; } - else if( aType.EqualsAscii( "OrgChartShape", 26, 13 ) ) + else if( aType.startsWith( "OrgChartShape" ) ) { nType = OBJ_OLE2; } - else if( aType.EqualsAscii( "NotesShape", 26, 13 ) ) + else if( aType.startsWith( "NotesShape" ) ) { nType = OBJ_TEXT; } - else if( aType.EqualsAscii( "HandoutShape", 26, 13 ) ) + else if( aType.startsWith( "HandoutShape" ) ) { nType = OBJ_PAGE; } - else if( aType.EqualsAscii( "FooterShape", 26, 12 ) ) + else if( aType.startsWith( "FooterShape" ) ) { nType = OBJ_TEXT; } - else if( aType.EqualsAscii( "HeaderShape", 26, 12 ) ) + else if( aType.startsWith( "HeaderShape" ) ) { nType = OBJ_TEXT; } - else if( aType.EqualsAscii( "SlideNumberShape", 26, 17 ) ) + else if( aType.startsWith( "SlideNumberShape" ) ) { nType = OBJ_TEXT; } - else if( aType.EqualsAscii( "DateTimeShape", 26, 17 ) ) + else if( aType.startsWith( "DateTimeShape" ) ) { nType = OBJ_TEXT; } - else if( aType.EqualsAscii( "MediaShape", 26, 10 ) ) + else if( aType.startsWith( "MediaShape" ) ) { nType = OBJ_MEDIA; } @@ -1538,17 +1538,17 @@ ImplRenderPaintProc::~ImplRenderPaintProc() { } -sal_Int32 ImplPDFGetBookmarkPage( const String& rBookmark, SdDrawDocument& rDoc ) +sal_Int32 ImplPDFGetBookmarkPage( const OUString& rBookmark, SdDrawDocument& rDoc ) { sal_Int32 nPage = -1; OSL_TRACE("GotoBookmark %s", OUStringToOString(rBookmark, RTL_TEXTENCODING_UTF8).getStr()); - String aBookmark( rBookmark ); + OUString aBookmark( rBookmark ); - if( rBookmark.Len() && rBookmark.GetChar( 0 ) == sal_Unicode('#') ) - aBookmark = rBookmark.Copy( 1 ); + if( !rBookmark.isEmpty() && rBookmark[ 0 ] == '#' ) + aBookmark = rBookmark.copy( 1 ); // is the bookmark a page ? sal_Bool bIsMasterPage; @@ -1585,11 +1585,11 @@ void ImplPDFExportComments( uno::Reference< drawing::XDrawPage > xPage, vcl::PDF Date aDate( aDateTime.Day, aDateTime.Month, aDateTime.Year ); Time aTime( Time::EMPTY ); - String aStr( SvxDateTimeField::GetFormatted( aDate, aTime, SVXDATEFORMAT_B, *(SD_MOD()->GetNumberFormatter()), eLanguage ) ); + OUString aStr( SvxDateTimeField::GetFormatted( aDate, aTime, SVXDATEFORMAT_B, *(SD_MOD()->GetNumberFormatter()), eLanguage ) ); vcl::PDFNote aNote; - String sTitle( xAnnotation->getAuthor() ); - sTitle.AppendAscii( ", " ); + OUString sTitle( xAnnotation->getAuthor() ); + sTitle += ", "; sTitle += aStr; aNote.Title = sTitle; aNote.Contents = xText->getString(); @@ -1803,7 +1803,7 @@ sal_Bool ImplRenderPaintProc::IsVisible( const SdrObject* pObj ) const const SdrLayer* pSdrLayer = rLayerAdmin.GetLayer( nLayerId ); if ( pSdrLayer ) { - String aLayerName = pSdrLayer->GetName(); + OUString aLayerName = pSdrLayer->GetName(); bVisible = pSdrPageView->IsLayerVisible( aLayerName ); } } @@ -1818,7 +1818,7 @@ sal_Bool ImplRenderPaintProc::IsPrintable( const SdrObject* pObj ) const const SdrLayer* pSdrLayer = rLayerAdmin.GetLayer( nLayerId ); if ( pSdrLayer ) { - String aLayerName = pSdrLayer->GetName(); + OUString aLayerName = pSdrLayer->GetName(); bPrintable = pSdrPageView->IsLayerPrintable( aLayerName ); } } @@ -2108,8 +2108,8 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r rBookmarks.clear(); //---> #i56629, #i40318 //get the page name, will be used as outline element in PDF bookmark pane - String aPageName = mpDoc->GetSdPage( (sal_uInt16)nPageNumber - 1 , PK_STANDARD )->GetName(); - if( aPageName.Len() > 0 ) + OUString aPageName = mpDoc->GetSdPage( (sal_uInt16)nPageNumber - 1 , PK_STANDARD )->GetName(); + if( !aPageName.isEmpty() ) { // insert the bookmark to this page into the NamedDestinations if( pPDFExtOutDevData->GetIsExportNamedDestinations() ) @@ -2676,8 +2676,8 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn nInsertPos = nMPageCount; // now generate a unique name for the new masterpage - const String aStdPrefix( SdResId(STR_LAYOUT_DEFAULT_NAME) ); - String aPrefix( aStdPrefix ); + const OUString aStdPrefix( SdResId(STR_LAYOUT_DEFAULT_NAME) ); + OUString aPrefix( aStdPrefix ); sal_Bool bUnique = sal_True; sal_Int32 i = 0; @@ -2697,15 +2697,13 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn if( !bUnique ) { i++; - aPrefix = aStdPrefix; - aPrefix += sal_Unicode( ' ' ); - aPrefix += OUString::number( i ); + aPrefix = aStdPrefix + " " + OUString::number( i ); } } while( !bUnique ); - String aLayoutName( aPrefix ); - aLayoutName.AppendAscii( SD_LT_SEPARATOR ); + OUString aLayoutName( aPrefix ); + aLayoutName += SD_LT_SEPARATOR; aLayoutName += SD_RESSTR(STR_LAYOUT_OUTLINE); // create styles @@ -2974,7 +2972,7 @@ SdPage* SdDocLinkTargets::FindPage( const OUString& rName ) const throw() sal_uInt16 nPage; SdPage* pPage; - const String aName( rName ); + const OUString aName( rName ); const bool bDraw = mpDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW; diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 72a3b49a051c..8ff7ff2866da 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -1176,8 +1176,7 @@ SdUnoEventsAccess::SdUnoEventsAccess( SdXShape* pShape ) throw() static void clearEventsInAnimationInfo( SdAnimationInfo* pInfo ) { - const String aEmpty; - pInfo->SetBookmark( aEmpty ); + pInfo->SetBookmark( "" ); pInfo->mbSecondSoundOn = sal_False; pInfo->mbSecondPlayFull = sal_False; pInfo->meClickAction = presentation::ClickAction_NONE; @@ -1425,11 +1424,11 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno } else { - String aMacro = aStrMacro; + OUString aMacro = aStrMacro; - String aLibName = aMacro.GetToken(0, sal_Unicode('.')); - String aModulName = aMacro.GetToken(1, sal_Unicode('.')); - String aMacroName = aMacro.GetToken(2, sal_Unicode('.')); + OUString aLibName = aMacro.getToken(0, '.'); + OUString aModulName = aMacro.getToken(1, '.'); + OUString aMacroName = aMacro.getToken(2, '.'); OUStringBuffer sBuffer; sBuffer.append( aMacroName ); @@ -1537,14 +1536,14 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) pProperties->State = beans::PropertyState_DIRECT_VALUE; pProperties++; - String aMacro = pInfo->GetBookmark(); + OUString aMacro = pInfo->GetBookmark(); // aMacro has got following format: // "Macroname.Modulname.Libname.Documentname" or // "Macroname.Modulname.Libname.Applicationname" - String aMacroName = aMacro.GetToken(0, sal_Unicode('.')); - String aModulName = aMacro.GetToken(1, sal_Unicode('.')); - String aLibName = aMacro.GetToken(2, sal_Unicode('.')); + OUString aMacroName = aMacro.getToken(0, '.'); + OUString aModulName = aMacro.getToken(1, '.'); + OUString aLibName = aMacro.getToken(2, '.'); OUStringBuffer sBuffer; sBuffer.append( aLibName ); |