diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-18 13:30:26 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-18 14:12:31 +0100 |
commit | cb9e8bbdb9dd3f2f83ab862ffa6d734af7be79db (patch) | |
tree | 3fca04a12a362514eccdb20e7f668dfe28232573 | |
parent | b9def20cea8d8364ac1fa14aaf1da775128f0fd3 (diff) |
sd: Use appropriate OUString functions on string constants
Change-Id: Ic402f5b5be1f657d9045091056bcb731b3407a9d
-rw-r--r-- | sd/qa/unit/HtmlExportTest.cxx | 2 | ||||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 8 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 4 | ||||
-rw-r--r-- | sd/source/core/EffectMigration.cxx | 2 | ||||
-rw-r--r-- | sd/source/core/drawdoc3.cxx | 6 | ||||
-rw-r--r-- | sd/source/core/sdpage2.cxx | 2 | ||||
-rw-r--r-- | sd/source/core/stlpool.cxx | 2 | ||||
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/animations/SlideTransitionPane.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/dlg/PhotoAlbumDialog.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/dlg/TemplateScanner.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgass.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/sdpreslt.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/docshell/docshel4.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsListener.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopback.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/DocumentRenderer.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/viewshe2.cxx | 4 |
21 files changed, 40 insertions, 40 deletions
diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx index 67c0560d3d68..50602707300c 100644 --- a/sd/qa/unit/HtmlExportTest.cxx +++ b/sd/qa/unit/HtmlExportTest.cxx @@ -20,7 +20,7 @@ private: htmlDocPtr exportAndParseHtml(sd::DrawDocShellRef& xDocShRef) { FileFormat* pFormat = getFormat(HTML); - OUString aExt = OUString( "." ) + OUString::createFromAscii(pFormat->pName); + OUString aExt = "." + OUString::createFromAscii(pFormat->pName); utl::TempFile aTempFile(OUString(), true, &aExt); aTempFile.EnableKillingFile(); exportTo(xDocShRef, pFormat, aTempFile); diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 4c4cf0908d84..037f8e51722a 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -559,7 +559,7 @@ void SdExportTest::testSwappedOutImageExport() { OUString sURL; XPropSet->getPropertyValue("GraphicURL") >>= sURL; - CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), sURL != OUString("vnd.sun.star.GraphicObject:00000000000000000000000000000000")); + CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), sURL != "vnd.sun.star.GraphicObject:00000000000000000000000000000000"); } // Check size { @@ -579,7 +579,7 @@ void SdExportTest::testSwappedOutImageExport() { OUString sURL; XPropSet->getPropertyValue("GraphicURL") >>= sURL; - CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), sURL != OUString("vnd.sun.star.GraphicObject:00000000000000000000000000000000")); + CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), sURL != "vnd.sun.star.GraphicObject:00000000000000000000000000000000"); } // Check size { @@ -685,7 +685,7 @@ void SdExportTest::testImageWithSpecialID() { OUString sURL; XPropSet->getPropertyValue("GraphicURL") >>= sURL; - CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), sURL != OUString("vnd.sun.star.GraphicObject:00000000000000000000000000000000")); + CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), sURL != "vnd.sun.star.GraphicObject:00000000000000000000000000000000"); } // Check size { @@ -705,7 +705,7 @@ void SdExportTest::testImageWithSpecialID() { OUString sURL; XPropSet->getPropertyValue("GraphicURL") >>= sURL; - CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), sURL != OUString("vnd.sun.star.GraphicObject:00000000000000000000000000000000")); + CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), sURL != "vnd.sun.star.GraphicObject:00000000000000000000000000000000"); } // Check size { diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 16d542f1a31b..1ee45bf677db 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -329,8 +329,8 @@ void SdImportTest::testN828390_2() SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj ); CPPUNIT_ASSERT( pTxtObj ); const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); - CPPUNIT_ASSERT(aEdit.GetText(0) == OUString("Linux ")); - CPPUNIT_ASSERT(aEdit.GetText(1) == OUString("Standard Platform")); + CPPUNIT_ASSERT(aEdit.GetText(0) == "Linux "); + CPPUNIT_ASSERT(aEdit.GetText(1) == "Standard Platform"); xDocShRef->DoClose(); } diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index c05e8a994667..c434982711cf 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -1321,7 +1321,7 @@ void createVisibilityOnOffNode(Reference< XTimeContainer >& rxParentContainer, S Sequence< NamedValue > aUserDataSequence; aUserDataSequence.realloc(1); - aUserDataSequence[0].Name = OUString("node-type"); + aUserDataSequence[0].Name = "node-type"; aUserDataSequence[0].Value <<= bOnClick ? EffectNodeType::ON_CLICK : EffectNodeType::AFTER_PREVIOUS; xOuterSeqTimeContainer->setUserData(aUserDataSequence); diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index f1470d4178e5..d00c8aa168fd 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -521,7 +521,7 @@ bool SdDrawDocument::InsertBookmarkAsPage( SdStyleSheetVector aNewGraphicStyles; OUString aRenameStr; if(!bReplace && !bNoDialogs) - aRenameStr = OUString("_"); + aRenameStr = "_"; rStyleSheetPool.RenameAndCopyGraphicSheets(rBookmarkStyleSheetPool, aNewGraphicStyles, aRenameStr); SdStyleSheetVector aNewCellStyles; rStyleSheetPool.CopyCellSheets(rBookmarkStyleSheetPool, aNewCellStyles); @@ -1144,7 +1144,7 @@ void SdDrawDocument::CloseBookmarkDoc() } mxBookmarkDocShRef.Clear(); - maBookmarkFile = ""; + maBookmarkFile.clear(); } // Is this document read-only? @@ -1383,7 +1383,7 @@ OUString createNewMasterPageLayoutName(const SdDrawDocument& rDoc) if(!isMasterPageLayoutNameUnique(rDoc, aRetval)) { - aRetval = ""; + aRetval.clear(); } } diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index 5b4987f6ce80..38c1af1d9e9e 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -392,7 +392,7 @@ SdPage::SdPage(const SdPage& rSrcPage) maSoundFile = rSrcPage.maSoundFile; mbLoopSound = rSrcPage.mbLoopSound; mbStopSound = rSrcPage.mbStopSound; - maCreatedPageName = ""; + maCreatedPageName.clear(); maFileName = rSrcPage.maFileName; maBookmarkName = rSrcPage.maBookmarkName; mbScaleObjects = rSrcPage.mbScaleObjects; diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 29d5e98cd9a1..5e41ba3bb5d0 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -830,7 +830,7 @@ void SdStyleSheetPool::CreateLayoutSheetNames(const OUString& rLayoutName, std:: void SdStyleSheetPool::CreateLayoutSheetList(const OUString& rLayoutName, SdStyleSheetVector& rLayoutSheets ) { - OUString aLayoutNameWithSep(rLayoutName + OUString(SD_LT_SEPARATOR )); + OUString aLayoutNameWithSep(rLayoutName + SD_LT_SEPARATOR); SfxStyleSheetIterator aIter(this, SD_STYLE_FAMILY_MASTERPAGE); SfxStyleSheetBase* pSheet = aIter.First(); diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 0de1d81d2ed9..66544a24a1c4 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -3267,7 +3267,7 @@ void HtmlErrorContext::SetContext( sal_uInt16 nResId, const OUString& rURL ) { mnResId = nResId; maURL1 = rURL; - maURL2 = ""; + maURL2.clear(); } void HtmlErrorContext::SetContext( sal_uInt16 nResId, const OUString& rURL1, const OUString& rURL2 ) diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 9bee8f3726da..7548ad9e0b88 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -602,11 +602,11 @@ void SlideTransitionPane::updateControls() if( aEffect.mbSoundAmbiguous ) { mpLB_SOUND->SetNoSelection(); - maCurrentSoundFile = ""; + maCurrentSoundFile.clear(); } else { - maCurrentSoundFile = ""; + maCurrentSoundFile.clear(); if( aEffect.mbStopSound ) { mpLB_SOUND->SelectEntryPos( 1 ); @@ -813,7 +813,7 @@ impl::TransitionEffect SlideTransitionPane::getTransitionEffectFromControls() co // sound if( mpLB_SOUND->IsEnabled()) { - maCurrentSoundFile = ""; + maCurrentSoundFile.clear(); if( mpLB_SOUND->GetSelectEntryCount() > 0 ) { sal_Int32 nPos = mpLB_SOUND->GetSelectEntryPos(); diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index 0815c6940a43..92421a3f3a11 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -68,7 +68,7 @@ SdPhotoAlbumDialog::SdPhotoAlbumDialog(vcl::Window* pWindow, SdDrawDocument* pAc pImagesLst->SetSelectHdl(LINK(this, SdPhotoAlbumDialog, SelectHdl)); mpGraphicFilter = new GraphicFilter; - sDirUrl = ""; + sDirUrl.clear(); pAddBtn->GrabFocus(); pImagesLst->Clear(); } @@ -455,7 +455,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, FileHdl) OUString sUrl(officecfg::Office::Impress::Pictures::Path::get()); INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - if (sUrl != "") + if (!sUrl.isEmpty()) aDlg.SetDisplayDirectory(sUrl); else aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); @@ -522,7 +522,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, UpHdl) IMPL_LINK_NOARG(SdPhotoAlbumDialog, DownHdl) { sal_uInt16 nActPos = pImagesLst->GetSelectEntryPos(); - if (pImagesLst->GetEntry(nActPos + 1) != OUString("") ) + if (!pImagesLst->GetEntry(nActPos + 1).isEmpty()) { OUString sActEntry( pImagesLst->GetEntry(pImagesLst->GetSelectEntryPos()) ); OUString* pActData = (OUString*) pImagesLst->GetEntryData(pImagesLst->GetSelectEntryPos()); diff --git a/sd/source/ui/dlg/TemplateScanner.cxx b/sd/source/ui/dlg/TemplateScanner.cxx index c84c16a701b5..617f6401c813 100644 --- a/sd/source/ui/dlg/TemplateScanner.cxx +++ b/sd/source/ui/dlg/TemplateScanner.cxx @@ -216,9 +216,9 @@ TemplateScanner::State TemplateScanner::InitializeEntryScanning (void) // We are interested only in three properties: the entry's name, // its URL, and its content type. Sequence<OUString> aProps (3); - aProps[0] = OUString(TITLE); - aProps[1] = OUString(TARGET_URL); - aProps[2] = OUString(DESCRIPTION); + aProps[0] = TITLE; + aProps[1] = TARGET_URL; + aProps[2] = DESCRIPTION; // Create a cursor to iterate over the templates in this folders. ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_DOCUMENTS_ONLY; @@ -304,8 +304,8 @@ TemplateScanner::State TemplateScanner::InitializeFolderScanning (void) // Define the list of properties we are interested in. Sequence<OUString> aProps (2); - aProps[0] = OUString(TITLE); - aProps[1] = OUString(TARGET_DIR_URL); + aProps[0] = TITLE; + aProps[1] = TARGET_DIR_URL; // Create an cursor to iterate over the template folders. ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_ONLY; diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 294892de5ef4..05a0570f9c3f 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -1253,7 +1253,7 @@ IMPL_LINK_NOARG(AssistentDlgImpl, UpdateUserDataHdl) OUString aInfo = mpPage4AskInfoEDT->GetText(); if (aTopic.isEmpty() && aName.isEmpty() && aInfo.isEmpty()) - maDocFile = ""; + maDocFile.clear(); return 0; } diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index 6d1c1f90202e..b6e89c44f153 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -79,7 +79,7 @@ void SdPresLayoutDlg::Reset() if(mrOutAttrs.GetItemState(ATTR_PRESLAYOUT_NAME, true, &pPoolItem) == SfxItemState::SET) maName = static_cast<const SfxStringItem*>(pPoolItem)->GetValue(); else - maName = ""; + maName.clear(); FillValueSet(); @@ -114,7 +114,7 @@ void SdPresLayoutDlg::GetAttr(SfxItemSet& rOutAttrs) { aLayoutName = maLayoutNames[ nId - 1 ]; if( aLayoutName == maStrNone ) - aLayoutName = ""; // that way we encode "- nothing -" (see below) + aLayoutName.clear(); // that way we encode "- nothing -" (see below) } rOutAttrs.Put( SfxStringItem( ATTR_PRESLAYOUT_NAME, aLayoutName ) ); @@ -192,7 +192,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl) else { // that way we encode "- nothing -" - maName = ""; + maName.clear(); } } break; diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 07cd46c1d867..deec364c574b 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -474,7 +474,7 @@ bool DrawDocShell::ConvertFrom( SfxMedium& rMedium ) ErrCode nError = ERRCODE_NONE; bRet = SdXMLFilter( rMedium, *this, true, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 ).Import( nError ); } - else if( aFilterName.equals( "CGM - Computer Graphics Metafile" ) ) + else if( aFilterName == "CGM - Computer Graphics Metafile" ) { mpDoc->CreateFirstPages(); mpDoc->StopWorkStartupDelay(); diff --git a/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx b/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx index cb4dc58ba152..6653a3409550 100644 --- a/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx +++ b/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx @@ -64,7 +64,7 @@ void SAL_CALL GenericConfigurationChangeRequest::execute ( OUString SAL_CALL GenericConfigurationChangeRequest::getName (void) throw (RuntimeException, std::exception) { - return OUString("GenericConfigurationChangeRequest ") + return "GenericConfigurationChangeRequest " + (meMode==Activation ? OUString("activate ") : OUString("deactivate ")) + FrameworkHelper::ResourceIdToString(mxResourceId); } diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 40c62cff4b7d..38a0351771f7 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1917,7 +1917,7 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt) if( mpSlideController->jumpToSlideNumber( maCharBuffer.toInt32() - 1 ) ) displayCurrentSlide(); } - maCharBuffer = ""; + maCharBuffer.clear(); } else { diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx index bdb30bd56c14..b821f77a081e 100644 --- a/sd/source/ui/slidesorter/controller/SlsListener.cxx +++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx @@ -457,7 +457,7 @@ void SAL_CALL Listener::propertyChange ( static const char sCurrentPagePropertyName[] = "CurrentPage"; static const char sEditModePropertyName[] = "IsMasterPageMode"; - if (rEvent.PropertyName.equals(sCurrentPagePropertyName)) + if (rEvent.PropertyName == sCurrentPagePropertyName) { Any aCurrentPage = rEvent.NewValue; Reference<beans::XPropertySet> xPageSet (aCurrentPage, UNO_QUERY); @@ -486,7 +486,7 @@ void SAL_CALL Listener::propertyChange ( } } } - else if (rEvent.PropertyName.equals (sEditModePropertyName)) + else if (rEvent.PropertyName == sEditModePropertyName) { bool bIsMasterPageMode = false; rEvent.NewValue >>= bIsMasterPageMode; diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 4993a2e28c0c..4319fd79ed5b 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2173,7 +2173,7 @@ OUString getPageApiNameFromUiName( const OUString& rUIName ) if( rUIName.startsWith( aDefPageName ) ) { - aApiName = OUString( sEmptyPageName ); + aApiName = sEmptyPageName; aApiName += rUIName.copy( aDefPageName.getLength() ); } else diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 0bd323a8f3f0..42b295dfec94 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -198,8 +198,8 @@ uno::Sequence< OUString > SAL_CALL SdUnoPageBackground::getSupportedServiceNames uno::Sequence< OUString > aNameSequence( 2 ); OUString* pStrings = aNameSequence.getArray(); - *pStrings++ = OUString( sUNO_Service_PageBackground ); - *pStrings = OUString( sUNO_Service_FillProperties ); + *pStrings++ = sUNO_Service_PageBackground; + *pStrings = sUNO_Service_FillProperties; return aNameSequence; } diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 4cf3d54cb16e..57d7736cd0a3 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1947,7 +1947,7 @@ private: rInfo.msPageString += " "; } else - rInfo.msPageString = ""; + rInfo.msPageString.clear(); rInfo.msPageString += rInfo.msTimeDate; long aPageWidth = aPageSize.Width() - pPage->GetLftBorder() - pPage->GetRgtBorder(); diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 3c72e3105302..933714044c2c 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -752,7 +752,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) if( !xObj.is() ) { - aName = ""; + aName.clear(); // call dialog "insert OLE object" GetDocSh()->SetWaitCursor( false ); @@ -967,7 +967,7 @@ void ViewShell::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert sal_uInt16 nViewID (IMPRESS_FACTORY_ID); if (GetViewShellBase().GetMainViewShell().get() != NULL) nViewID = GetViewShellBase().GetMainViewShell()->mpImpl->GetViewId(); - rSequence[nIndex].Name = OUString( sUNO_View_ViewId ); + rSequence[nIndex].Name = sUNO_View_ViewId; OUStringBuffer sBuffer( "view" ); sBuffer.append( static_cast<sal_Int32>(nViewID)); rSequence[nIndex].Value <<= sBuffer.makeStringAndClear(); |