summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-11-02 18:59:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-11-03 17:11:14 +0100
commitab285c743afa1c8769581871d7b56374fd8c49f1 (patch)
treed5628df49fb4db29d474e5e7b7cef4072c33153a /sw
parentf4544f3903fed3a656e3cd57e1bd83582e024b96 (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 'sw')
-rw-r--r--sw/source/core/access/accdoc.cxx4
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx11
-rw-r--r--sw/source/core/undo/unovwr.cxx7
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx6
-rw-r--r--sw/source/filter/html/htmlplug.cxx6
-rw-r--r--sw/source/filter/writer/writer.cxx3
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx4
-rw-r--r--sw/source/ui/fldui/DropDownFieldDialog.cxx4
-rw-r--r--sw/source/ui/table/tautofmt.cxx4
-rw-r--r--sw/source/uibase/app/appenv.cxx3
-rw-r--r--sw/source/uibase/app/applab.cxx8
-rw-r--r--sw/source/uibase/app/docsh2.cxx3
-rw-r--r--sw/source/uibase/envelp/labelcfg.cxx4
-rw-r--r--sw/source/uibase/utlui/content.cxx10
-rw-r--r--sw/source/uibase/utlui/navipi.cxx4
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx12
17 files changed, 45 insertions, 52 deletions
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index f89541b1c09c..d62e1878582b 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -541,8 +541,8 @@ uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes()
sValue = "page-name:" + sDisplay +
";page-number:" +
OUString::number( nPage ) +
- ";total-pages:";
- sValue += OUString::number( pCursorShell->GetPageCnt() ) + ";";
+ ";total-pages:" +
+ OUString::number( pCursorShell->GetPageCnt() ) + ";";
SwContentFrame* pCurrFrame = pCursorShell->GetCurrFrame();
SwPageFrame* pCurrPage=static_cast<SwFrame*>(pCurrFrame)->FindPageFrame();
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index a4a6d8e25794..0b6f282caa89 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -395,8 +395,8 @@ static OUString lcl_dbg_out(const SwFrameFormat & rFrameFormat)
OUString aResult = "[ " +
OUString(sBuffer, strlen(sBuffer), RTL_TEXTENCODING_ASCII_US) +
- "(";
- aResult += rFrameFormat.GetName() + ")";
+ "(" +
+ rFrameFormat.GetName() + ")";
if (rFrameFormat.IsAuto())
aResult += "*";
@@ -710,11 +710,8 @@ const char * dbg_out(const SwNumRule & rRule)
static OUString lcl_dbg_out(const SwTextFormatColl & rFormat)
{
- OUString aResult(rFormat.GetName() + "(");
-
- aResult += OUString::number(rFormat.GetAttrOutlineLevel()) + ")";
-
- return aResult;
+ return rFormat.GetName() + "(" +
+ OUString::number(rFormat.GetAttrOutlineLevel()) + ")";
}
const char * dbg_out(const SwTextFormatColl & rFormat)
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index c5173a496454..0fc1ee2d3100 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -312,10 +312,9 @@ SwRewriter SwUndoOverwrite::GetRewriter() const
{
SwRewriter aResult;
- OUString aString = SwResId(STR_START_QUOTE);
- aString += ShortenString(aInsStr, nUndoStringLength,
- SwResId(STR_LDOTS));
- aString += SwResId(STR_END_QUOTE);
+ OUString aString = SwResId(STR_START_QUOTE) +
+ ShortenString(aInsStr, nUndoStringLength, SwResId(STR_LDOTS)) +
+ SwResId(STR_END_QUOTE);
aResult.AddRule(UndoArg1, aString);
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index 90ae515291c3..61a255d633a3 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1878,9 +1878,9 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF
if (rHTMLWrt.GetOrigFileName())
aFileName = *rHTMLWrt.GetOrigFileName();
INetURLObject aURL(aFileName);
- OUString aName(aURL.getBase() + "_");
- aName += aURL.getExtension() + "_";
- aName += OUString::number(aGraphic.GetChecksum(), 16);
+ OUString aName = aURL.getBase() + "_" +
+ aURL.getExtension() + "_" +
+ OUString::number(aGraphic.GetChecksum(), 16);
aURL.setBase(aName);
aURL.setExtension("ole");
aFileName = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE);
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 9e87beb61706..a0da671de733 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -150,9 +150,9 @@ OUString lcl_CalculateFileName(const OUString* pOrigFileName, const Graphic& rGr
if (pOrigFileName)
aFileName = *pOrigFileName;
INetURLObject aURL(aFileName);
- OUString aName(aURL.getBase() + "_");
- aName += aURL.getExtension() + "_";
- aName += OUString::number(rGraphic.GetChecksum(), 16);
+ OUString aName = aURL.getBase() + "_" +
+ aURL.getExtension() + "_" +
+ OUString::number(rGraphic.GetChecksum(), 16);
aURL.setBase(aName);
aURL.setExtension(rExtension);
aFileName = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE);
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index 49095288a18a..fa56eb08f519 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -331,8 +331,7 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm )
}
OUString aSrc = rFileNm;
- OUString aDest = aTargetUrl.GetPartBeforeLastName();
- aDest += aFileUrl.GetLastName();
+ OUString aDest = aTargetUrl.GetPartBeforeLastName() + aFileUrl.GetLastName();
SfxMedium aSrcFile( aSrc, StreamMode::READ );
SfxMedium aDstFile( aDest, StreamMode::WRITE | StreamMode::SHARE_DENYNONE );
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 872b693a1431..60b5c7cc6f24 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7236,8 +7236,8 @@ void DocxAttributeOutput::RefField( const SwField& rField, const OUString& rRef
SwFieldIds nType = rField.GetTyp( )->Which( );
if ( nType == SwFieldIds::GetExp )
{
- OUString sCmd = FieldString( ww::eREF );
- sCmd += "\"" + rRef + "\" ";
+ OUString sCmd = FieldString( ww::eREF ) +
+ "\"" + rRef + "\" ";
m_rExport.OutputField( &rField, ww::eREF, sCmd );
}
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index b1689bacde4f..dbfa676e93f1 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -664,8 +664,8 @@ sal_uInt16 SwWW8ImplReader::End_Field()
if ( m_aFieldStack.back().mnObjLocFc > 0 )
{
// Store the OLE object as an internal link
- OUString sOleId('_');
- sOleId += OUString::number( m_aFieldStack.back().mnObjLocFc );
+ OUString sOleId = "_" +
+ OUString::number( m_aFieldStack.back().mnObjLocFc );
tools::SvRef<SotStorage> xSrc0 = m_pStg->OpenSotStorage(SL::aObjectPool);
tools::SvRef<SotStorage> xSrc1 = xSrc0->OpenSotStorage( sOleId, StreamMode::READ );
diff --git a/sw/source/ui/fldui/DropDownFieldDialog.cxx b/sw/source/ui/fldui/DropDownFieldDialog.cxx
index b9cb3b89f82a..64d93fb6112e 100644
--- a/sw/source/ui/fldui/DropDownFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFieldDialog.cxx
@@ -63,8 +63,8 @@ sw::DropDownFieldDialog::DropDownFieldDialog(weld::Widget *pParent, SwWrtShell &
{
m_pDropField = static_cast<SwDropDownField*>(pField);
- OUString sTitle = m_xDialog->get_title();
- sTitle += m_pDropField->GetPar2();
+ OUString sTitle = m_xDialog->get_title() +
+ m_pDropField->GetPar2();
m_xDialog->set_title(sTitle);
const uno::Sequence< OUString > aItems = m_pDropField->GetItemSequence();
for (const OUString& rItem : aItems)
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index aedbb4bccf51..9f8d1e64898b 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -265,8 +265,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl, weld::Button&, void)
IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl, weld::Button&, void)
{
- OUString aMessage = m_aStrDelMsg + "\n\n";
- aMessage += m_xLbFormat->get_selected_text() + "\n";
+ OUString aMessage = m_aStrDelMsg + "\n\n" +
+ m_xLbFormat->get_selected_text() + "\n";
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Question,
VclButtonsType::OkCancel, m_aStrDelTitle));
diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx
index 5de37c41b4a0..1bcd43c41520 100644
--- a/sw/source/uibase/app/appenv.cxx
+++ b/sw/source/uibase/app/appenv.cxx
@@ -162,8 +162,7 @@ void SwModule::InsertEnv( SfxRequest& rReq )
pNewView->AttrChangedNotify(nullptr); // so that SelectShell is being called
pSh = pNewView->GetWrtShellPtr();
- OUString aTmp( SwResId(STR_ENV_TITLE) );
- aTmp += OUString::number( ++nTitleNo );
+ OUString aTmp = SwResId(STR_ENV_TITLE) + OUString::number( ++nTitleNo );
xDocSh->SetTitle( aTmp );
// if applicable, copy the old Collections "Sender" and "Receiver" to
diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx
index 8d6c5f230a17..cf07dc9728c3 100644
--- a/sw/source/uibase/app/applab.cxx
+++ b/sw/source/uibase/app/applab.cxx
@@ -205,13 +205,13 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
OUString aTmp;
if(bLabel)
{
- aTmp = SwResId( STR_LAB_TITLE);
- aTmp += OUString::number(++nLabelTitleNo );
+ aTmp = SwResId( STR_LAB_TITLE) +
+ OUString::number(++nLabelTitleNo );
}
else
{
- aTmp = pDlg->GetBusinessCardStr();
- aTmp += OUString::number( ++nBCTitleNo );
+ aTmp = pDlg->GetBusinessCardStr() +
+ OUString::number( ++nBCTitleNo );
}
xDocSh->SetTitle( aTmp );
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 1b1c83f366f9..c69b3e2d889f 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -822,8 +822,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
SwView *pCurrView = static_cast<SwView*>( pFrame->GetViewShell());
// Set document's title
- OUString aTmp( SwResId(STR_ABSTRACT_TITLE) );
- aTmp += GetTitle();
+ OUString aTmp = SwResId(STR_ABSTRACT_TITLE) + GetTitle();
xDocSh->SetTitle( aTmp );
pCurrView->GetWrtShell().SetNewDoc();
pFrame->Show();
diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx
index b2b7d743a7da..dcf07ab3efa5 100644
--- a/sw/source/uibase/envelp/labelcfg.cxx
+++ b/sw/source/uibase/envelp/labelcfg.cxx
@@ -321,8 +321,8 @@ void SwLabelConfig::SaveLabel( const OUString& rManufacturer,
}
}
- OUString sPrefix( wrapConfigurationElementName( rManufacturer ) );
- sPrefix += "/" + sFoundNode + "/";
+ OUString sPrefix = wrapConfigurationElementName( rManufacturer ) +
+ "/" + sFoundNode + "/";
Sequence<OUString> aPropNames = lcl_CreatePropertyNames( sPrefix );
OUString sMeasure;
Sequence<PropertyValue> aPropValues = lcl_CreateProperties( aPropNames, sMeasure, rRec );
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 47a6852df369..21b72b3a9bcd 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1263,8 +1263,8 @@ VclPtr<PopupMenu> SwContentTree::CreateContextMenu()
pSubPop3->InsertItem(nId++, m_aContextStrings[IDX_STR_ACTIVE_VIEW], MenuItemBits::AUTOCHECK | MenuItemBits::RADIOCHECK);
if(m_pHiddenShell)
{
- OUString sHiddenEntry = m_pHiddenShell->GetView().GetDocShell()->GetTitle();
- sHiddenEntry += " ( " +
+ OUString sHiddenEntry = m_pHiddenShell->GetView().GetDocShell()->GetTitle() +
+ " ( " +
m_aContextStrings[IDX_STR_HIDDEN] +
" )";
pSubPop3->InsertItem(nId, sHiddenEntry, MenuItemBits::AUTOCHECK | MenuItemBits::RADIOCHECK);
@@ -3202,10 +3202,10 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt )
else
{
const size_t nMemberCount = static_cast<SwContentType*>(pUserData)->GetMemberCount();
- sEntry = OUString::number(nMemberCount) + " ";
- sEntry += nMemberCount == 1
+ sEntry = OUString::number(nMemberCount) + " " +
+ (nMemberCount == 1
? static_cast<SwContentType*>(pUserData)->GetSingleName()
- : static_cast<SwContentType*>(pUserData)->GetName();
+ : static_cast<SwContentType*>(pUserData)->GetName());
bRet = true;
}
if(bRet)
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index f6155e16d80f..e016ab69910f 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -989,8 +989,8 @@ void SwNavigationPI::UpdateListBox()
if(m_aContentTree->GetHiddenWrtShell())
{
OUString sEntry = m_aContentTree->GetHiddenWrtShell()->GetView().
- GetDocShell()->GetTitle();
- sEntry += " (" +
+ GetDocShell()->GetTitle() +
+ " (" +
m_aStatusArr[IDX_STR_HIDDEN] +
")";
m_aDocListBox->InsertEntry(sEntry);
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 8dbde3081590..1f06646b94a6 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1644,12 +1644,12 @@ void SwWrtShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar )
// is already clipped to the editshell
StartAllAction();
- OUString aTmpStr1 = SwResId(STR_START_QUOTE);
- aTmpStr1 += GetSelText();
- aTmpStr1 += SwResId(STR_END_QUOTE);
- OUString aTmpStr3 = SwResId(STR_START_QUOTE);
- aTmpStr3 += OUStringChar(cChar);
- aTmpStr3 += SwResId(STR_END_QUOTE);
+ OUString aTmpStr1 = SwResId(STR_START_QUOTE) +
+ GetSelText() +
+ SwResId(STR_END_QUOTE);
+ OUString aTmpStr3 = SwResId(STR_START_QUOTE) +
+ OUStringChar(cChar) +
+ SwResId(STR_END_QUOTE);
aRewriter.AddRule( UndoArg1, aTmpStr1 );
aRewriter.AddRule( UndoArg2, SwResId(STR_YIELDS) );
aRewriter.AddRule( UndoArg3, aTmpStr3 );