diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-14 14:27:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-15 14:33:57 +0200 |
commit | f13c6ad5f020a196a0e3aa6f28bda3dc185d465b (patch) | |
tree | f9aaab122974d36c134fb1723ec3c1c8df51eeef /svx | |
parent | 9270f74466d0eb841babaa24997f608631c70341 (diff) |
new loplugin:bufferadd
look for OUStringBuffer append sequences that can be turned
into creating an OUString with + operations
Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6
Reviewed-on: https://gerrit.libreoffice.org/80809
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/lookupcolorname.cxx | 5 | ||||
-rw-r--r-- | svx/source/form/fmscriptingenv.cxx | 13 |
2 files changed, 6 insertions, 12 deletions
diff --git a/svx/source/accessibility/lookupcolorname.cxx b/svx/source/accessibility/lookupcolorname.cxx index feffea69fe18..29f517a5edf4 100644 --- a/svx/source/accessibility/lookupcolorname.cxx +++ b/svx/source/accessibility/lookupcolorname.cxx @@ -102,10 +102,7 @@ OUString ColorNameMap::lookUp(long color) const { return i->second; } // Did not find the given color; return its RGB tuple representation: - OUStringBuffer buf; - buf.append('#'); - buf.append(color, 16); - return buf.makeStringAndClear(); + return "#" + OUString::number(color, 16); } struct theColorNameMap: public rtl::Static< ColorNameMap, theColorNameMap > {}; diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx index bddfc8827b6f..5edf19daa490 100644 --- a/svx/source/form/fmscriptingenv.cxx +++ b/svx/source/form/fmscriptingenv.cxx @@ -1035,14 +1035,11 @@ namespace svxform sMacroLocation = "document"; } - OUStringBuffer aScriptURI; - aScriptURI.append( "vnd.sun.star.script:" ); - aScriptURI.append( sScriptCode ); - aScriptURI.append( "?language=Basic" ); - aScriptURI.append( "&location=" ); - aScriptURI.append( sMacroLocation ); - - const OUString sScriptURI( aScriptURI.makeStringAndClear() ); + OUString sScriptURI = "vnd.sun.star.script:" + + sScriptCode + + "?language=Basic&location=" + + sMacroLocation; + pScript.reset( new NewStyleUNOScript( *xObjectShell, sScriptURI ) ); } |