summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-04-23 16:07:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-27 14:07:56 +0200
commitc7c6f0af6c836ebe0968967a1e7c8320b0ac17d6 (patch)
tree4bc5b2fa623b9765b88bbfe7de10a7590c87d5c8 /vcl
parent99482297c7dd497e41fad2e7193759043e305101 (diff)
loplugin:stringadd convert chained append to +
which can use the more efficient *StringConcat Also fix a crash in stringview plugin which started happening while I working on this. Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/skia/gdiimpl.cxx5
-rw-r--r--vcl/source/gdi/pdfobjectcopier.cxx2
-rw-r--r--vcl/source/treelist/transfer.cxx4
-rw-r--r--vcl/source/treelist/treelistbox.cxx2
-rw-r--r--vcl/source/uitest/logger.cxx12
-rw-r--r--vcl/source/uitest/uiobject.cxx4
6 files changed, 12 insertions, 17 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 145bbf19cc4c..f0b9fb2e0d5c 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1627,10 +1627,9 @@ sk_sp<SkImage> SkiaSalGraphicsImpl::mergeCacheBitmaps(const SkiaSalBitmap& bitma
keyBuf.append(targetSize.Width())
.append("x")
.append(targetSize.Height())
- .append("_")
- .append(bitmap.GetImageKey());
+ .append("_" + bitmap.GetImageKey());
if (alphaBitmap)
- keyBuf.append("_").append(alphaBitmap->GetAlphaImageKey());
+ keyBuf.append("_" + alphaBitmap->GetAlphaImageKey());
key = keyBuf.makeStringAndClear();
image = findCachedImage(key);
if (image)
diff --git a/vcl/source/gdi/pdfobjectcopier.cxx b/vcl/source/gdi/pdfobjectcopier.cxx
index 121eddb8b6de..c9e332aba28f 100644
--- a/vcl/source/gdi/pdfobjectcopier.cxx
+++ b/vcl/source/gdi/pdfobjectcopier.cxx
@@ -230,7 +230,7 @@ OString PDFObjectCopier::copyExternalResources(filter::PDFObjectElement& rPage,
OStringBuffer sRet("/" + rKind + "<<");
for (const auto& rPair : aRet)
{
- sRet.append("/").append(rPair.first).append(" ").append(rPair.second).append(" 0 R");
+ sRet.append("/" + rPair.first + " ").append(rPair.second).append(" 0 R");
}
sRet.append(">>");
diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx
index 932cdca68a18..5f57a7ff07b6 100644
--- a/vcl/source/treelist/transfer.cxx
+++ b/vcl/source/treelist/transfer.cxx
@@ -785,9 +785,9 @@ bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk,
OString sDesc(OUStringToOString(rBmk.GetDescription(), eSysCSet));
OStringBuffer sOut;
sOut.append(sURL.getLength());
- sOut.append('@').append(sURL);
+ sOut.append("@" + sURL);
sOut.append(sDesc.getLength());
- sOut.append('@').append(sDesc);
+ sOut.append("@" + sDesc);
Sequence< sal_Int8 > aSeq(sOut.getLength());
memcpy(aSeq.getArray(), sOut.getStr(), sOut.getLength());
diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index 9af367f2f460..8fa1ff9bbd0f 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -1296,7 +1296,7 @@ OUString SvTreeListBox::SearchEntryTextWithHeadTitle( SvTreeListEntry* pEntry )
if ( (rItem.GetType() == SvLBoxItemType::String) &&
!static_cast<SvLBoxString&>( rItem ).GetText().isEmpty() )
{
- sRet.append(static_cast<SvLBoxString&>( rItem ).GetText()).append(",");
+ sRet.append(static_cast<SvLBoxString&>( rItem ).GetText() + ",");
}
nCur++;
}
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index ffb6b1a8f6c8..8c23eb8b1cb2 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -99,21 +99,21 @@ void UITestLogger::logCommand(const OUString& rAction,
{
sal_Int32 nValue = 0;
rProp.Value >>= nValue;
- aBuffer.append("\"").append(rProp.Name).append("\": ");
+ aBuffer.append("\"" + rProp.Name + "\": ");
aBuffer.append(nValue).append(", ");
}
else if (aTypeName == "unsigned long")
{
sal_uInt32 nValue = 0;
rProp.Value >>= nValue;
- aBuffer.append("\"").append(rProp.Name).append("\": ");
+ aBuffer.append("\"" + rProp.Name + "\": ");
aBuffer.append(static_cast<sal_Int64>(nValue)).append(", ");
}
else if (aTypeName == "boolean")
{
bool bValue = false;
rProp.Value >>= bValue;
- aBuffer.append("\"").append(rProp.Name).append("\": ");
+ aBuffer.append("\"" + rProp.Name + "\": ");
if (bValue)
aBuffer.append("True, ");
else
@@ -333,11 +333,7 @@ OUString StringMapToOUString(const std::map<OUString, OUString>& rParameters)
{
if (itr != rParameters.begin())
aParameterString.append(", ");
- aParameterString.append("\"")
- .append(itr->first)
- .append("\": \"")
- .append(itr->second)
- .append("\"");
+ aParameterString.append("\"" + itr->first + "\": \"" + itr->second + "\"");
}
aParameterString.append("}");
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 11c6e7ec7d6e..6861cd1bdfc3 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -370,7 +370,7 @@ void WindowUIObject::execute(const OUString& rAction,
{
OStringBuffer buf;
for (auto const & rPair : rParameters)
- buf.append(",").append(rPair.first.toUtf8()).append("=").append(rPair.second.toUtf8());
+ buf.append("," + rPair.first.toUtf8() + "=" + rPair.second.toUtf8());
SAL_WARN("vcl.uitest", "missing parameter TEXT to action TYPE "
<< buf.makeStringAndClear());
throw std::logic_error("missing parameter TEXT to action TYPE");
@@ -384,7 +384,7 @@ void WindowUIObject::execute(const OUString& rAction,
{
OStringBuffer buf;
for (auto const & rPair : rParameters)
- buf.append(",").append(rPair.first.toUtf8()).append("=").append(rPair.second.toUtf8());
+ buf.append("," + rPair.first.toUtf8() + "=" + rPair.second.toUtf8());
SAL_WARN("vcl.uitest", "unknown action for " << get_name()
<< ". Action: " << rAction << buf.makeStringAndClear());
throw std::logic_error("unknown action");