From 347779c223eed6e41b952f49fc0c0d0bec59f846 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 19 May 2017 17:17:23 +0200 Subject: loplugin:stringcopy: sd Change-Id: I6cb37109870b4461d08fccc4a7ac31096416b1d4 --- sd/qa/unit/import-tests.cxx | 2 +- sd/source/core/drawdoc3.cxx | 2 +- sd/source/core/stlfamily.cxx | 2 +- sd/source/filter/html/pubdlg.cxx | 16 ++++++++-------- sd/source/filter/ppt/pptin.cxx | 2 +- sd/source/filter/xml/sdxmlwrp.cxx | 2 +- sd/source/ui/dlg/PhotoAlbumDialog.cxx | 14 +++++++------- sd/source/ui/dlg/custsdlg.cxx | 2 +- sd/source/ui/remotecontrol/Server.cxx | 2 +- sd/source/ui/unoidl/UnoDocumentSettings.cxx | 2 +- sd/source/ui/unoidl/unolayer.cxx | 4 ++-- sd/source/ui/unoidl/unoobj.cxx | 6 +++--- 12 files changed, 28 insertions(+), 28 deletions(-) (limited to 'sd') diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index d52eda84d41a..d379b1fd86c4 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -1207,7 +1207,7 @@ void SdImportTest::testBulletSuffix() const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); const SvxNumBulletItem *pNumFmt = dynamic_cast(aEdit.GetParaAttribs(1).GetItem(EE_PARA_NUMBULLET)); CPPUNIT_ASSERT(pNumFmt); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's suffix is wrong!", OUString(pNumFmt->GetNumRule()->GetLevel(0).GetSuffix()), OUString() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's suffix is wrong!", pNumFmt->GetNumRule()->GetLevel(0).GetSuffix(), OUString() ); xDocShRef->DoClose(); } diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index dada8f687e41..a20f3b4c83e8 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -113,7 +113,7 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc { // Ignore Layouts with "Default" these seem to be special - in the sense that there are lot of assumption all over Impress // about this - if( bRenameDuplicates && aTest != OUString( SdResId( STR_LAYOUT_DEFAULT_NAME ) ) && pTestPage->stringify() != pBMMPage->stringify() ) + if( bRenameDuplicates && aTest != SdResId( STR_LAYOUT_DEFAULT_NAME ) && pTestPage->stringify() != pBMMPage->stringify() ) { pBookmarkDoc->RenameLayoutTemplate( pBMMPage->GetLayoutName(), pBMMPage->GetName() + "_"); diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx index 04bec070c509..d2cadd3876ab 100644 --- a/sd/source/core/stlfamily.cxx +++ b/sd/source/core/stlfamily.cxx @@ -196,7 +196,7 @@ OUString SAL_CALL SdStyleFamily::getName() if( nIndex != -1 ) aLayoutName = aLayoutName.copy(0, nIndex); - return OUString( aLayoutName ); + return aLayoutName; } else { diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 7b269d760061..39de03af59c7 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -797,15 +797,15 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) aProps.push_back( aValue ); aValue.Name = "WebCastCGIURL"; - aValue.Value <<= OUString( pPage2_CGI->GetText() ); + aValue.Value <<= pPage2_CGI->GetText(); aProps.push_back( aValue ); aValue.Name = "WebCastTargetURL"; - aValue.Value <<= OUString( pPage2_URL->GetText() ); + aValue.Value <<= pPage2_URL->GetText(); aProps.push_back( aValue ); } aValue.Name = "IndexURL"; - aValue.Value <<= OUString( pPage2_Index->GetText() ); + aValue.Value <<= pPage2_Index->GetText(); aProps.push_back( aValue ); if( pPage2_Kiosk->IsChecked() && pPage2_ChgAuto->IsChecked() ) @@ -832,7 +832,7 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) aProps.push_back( aValue ); aValue.Name = "Compression"; - aValue.Value <<= OUString( pPage3_Quality->GetText() ); + aValue.Value <<= pPage3_Quality->GetText(); aProps.push_back( aValue ); aValue.Name = "Format"; @@ -856,11 +856,11 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) // Page 4 aValue.Name = "Author"; - aValue.Value <<= OUString( pPage4_Author->GetText() ); + aValue.Value <<= pPage4_Author->GetText(); aProps.push_back( aValue ); aValue.Name = "EMail"; - aValue.Value <<= OUString( pPage4_Email->GetText() ); + aValue.Value <<= pPage4_Email->GetText(); aProps.push_back( aValue ); // try to guess protocol for user's homepage @@ -869,11 +869,11 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams ) INetURLObject::EncodeMechanism::All ); aValue.Name = "HomepageURL"; - aValue.Value <<= OUString( aHomeURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); + aValue.Value <<= aHomeURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); aProps.push_back( aValue ); aValue.Name = "UserText"; - aValue.Value <<= OUString( pPage4_Misc->GetText() ); + aValue.Value <<= pPage4_Misc->GetText(); aProps.push_back( aValue ); if( m_bImpress ) diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index be701d617712..67cf9c3f81e0 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -498,7 +498,7 @@ bool ImplSdPPTImport::Import() pHyperlink->aConvSubString = maSlideNameList[ nPageNumber ]; if ( pHyperlink->aConvSubString.isEmpty() ) { - pHyperlink->aConvSubString = OUString( SdResId( STR_PAGE ) ) + " " + ( mpDoc->CreatePageNumValue( (sal_uInt16)nPageNumber + 1 ) ); + pHyperlink->aConvSubString = SdResId( STR_PAGE ) + " " + ( mpDoc->CreatePageNumValue( (sal_uInt16)nPageNumber + 1 ) ); } } else { // if sub address is given but not internal, use it as it is diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index b84854e68b94..ef9f1a264f18 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -871,7 +871,7 @@ bool SdXMLFilter::Export() beans::PropertyValue* pProps = aDescriptor.getArray(); pProps[0].Name = "FileName"; - pProps[0].Value <<= OUString( mrMedium.GetName() ); + pProps[0].Value <<= mrMedium.GetName(); { uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver; diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index ffc73486e2c3..3cb531eed408 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -208,11 +208,11 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, Button*, void) // grab the left one void* pD1 = pImagesLst->GetEntryData(i); pData = static_cast(pD1); - sUrl1 = pData ? OUString(*pData) : ""; + sUrl1 = pData ? *pData : ""; // grab the right one void* pD2 = pImagesLst->GetEntryData(i+1); pData = static_cast(pD2); - sUrl2 = pData ? OUString(*pData) : ""; + sUrl2 = pData ? *pData : ""; if( !sUrl1.isEmpty() ) { @@ -318,22 +318,22 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, Button*, void) // grab the upper left one void* pD1 = pImagesLst->GetEntryData(i); pData = static_cast(pD1); - sUrl1 = pData ? OUString(*pData) : ""; + sUrl1 = pData ? *pData : ""; // grab the upper right one void* pD2 = pImagesLst->GetEntryData(i+1); pData = static_cast(pD2); - sUrl2 = pData ? OUString(*pData) : ""; + sUrl2 = pData ? *pData : ""; // grab the lower left one void* pD3 = pImagesLst->GetEntryData(i+2); pData = static_cast(pD3); - sUrl3 = pData ? OUString(*pData) : ""; + sUrl3 = pData ? *pData : ""; // grab the lower right one void* pD4 = pImagesLst->GetEntryData(i+3); pData = static_cast(pD4); - sUrl4 = pData ? OUString(*pData) : ""; + sUrl4 = pData ? *pData : ""; if( !sUrl1.isEmpty() ) { @@ -608,7 +608,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, RemoveHdl, Button*, void) IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl, ListBox&, void) { OUString* pData = static_cast(pImagesLst->GetSelectEntryData()); - OUString sImgUrl = pData ? OUString(*pData) : ""; + OUString sImgUrl = pData ? *pData : ""; if (sImgUrl != SdResId(STR_PHOTO_ALBUM_TEXTBOX)) { diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 1666bffee6c7..cba70a630de0 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -339,7 +339,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( vcl::Window* pWindow, else { rpCustomShow = new SdCustomShow; - m_pEdtName->SetText( OUString( SdResId( STR_NEW_CUSTOMSHOW ) ) ); + m_pEdtName->SetText( SdResId( STR_NEW_CUSTOMSHOW ) ); m_pEdtName->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) ); rpCustomShow->SetName( m_pEdtName->GetText() ); } diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index 6d51a4e0d4a5..047747b70eea 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -307,7 +307,7 @@ bool RemoteServer::connectClient( const std::shared_ptr< ClientInfo >& pClient, } if ( !aSaved ) xConfig->insertByName( apClient->mName, makeAny( xChild ) ); - aValue <<= OUString( apClient->mPin ); + aValue <<= apClient->mPin; xChild->replaceByName("PIN", aValue); aChanges->commit(); } diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 19114a64ddce..4368ba73d672 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -1097,7 +1097,7 @@ DocumentSettings::_getPropertyValues( case HANDLE_PRINTERNAME: { SfxPrinter *pTempPrinter = pDocSh->GetPrinter( false ); - *pValue <<= pTempPrinter ? OUString ( pTempPrinter->GetName()) : OUString(); + *pValue <<= pTempPrinter ? pTempPrinter->GetName() : OUString(); } break; case HANDLE_PRINTERJOB: diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 847e101cfe21..59cb9c588bd8 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -266,10 +266,10 @@ uno::Any SAL_CALL SdLayer::getPropertyValue( const OUString& PropertyName ) break; } case WID_LAYER_TITLE: - aValue <<= OUString( pLayer->GetTitle() ); + aValue <<= pLayer->GetTitle(); break; case WID_LAYER_DESC: - aValue <<= OUString( pLayer->GetDescription() ); + aValue <<= pLayer->GetDescription(); break; default: throw beans::UnknownPropertyException( PropertyName, static_cast(this)); diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 685bd6f5de1e..ba0b4d42bf9d 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -1492,7 +1492,7 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) pProperties->State = beans::PropertyState_DIRECT_VALUE; pProperties++; - aAny <<= OUString( pInfo->GetBookmark() ); + aAny <<= pInfo->GetBookmark(); pProperties->Name = maStrScript; pProperties->Handle = -1; pProperties->Value = aAny; @@ -1525,7 +1525,7 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) sBuffer.append( '.' ); sBuffer.append( aMacroName ); - aAny <<= OUString( sBuffer.makeStringAndClear() ); + aAny <<= sBuffer.makeStringAndClear(); pProperties->Name = maStrMacroName; pProperties->Handle = -1; pProperties->Value = aAny; @@ -1613,7 +1613,7 @@ uno::Any SAL_CALL SdUnoEventsAccess::getByName( const OUString& aName ) case presentation::ClickAction_SOUND: if( eClickAction == presentation::ClickAction_SOUND || pInfo->mbSecondSoundOn ) { - aAny <<= OUString( pInfo->GetBookmark()); + aAny <<= pInfo->GetBookmark(); pProperties->Name = maStrSoundURL; pProperties->Handle = -1; pProperties->Value = aAny; -- cgit