From a5084d15e1b72e303e1628fbff84432036b014a9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 30 Mar 2023 10:42:07 +0200 Subject: loplugin:stringadd in vcl when applying my upcoming patch to also consider O[U]StringBuffer Change-Id: I44ce7183e4b292269fac1e3d2217286bf5abe823 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149752 Tested-by: Noel Grandin Reviewed-by: Noel Grandin --- vcl/source/treelist/headbar.cxx | 3 +-- vcl/source/treelist/imap2.cxx | 3 +-- vcl/source/treelist/transfer.cxx | 10 +++++----- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'vcl/source/treelist') diff --git a/vcl/source/treelist/headbar.cxx b/vcl/source/treelist/headbar.cxx index 3bd6bbaa3120..fa17e69ff25d 100644 --- a/vcl/source/treelist/headbar.cxx +++ b/vcl/source/treelist/headbar.cxx @@ -377,8 +377,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos if (nTxtWidth > nMaxTxtWidth) { bLeftText = true; - OUStringBuffer aBuf(pItem->maOutText); - aBuf.append("..."); + OUStringBuffer aBuf(pItem->maOutText + "..."); do { aBuf.remove(aBuf.getLength() - 3 - 1, 1); diff --git a/vcl/source/treelist/imap2.cxx b/vcl/source/treelist/imap2.cxx index f0e3c6913f47..0c3d4d8bf9e2 100644 --- a/vcl/source/treelist/imap2.cxx +++ b/vcl/source/treelist/imap2.cxx @@ -96,8 +96,7 @@ void IMapCircleObject::WriteCERN( SvStream& rOStm ) const OStringBuffer aStrBuf("circle "); AppendCERNCoords(aStrBuf, aCenter); - aStrBuf.append(nRadius); - aStrBuf.append(' '); + aStrBuf.append(OString::number(nRadius) + " "); AppendCERNURL(aStrBuf); rOStm.WriteLine(aStrBuf); diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index bef49272b7c1..1fd9df908854 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -749,11 +749,11 @@ bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk, { OString sURL(OUStringToOString(rBmk.GetURL(), eSysCSet)); OString sDesc(OUStringToOString(rBmk.GetDescription(), eSysCSet)); - OStringBuffer sOut; - sOut.append(sURL.getLength()); - sOut.append("@" + sURL); - sOut.append(sDesc.getLength()); - sOut.append("@" + sDesc); + OString sOut = + OString::number(sURL.getLength()) + + "@" + sURL + + OString::number(sDesc.getLength()) + + "@" + sDesc; Sequence< sal_Int8 > aSeq(sOut.getLength()); memcpy(aSeq.getArray(), sOut.getStr(), sOut.getLength()); -- cgit