summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-28 10:35:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-28 12:07:54 +0100
commitbc539bd3c04964471af6b5ca54264215c8995696 (patch)
treec37af5b9fb3dc0b8677fc8dd535fb8e93ad6039d /svx
parent9f78a4174e5099ad3af65a23e158a51c1afca54d (diff)
loplugin:stringadd improve detection
if one side of the expression is a compile-time-constant, we don't need to worry about side-effects on the other side Change-Id: Iee71ea51b327ef244bf39f128f921ac325d74e2b Reviewed-on: https://gerrit.libreoffice.org/81589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/hexcolorcontrol.cxx3
-rw-r--r--svx/source/form/fmcontrollayout.cxx4
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx6
-rw-r--r--svx/source/gallery2/galtheme.cxx4
-rw-r--r--svx/source/svdraw/svdmrkv.cxx17
5 files changed, 15 insertions, 19 deletions
diff --git a/svx/source/dialog/hexcolorcontrol.cxx b/svx/source/dialog/hexcolorcontrol.cxx
index a387a427687d..8cd9089c7051 100644
--- a/svx/source/dialog/hexcolorcontrol.cxx
+++ b/svx/source/dialog/hexcolorcontrol.cxx
@@ -70,8 +70,7 @@ Color HexColorControl::GetColor() const
{
sal_Int32 nColor = -1;
- OUString aStr("#");
- aStr += m_xEntry->get_text();
+ OUString aStr = "#" + m_xEntry->get_text();
sal_Int32 nLen = aStr.getLength();
if (nLen < 7)
diff --git a/svx/source/form/fmcontrollayout.cxx b/svx/source/form/fmcontrollayout.cxx
index 7d503519650f..5fcea4b7d6bc 100644
--- a/svx/source/form/fmcontrollayout.cxx
+++ b/svx/source/form/fmcontrollayout.cxx
@@ -74,8 +74,8 @@ namespace svxform
{
::utl::OConfigurationNode getLayoutSettings( DocumentType _eDocType )
{
- OUString sConfigName = "/org.openoffice.Office.Common/Forms/ControlLayout/";
- sConfigName += DocumentClassification::getModuleIdentifierForDocumentType( _eDocType );
+ OUString sConfigName = "/org.openoffice.Office.Common/Forms/ControlLayout/" +
+ DocumentClassification::getModuleIdentifierForDocumentType( _eDocType );
return OConfigurationTreeRoot::createWithComponentContext(
::comphelper::getProcessComponentContext(), // TODO
sConfigName );
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index 6b8e42bfe340..e709b9c7fa86 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -566,9 +566,9 @@ namespace svx
sUnoSlotName = lcl_getUnoSlotName( nSlotId );
else
sUnoSlotName = "<unknown>";
- OString sUnoSlotNameAscii( "\"" );
- sUnoSlotNameAscii += OString( sUnoSlotName.getStr(), sUnoSlotName.getLength(), RTL_TEXTENCODING_ASCII_US );
- sUnoSlotNameAscii += "\"";
+ OString sUnoSlotNameAscii = "\"" +
+ OString( sUnoSlotName.getStr(), sUnoSlotName.getLength(), RTL_TEXTENCODING_ASCII_US ) +
+ "\"";
#endif
if ( _bTranslateLatin )
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index e02802525313..fa3ab3ea9167 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -303,9 +303,7 @@ INetURLObject GalleryTheme::ImplCreateUniqueURL( SgaObjKind eObjKind, ConvertDat
}
else
{
- OUString aFileName( "dd" );
-
- aFileName += OUString::number( ++nNextNumber % 999999 );
+ OUString aFileName = "dd" + OUString::number( ++nNextNumber % 999999 );
if (pExt)
aFileName += OUString( pExt, strlen(pExt), RTL_TEXTENCODING_ASCII_US );
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index c012cc0fb10e..56a1ef2b91a6 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -953,13 +953,13 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM));
- OString sSVGElem(R"elem(<svg version=\"1.2\" width=\")elem");
- sSVGElem += OString::number(aSelection.GetWidth() / 100.0);
- sSVGElem += R"elem(mm\" height=\")elem";
- sSVGElem += OString::number(aSelection.GetHeight() / 100.0);
- sSVGElem += R"elem(mm\" viewBox=\")elem";
- sSVGElem += aSelection.toString();
- sSVGElem += R"elem(\" preserveAspectRatio=\"xMidYMid\" xmlns=\"http://www.w3.org/2000/svg\">)elem";
+ OString sSVGElem = R"elem(<svg version=\"1.2\" width=\")elem" +
+ OString::number(aSelection.GetWidth() / 100.0) +
+ R"elem(mm\" height=\")elem" +
+ OString::number(aSelection.GetHeight() / 100.0) +
+ R"elem(mm\" viewBox=\")elem" +
+ aSelection.toString() +
+ R"elem(\" preserveAspectRatio=\"xMidYMid\" xmlns=\"http://www.w3.org/2000/svg\">)elem";
aExtraInfo.append(", \"svg\": \"");
aExtraInfo.append(sSVGElem);
@@ -982,8 +982,7 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
sSelectionText += OStringLiteral(", ") + OString::number(nRotAngle);
if (!aExtraInfo.isEmpty())
{
- sSelectionText += ", ";
- sSelectionText += aExtraInfo.makeStringAndClear();
+ sSelectionText += ", " + aExtraInfo.makeStringAndClear();
}
}