summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-13 08:47:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-14 08:26:14 +0200
commit9b5dad13b56bdde7c40970351af3da3a2c3c9350 (patch)
treeabfd4b02743a0e6a93c51c026f4c53f0e21100bc /oox
parentfa71320329999c968feb16ff65be328b5b8ff5e4 (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 'oox')
-rw-r--r--oox/source/export/drawingml.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 83c709c4633e..168bb53e8217 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2754,7 +2754,7 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
mpFS->startElementNS(XML_a, XML_avLst);
for (sal_Int32 i = 0, nElems = aAdjustmentSeq.getLength(); i < nElems; ++i )
{
- OString sName = OString("adj") + (( nElems > 1 ) ? OString::number(i + 1) : OString());
+ OString sName = "adj" + (( nElems > 1 ) ? OString::number(i + 1) : OString());
double fValue(0.0);
if (aAdjustmentSeq[i].Value.getValueTypeClass() == TypeClass_DOUBLE)
aAdjustmentSeq[i].Value >>= fValue;
@@ -2788,7 +2788,7 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
{
fValue /= 0.216;
}
- OString sFmla = OString("val ") + OString::number(std::lround(fValue));
+ OString sFmla = "val " + OString::number(std::lround(fValue));
mpFS->singleElementNS(XML_a, XML_gd, XML_name, sName, XML_fmla, sFmla);
}
mpFS->endElementNS( XML_a, XML_avLst );
@@ -2904,8 +2904,8 @@ void DrawingML::WritePresetShape( const char* pShape , std::vector< std::pair<sa
mpFS->startElementNS(XML_a, XML_avLst);
for (auto const& elem : rAvList)
{
- OString sName = OString("adj") + ( ( elem.first > 0 ) ? OString::number(elem.first) : OString() );
- OString sFmla = OString("val ") + OString::number( elem.second );
+ OString sName = "adj" + ( ( elem.first > 0 ) ? OString::number(elem.first) : OString() );
+ OString sFmla = "val " + OString::number( elem.second );
mpFS->singleElementNS(XML_a, XML_gd, XML_name, sName, XML_fmla, sFmla);
}