diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-13 08:47:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-14 08:26:14 +0200 |
commit | 9b5dad13b56bdde7c40970351af3da3a2c3c9350 (patch) | |
tree | abfd4b02743a0e6a93c51c026f4c53f0e21100bc /xmloff | |
parent | fa71320329999c968feb16ff65be328b5b8ff5e4 (diff) |
loplugin:stringadd look for unnecessary temporaries
which defeat the *StringConcat optimisation.
Also make StringConcat conversions treat a nullptr as an empty string,
to match the O*String(char*) constructors.
Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b
Reviewed-on: https://gerrit.libreoffice.org/80724
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/style/prstylecond.cxx | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 5d7d1910d98a..8821edab6381 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1364,8 +1364,7 @@ ErrCode SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) // office:mimetype = ... (only for stream containing the content) if( eClass != XML_TOKEN_INVALID ) { - OUString aTmp( "application/vnd.oasis.opendocument." ); - aTmp += GetXMLToken( eClass ); + OUString aTmp = "application/vnd.oasis.opendocument." + GetXMLToken( eClass ); AddAttribute( XML_NAMESPACE_OFFICE, XML_MIMETYPE, aTmp ); } } diff --git a/xmloff/source/style/prstylecond.cxx b/xmloff/source/style/prstylecond.cxx index f0dafdf1c36d..ad16ee813cb8 100644 --- a/xmloff/source/style/prstylecond.cxx +++ b/xmloff/source/style/prstylecond.cxx @@ -68,9 +68,8 @@ OUString GetParaStyleCondExternal( OUString const &internal) { if (internal.compareToAscii( g_ConditionMap[i].aInternal ) == 0) { - OUString aResult( GetXMLToken( g_ConditionMap[i].nExternal ) ); - - aResult += "()"; + OUString aResult = GetXMLToken( g_ConditionMap[i].nExternal ) + + "()"; if (g_ConditionMap[i].aValue != -1) { aResult += "=" + |