diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-11-10 14:41:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-11 06:33:40 +0100 |
commit | cc1e6ee2dd4609c27cb7a09aa47a779592a3e22c (patch) | |
tree | e0155415dcdbb86078d47100d088689542b98a66 /drawinglayer/source | |
parent | dfb2e07e32694c220e791574b7a6c05f5648c0c2 (diff) |
disable O(U)String::concat for internal code
in favour of the more widely used, and better optimised, operator+
Change-Id: I6a1b37e0f3d253af1f7a0892443f59b620efea63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105523
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source')
-rw-r--r-- | drawinglayer/source/tools/emfpfont.cxx | 11 | ||||
-rw-r--r-- | drawinglayer/source/tools/emfphelperdata.cxx | 8 | ||||
-rw-r--r-- | drawinglayer/source/tools/emfppen.cxx | 31 | ||||
-rw-r--r-- | drawinglayer/source/tools/emfpstringformat.cxx | 43 |
4 files changed, 46 insertions, 47 deletions
diff --git a/drawinglayer/source/tools/emfpfont.cxx b/drawinglayer/source/tools/emfpfont.cxx index f641fdd4d21b..609135460992 100644 --- a/drawinglayer/source/tools/emfpfont.cxx +++ b/drawinglayer/source/tools/emfpfont.cxx @@ -18,27 +18,28 @@ */ #include <sal/log.hxx> +#include <rtl/ustrbuf.hxx> #include "emfpfont.hxx" namespace emfplushelper { static OUString FontStyleToString(sal_uInt32 style) { - OUString sStyle; + OUStringBuffer sStyle; if (style & FontStyleBold) sStyle = "\n\t\t\tFontStyleBold"; if (style & FontStyleItalic) - sStyle = sStyle.concat("\n\t\t\tFontStyleItalic"); + sStyle.append("\n\t\t\tFontStyleItalic"); if (style & FontStyleUnderline) - sStyle = sStyle.concat("\n\t\t\tFontStyleUnderline"); + sStyle.append("\n\t\t\tFontStyleUnderline"); if (style & FontStyleStrikeout) - sStyle = sStyle.concat("\n\t\t\tFontStyleStrikeout"); + sStyle.append("\n\t\t\tFontStyleStrikeout"); - return sStyle; + return sStyle.makeStringAndClear(); } void EMFPFont::Read(SvMemoryStream &s) diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx index d9aed087885f..f486d59375fd 100644 --- a/drawinglayer/source/tools/emfphelperdata.cxx +++ b/drawinglayer/source/tools/emfphelperdata.cxx @@ -214,14 +214,10 @@ namespace emfplushelper static OUString BrushIDToString(sal_uInt16 flags, sal_uInt32 brushid) { - OUString sBrushId; - if (IsBrush(flags)) - sBrushId = sBrushId.concat("EmfPlusBrush ID: ").concat(OUString::number(brushid)); + return "EmfPlusBrush ID: " + OUString::number(brushid); else - sBrushId = sBrushId.concat("ARGB: 0x").concat(OUString::number(brushid, 16)); - - return sBrushId; + return "ARGB: 0x" + OUString::number(brushid, 16); } EMFPObject::~EMFPObject() diff --git a/drawinglayer/source/tools/emfppen.cxx b/drawinglayer/source/tools/emfppen.cxx index c5e7d457be61..60500b6bf7ec 100644 --- a/drawinglayer/source/tools/emfppen.cxx +++ b/drawinglayer/source/tools/emfppen.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/rendering/PathJoinType.hpp> #include <o3tl/safeint.hxx> #include <sal/log.hxx> +#include <rtl/ustrbuf.hxx> #include "emfppen.hxx" #include "emfpcustomlinecap.hxx" @@ -75,48 +76,48 @@ namespace emfplushelper static OUString PenDataFlagsToString(sal_uInt32 flags) { - OUString sFlags; + rtl::OUStringBuffer sFlags; if (flags & EmfPlusPenDataTransform) - sFlags = "\nEMF+\t\t\tEmfPlusPenDataTransform"; + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataTransform"); if (flags & EmfPlusPenDataStartCap) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataStartCap"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataStartCap"); if (flags & EmfPlusPenDataEndCap) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataEndCap"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataEndCap"); if (flags & EmfPlusPenDataJoin) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataJoin"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataJoin"); if (flags & EmfPlusPenDataMiterLimit) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataMiterLimit"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataMiterLimit"); if (flags & EmfPlusPenDataLineStyle) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataLineStyle"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataLineStyle"); if (flags & EmfPlusPenDataDashedLineCap) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataDashedLineCap"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataDashedLineCap"); if (flags & EmfPlusPenDataDashedLineOffset) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataDashedLineOffset"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataDashedLineOffset"); if (flags & EmfPlusPenDataDashedLine) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataDashedLine"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataDashedLine"); if (flags & EmfPlusPenDataAlignment) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataAlignment"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataAlignment"); if (flags & EmfPlusPenDataCompoundLine) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataCompoundLine"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataCompoundLine"); if (flags & EmfPlusPenDataCustomStartCap) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataCustomStartCap"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataCustomStartCap"); if (flags & EmfPlusPenDataCustomEndCap) - sFlags = sFlags.concat("\nEMF+\t\t\tEmfPlusPenDataCustomEndCap"); + sFlags.append("\nEMF+\t\t\tEmfPlusPenDataCustomEndCap"); - return sFlags; + return sFlags.makeStringAndClear(); } static OUString LineCapTypeToString(sal_uInt32 linecap) diff --git a/drawinglayer/source/tools/emfpstringformat.cxx b/drawinglayer/source/tools/emfpstringformat.cxx index ad08f14a21be..a523ab80e531 100644 --- a/drawinglayer/source/tools/emfpstringformat.cxx +++ b/drawinglayer/source/tools/emfpstringformat.cxx @@ -18,6 +18,7 @@ */ #include <sal/log.hxx> +#include <rtl/ustrbuf.hxx> #include "emfpstringformat.hxx" namespace emfplushelper @@ -43,78 +44,78 @@ namespace emfplushelper static OUString StringFormatFlags(sal_uInt32 flag) { - OUString sFlags; + OUStringBuffer sFlags; if (flag & StringFormatDirectionRightToLeft) - sFlags = sFlags.concat("StringFormatDirectionRightToLeft"); + sFlags.append("StringFormatDirectionRightToLeft"); if (flag & StringFormatDirectionRightToLeft) { if (!sFlags.isEmpty()) - sFlags = sFlags.concat(", "); + sFlags.append(", "); - sFlags = sFlags.concat("StringFormatDirectionRightToLeft"); + sFlags.append("StringFormatDirectionRightToLeft"); } if (flag & StringFormatNoFitBlackBox) { if (!sFlags.isEmpty()) - sFlags = sFlags.concat(", "); + sFlags.append(", "); - sFlags = sFlags.concat("StringFormatNoFitBlackBox"); + sFlags.append("StringFormatNoFitBlackBox"); } if (flag & StringFormatDisplayFormatControl) { if (!sFlags.isEmpty()) - sFlags = sFlags.concat(", "); + sFlags.append(", "); - sFlags = sFlags.concat("StringFormatDisplayFormatControl"); + sFlags.append("StringFormatDisplayFormatControl"); } if (flag & StringFormatNoFontFallback) { if (!sFlags.isEmpty()) - sFlags = sFlags.concat(", "); + sFlags.append(", "); - sFlags = sFlags.concat("StringFormatNoFontFallback"); + sFlags.append("StringFormatNoFontFallback"); } if (flag & StringFormatMeasureTrailingSpaces) { if (!sFlags.isEmpty()) - sFlags = sFlags.concat(", "); + sFlags.append(", "); - sFlags = sFlags.concat("StringFormatMeasureTrailingSpaces"); + sFlags.append("StringFormatMeasureTrailingSpaces"); } if (flag & StringFormatNoWrap) { if (!sFlags.isEmpty()) - sFlags = sFlags.concat(", "); + sFlags.append(", "); - sFlags = sFlags.concat("StringFormatNoWrap"); + sFlags.append("StringFormatNoWrap"); } if (flag & StringFormatLineLimit) { if (!sFlags.isEmpty()) - sFlags = sFlags.concat(", "); + sFlags.append(", "); - sFlags = sFlags.concat("StringFormatLineLimit"); + sFlags.append("StringFormatLineLimit"); } if (flag & StringFormatNoClip) { if (!sFlags.isEmpty()) - sFlags = sFlags.concat(", "); + sFlags.append(", "); - sFlags = sFlags.concat("StringFormatNoClip"); + sFlags.append("StringFormatNoClip"); } if (flag & StringFormatBypassGDI) { if (!sFlags.isEmpty()) - sFlags = sFlags.concat(", "); + sFlags.append(", "); - sFlags = sFlags.concat("StringFormatBypassGDI"); + sFlags.append("StringFormatBypassGDI"); } - return sFlags; + return sFlags.makeStringAndClear(); } static OUString StringAlignmentString(sal_uInt32 nAlignment) |