diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-02 18:59:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-03 17:11:14 +0100 |
commit | ab285c743afa1c8769581871d7b56374fd8c49f1 (patch) | |
tree | d5628df49fb4db29d474e5e7b7cef4072c33153a /sd | |
parent | f4544f3903fed3a656e3cd57e1bd83582e024b96 (diff) |
loplugin:stringadd
tweak the plugin to be more permissive, then validate by hand
afterwards
Change-Id: I40c5c911fe6ff7e45baaca372abf7dac211d9654
Reviewed-on: https://gerrit.libreoffice.org/81942
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/drawdoc2.cxx | 4 | ||||
-rw-r--r-- | sd/source/core/stlsheet.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/html/buttonset.cxx | 10 | ||||
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationList.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationmanager.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/func/fucopy.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fudraw.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsfil.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fumorph.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/futransf.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fuvect.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsToolTip.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/view/GraphicObjectBar.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews6.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews9.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/viewshe3.cxx | 7 |
20 files changed, 44 insertions, 52 deletions
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 5d4335a5c53d..5c31e8fd3614 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -353,8 +353,8 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * pPage, sal_uInt16 nPo { // update link page number number += nIncrement; - aURL = aURL.replaceAt(aHashSlide.getLength() + 1, aURL.getLength() - aHashSlide.getLength() - 1, ""); - aURL += OUString::number(number); + aURL = aURL.replaceAt(aHashSlide.getLength() + 1, aURL.getLength() - aHashSlide.getLength() - 1, "") + + OUString::number(number); if (bNotes) { aURL += " " + sNotes; diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 9d097c01f633..89db33f8a85d 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -401,8 +401,7 @@ SdStyleSheet* SdStyleSheet::GetRealStyleSheet() const if (nPos >= 0) { OUString aNumStr(aStyleName.copy(aOutlineStr.getLength())); - aInternalName = OUString(STR_LAYOUT_OUTLINE); - aInternalName += aNumStr; + aInternalName = STR_LAYOUT_OUTLINE + aNumStr; } } diff --git a/sd/source/filter/html/buttonset.cxx b/sd/source/filter/html/buttonset.cxx index a6c88b85f367..751e5db0b63f 100644 --- a/sd/source/filter/html/buttonset.cxx +++ b/sd/source/filter/html/buttonset.cxx @@ -153,14 +153,14 @@ public: ButtonSetImpl::ButtonSetImpl() { - const OUString sSubPath( "/wizard/web/buttons" ); + static const char sSubPath[] = "/wizard/web/buttons" ; - OUString sSharePath( SvtPathOptions().GetConfigPath() ); - sSharePath += sSubPath; + OUString sSharePath = SvtPathOptions().GetConfigPath() + + sSubPath; scanForButtonSets( sSharePath ); - OUString sUserPath( SvtPathOptions().GetUserConfigPath() ); - sUserPath += sSubPath; + OUString sUserPath = SvtPathOptions().GetUserConfigPath() + + sSubPath; scanForButtonSets( sUserPath ); } diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 422cef0a55b5..ad8e2a97eae6 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -2652,8 +2652,7 @@ void HtmlExport::CreateBitmaps() if(!mbImpress && (nButton == BTN_TEXT || nButton == BTN_MORE || nButton == BTN_LESS )) continue; - OUString aFull(maExportPath); - aFull += GetButtonName(nButton); + OUString aFull = maExportPath + GetButtonName(nButton); mpButtonSet->exportButton( mnButtonThema, aFull, GetButtonName(nButton) ); } } diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index a2c111662c72..89af5b41019c 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -662,8 +662,8 @@ bool ImplSdPPTImport::Import() for ( nLevel = 0; nLevel < 9; nLevel++ ) { - OUString aName( pPage->GetLayoutName() ); - aName += " " + OUString::number( nLevel + 1 ); + OUString aName = pPage->GetLayoutName() + + " " + OUString::number( nLevel + 1 ); SfxStyleSheet* pOutlineSheet = static_cast<SfxStyleSheet*>( mpDoc->GetStyleSheetPool()->Find( aName, SfxStyleFamily::Page ) ); DBG_ASSERT( pOutlineSheet, "Template for outline object not found" ); if ( pOutlineSheet ) @@ -2229,8 +2229,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj { for ( sal_uInt16 nLevel = 9; nLevel; nLevel-- ) { - OUString aName( pPage->GetLayoutName() ); - aName += " " + OUString::number( nLevel ); + OUString aName = pPage->GetLayoutName() + " " + OUString::number( nLevel ); pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find( aName, SfxStyleFamily::Page )); if ( pSheet ) pText->StartListening( *pSheet ); diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index e14f266d6c72..717232b014e2 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -914,8 +914,8 @@ void CustomAnimationList::update() { SvTreeListEntry* pLBoxEntry = new CustomAnimationListEntry; pLBoxEntry->AddItem(std::make_unique<SvLBoxContextBmp>(Image(), Image(), false)); - OUString aDescription = SdResId(STR_CUSTOMANIMATION_TRIGGER) + ": "; - aDescription += getShapeDescription( xShape, false ); + OUString aDescription = SdResId(STR_CUSTOMANIMATION_TRIGGER) + ": " + + getShapeDescription( xShape, false ); pLBoxEntry->AddItem(std::make_unique<CustomAnimationTriggerEntryItem>(aDescription)); Insert( pLBoxEntry ); SvViewDataEntry* pViewData = GetViewData( pLBoxEntry ); diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 512415465307..b3b81b8c37ae 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -550,9 +550,8 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest const & rReq ) if( sAuthor.isEmpty() ) sAuthor = SdResId( STR_ANNOTATION_NOAUTHOR ); - aStr = aStr.replaceFirst("%1", sAuthor); - - aStr += " (" + getAnnotationDateTimeString( xAnnotation ) + "): \""; + aStr = aStr.replaceFirst("%1", sAuthor) + + " (" + getAnnotationDateTimeString( xAnnotation ) + "): \""; OUString sQuote( pTextApi->GetText() ); diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index ea9d0f139b46..d0461367ca56 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -65,8 +65,8 @@ void FuCopy::DoExecute( SfxRequest& rReq ) return; // Undo - OUString aString( mpView->GetDescriptionOfMarkedObjects() ); - aString += " " + SdResId( STR_UNDO_COPYOBJECTS ); + OUString aString = mpView->GetDescriptionOfMarkedObjects() + + " " + SdResId( STR_UNDO_COPYOBJECTS ); mpView->BegUndo( aString ); const SfxItemSet* pArgs = rReq.GetArgs(); diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index b06f63fc7765..c8bfd0d26cb0 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -743,11 +743,11 @@ bool FuDraw::SetHelpText(const SdrObject* pObj, const Point& rPosPixel, const Sd INetURLObject::DecodeMechanism::WithCharset); else if (pIMapObj) { - aURL = pIMapObj->GetAltText(); - aURL += " (" - + INetURLObject::decode(pIMapObj->GetURL(), - INetURLObject::DecodeMechanism::WithCharset) - + ")"; + aURL = pIMapObj->GetAltText() + + " (" + + INetURLObject::decode(pIMapObj->GetURL(), + INetURLObject::DecodeMechanism::WithCharset) + + ")"; } else return false; diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 8f3f652a1bcd..932a942986e3 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -632,8 +632,8 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) { rDocliner.Insert( pOutliner->GetText(pSourcePara), nTargetPos, nDepth ); OUString aStyleSheetName( pStyleSheet->GetName() ); - aStyleSheetName = aStyleSheetName.copy( 0, aStyleSheetName.getLength()-1 ); - aStyleSheetName += OUString::number( nDepth <= 0 ? 1 : nDepth+1 ); + aStyleSheetName = aStyleSheetName.copy( 0, aStyleSheetName.getLength()-1 ) + + OUString::number( nDepth <= 0 ? 1 : nDepth+1 ); SfxStyleSheetBasePool* pStylePool = mpDoc->GetStyleSheetPool(); SfxStyleSheet* pOutlStyle = static_cast<SfxStyleSheet*>( pStylePool->Find( aStyleSheetName, pStyleSheet->GetFamily() ) ); rDocliner.SetStyleSheet( nTargetPos, pOutlStyle ); diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 72223999498a..de8dd06787f2 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -163,8 +163,8 @@ void FuMorph::DoExecute( SfxRequest& ) ImpMorphPolygons(aPolyPoly1, aPolyPoly2, pDlg->GetFadeSteps(), aPolyPolyList); - OUString aString(mpView->GetDescriptionOfMarkedObjects()); - aString += " " + SdResId(STR_UNDO_MORPHING); + OUString aString = mpView->GetDescriptionOfMarkedObjects() + + " " + SdResId(STR_UNDO_MORPHING); mpView->BegUndo(aString); ImpInsertPolygons(aPolyPolyList, pDlg->IsAttributeFade(), pObj1, pObj2); diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx index 161fe7237266..96a805040cb9 100644 --- a/sd/source/ui/func/futransf.cxx +++ b/sd/source/ui/func/futransf.cxx @@ -51,8 +51,8 @@ namespace { void setUndo(::sd::View* pView, const SfxItemSet* pArgs) { // Undo - OUString aString(pView->GetDescriptionOfMarkedObjects()); - aString += " " + SdResId(STR_TRANSFORM); + OUString aString = pView->GetDescriptionOfMarkedObjects() + + " " + SdResId(STR_TRANSFORM); pView->BegUndo(aString); pView->SetGeoAttrToMarked(*pArgs); diff --git a/sd/source/ui/func/fuvect.cxx b/sd/source/ui/func/fuvect.cxx index 000fee7014f7..64840810ca21 100644 --- a/sd/source/ui/func/fuvect.cxx +++ b/sd/source/ui/func/fuvect.cxx @@ -73,8 +73,8 @@ void FuVectorize::DoExecute( SfxRequest& ) if( pPageView && rMtf.GetActionSize() ) { SdrGrafObj* pVectObj = static_cast<SdrGrafObj*>( pObj->CloneSdrObject(pObj->getSdrModelFromSdrObject()) ); - OUString aStr( mpView->GetDescriptionOfMarkedObjects() ); - aStr += " " + SdResId( STR_UNDO_VECTORIZE ); + OUString aStr = mpView->GetDescriptionOfMarkedObjects() + + " " + SdResId( STR_UNDO_VECTORIZE ); mpView->BegUndo( aStr ); pVectObj->SetGraphic( rMtf ); mpView->ReplaceObjectAtView( pObj, *pPageView, pVectObj ); diff --git a/sd/source/ui/slidesorter/view/SlsToolTip.cxx b/sd/source/ui/slidesorter/view/SlsToolTip.cxx index 98636860d1ab..3e75638bd920 100644 --- a/sd/source/ui/slidesorter/view/SlsToolTip.cxx +++ b/sd/source/ui/slidesorter/view/SlsToolTip.cxx @@ -78,8 +78,8 @@ void ToolTip::SetPage (const model::SharedPageDescriptor& rpDescriptor) } if (sHelpText.isEmpty()) { - sHelpText = SdResId(STR_PAGE); - sHelpText += OUString::number(mpDescriptor->GetPageIndex()+1); + sHelpText = SdResId(STR_PAGE) + + OUString::number(mpDescriptor->GetPageIndex()+1); } msCurrentHelpText = sHelpText; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index c7f8113a0513..6f7510488a30 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1562,9 +1562,7 @@ static void ImplPDFExportComments( const uno::Reference< drawing::XDrawPage >& x *(SD_MOD()->GetNumberFormatter()), eLanguage ); vcl::PDFNote aNote; - OUString sTitle( xAnnotation->getAuthor() ); - sTitle += ", " + aStr; - aNote.Title = sTitle; + aNote.Title = xAnnotation->getAuthor() + ", " + aStr; aNote.Contents = xText->getString(); rPDFExtOutDevData.CreateNote( ::tools::Rectangle( Point( static_cast< long >( aRealPoint2D.X * 100 ), static_cast< long >( aRealPoint2D.Y * 100 ) ), Size( 1000, 1000 ) ), aNote ); diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index f0eb22d9bf2b..ed2fadd7be78 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2119,8 +2119,7 @@ OUString getPageApiNameFromUiName( const OUString& rUIName ) if( rUIName.startsWith( aDefPageName ) ) { - aApiName = sEmptyPageName; - aApiName += rUIName.copy( aDefPageName.getLength() ); + aApiName = sEmptyPageName + rUIName.copy( aDefPageName.getLength() ); } else { diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx index 452f2585a40d..e64eb67edd1b 100644 --- a/sd/source/ui/view/GraphicObjectBar.cxx +++ b/sd/source/ui/view/GraphicObjectBar.cxx @@ -119,8 +119,8 @@ void GraphicObjectBar::ExecuteFilter( SfxRequest const & rReq ) if( pPageView ) { SdrGrafObj* pFilteredObj = static_cast<SdrGrafObj*>( pObj->CloneSdrObject(pObj->getSdrModelFromSdrObject()) ); - OUString aStr = mpView->GetDescriptionOfMarkedObjects(); - aStr += " " + SdResId(STR_UNDO_GRAFFILTER); + OUString aStr = mpView->GetDescriptionOfMarkedObjects() + + " " + SdResId(STR_UNDO_GRAFFILTER); mpView->BegUndo( aStr ); pFilteredObj->SetGraphicObject( aFilterObj ); ::sd::View* const pView = mpView; diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index 28995b287b92..6d96270be42a 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -299,8 +299,8 @@ void DrawViewShell::ExecBmpMask( SfxRequest const & rReq ) xNewObj->SetEmptyPresObj(false); xNewObj->SetGraphic(pBmpMask->Mask(xNewObj->GetGraphic())); - OUString aStr( mpDrawView->GetDescriptionOfMarkedObjects() ); - aStr += " " + SdResId(STR_EYEDROPPER); + OUString aStr = mpDrawView->GetDescriptionOfMarkedObjects() + + " " + SdResId(STR_EYEDROPPER); mpDrawView->BegUndo( aStr ); mpDrawView->ReplaceObjectAtView(pObj, *pPV, xNewObj.release()); diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index bd30940d6d5d..9fc1ddfa47e0 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -153,8 +153,8 @@ void DrawViewShell::ExecGallery(SfxRequest const & rReq) pNewGrafObj->SetOutlinerParaObject(nullptr); pNewGrafObj->SetGraphic(aGraphic); - OUString aStr(mpDrawView->GetDescriptionOfMarkedObjects()); - aStr += " " + SdResId(STR_UNDO_REPLACE); + OUString aStr = mpDrawView->GetDescriptionOfMarkedObjects() + + " " + SdResId(STR_UNDO_REPLACE); mpDrawView->BegUndo(aStr); SdrPageView* pPV = mpDrawView->GetSdrPageView(); mpDrawView->ReplaceObjectAtView(pGrafObj, *pPV, pNewGrafObj); diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index cad902ed86db..7ebf88b446dd 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -111,8 +111,8 @@ void ViewShell::GetMenuState( SfxItemSet &rSet ) { // Set the necessary string like in // sfx2/source/view/viewfrm.cxx ver 1.23 ln 1072 ff. - OUString aTmp(SvtResId(STR_UNDO)); - aTmp += pUndoManager->GetUndoActionComment(); + OUString aTmp = SvtResId(STR_UNDO) + + pUndoManager->GetUndoActionComment(); rSet.Put(SfxStringItem(SID_UNDO, aTmp)); } } @@ -142,8 +142,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet ) { // Set the necessary string like in // sfx2/source/view/viewfrm.cxx ver 1.23 ln 1081 ff. - OUString aTmp(SvtResId(STR_REDO)); - aTmp += pUndoManager->GetRedoActionComment(); + OUString aTmp = SvtResId(STR_REDO) + pUndoManager->GetRedoActionComment(); rSet.Put(SfxStringItem(SID_REDO, aTmp)); } } |