summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-14 14:27:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-15 14:33:57 +0200
commitf13c6ad5f020a196a0e3aa6f28bda3dc185d465b (patch)
treef9aaab122974d36c134fb1723ec3c1c8df51eeef /oox
parent9270f74466d0eb841babaa24997f608631c70341 (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 'oox')
-rw-r--r--oox/source/drawingml/chart/titlecontext.cxx4
-rw-r--r--oox/source/export/vmlexport.cxx28
2 files changed, 15 insertions, 17 deletions
diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx
index 0a9cc5ccbea6..042b12553483 100644
--- a/oox/source/drawingml/chart/titlecontext.cxx
+++ b/oox/source/drawingml/chart/titlecontext.cxx
@@ -72,9 +72,7 @@ void TextContext::onCharacters( const OUString& rChars )
if( isCurrentElement( C_TOKEN( v ) ) )
{
// Static text is stored as a single string formula token for Excel document.
- OUStringBuffer aBuf;
- aBuf.append('"').append(rChars).append('"');
- mrModel.mxDataSeq.create().maFormula = aBuf.makeStringAndClear();
+ mrModel.mxDataSeq.create().maFormula = "\"" + rChars + "\"";
// Also store it as a single element type for non-Excel document.
mrModel.mxDataSeq->maData[0] <<= rChars;
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 0bc408f3ef1c..c4b0fe42249e 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1181,15 +1181,15 @@ sal_Int32 VMLExport::StartShape()
nShapeElement = XML_shape;
if ( !m_aShapeTypeWritten[ m_nShapeType ] )
{
- OStringBuffer sShapeType;
- sShapeType.append("<v:shapetype id=\"shapetype_").append(OString::number(m_nShapeType)).
- append("\" coordsize=\"21600,21600\" o:spt=\"").append(OString::number(m_nShapeType)).
- append("\" path=\"m,l,21600l21600,21600l21600,xe\">\n").
- append("<v:stroke joinstyle=\"miter\"/>\n"
+ OString sShapeType =
+ "<v:shapetype id=\"shapetype_" + OString::number(m_nShapeType) +
+ "\" coordsize=\"21600,21600\" o:spt=\"" + OString::number(m_nShapeType) +
+ "\" path=\"m,l,21600l21600,21600l21600,xe\">\n"
+ "<v:stroke joinstyle=\"miter\"/>\n"
"<v:path shadowok=\"f\" o:extrusionok=\"f\" strokeok=\"f\" fillok=\"f\" o:connecttype=\"rect\"/>\n"
"<o:lock v:ext=\"edit\" shapetype=\"t\"/>\n"
- "</v:shapetype>");
- m_pSerializer->write(sShapeType.makeStringAndClear());
+ "</v:shapetype>";
+ m_pSerializer->write(sShapeType);
m_aShapeTypeWritten[ m_nShapeType ] = true;
}
break;
@@ -1202,11 +1202,11 @@ sal_Int32 VMLExport::StartShape()
nShapeElement = XML_shape;
if ( !m_aShapeTypeWritten[ m_nShapeType ] )
{
- OStringBuffer sShapeType;
- sShapeType.append("<v:shapetype id=\"shapetype_").append(OString::number(m_nShapeType)).
- append("\" coordsize=\"21600,21600\" o:spt=\"").append(OString::number(m_nShapeType)).
- append("\" o:preferrelative=\"t\" path=\"m@4@5l@4@11@9@11@9@5xe\" filled=\"f\" stroked=\"f\">\n").
- append("<v:stroke joinstyle=\"miter\"/>\n"
+ OString sShapeType =
+ "<v:shapetype id=\"shapetype_" + OString::number(m_nShapeType) +
+ "\" coordsize=\"21600,21600\" o:spt=\"" + OString::number(m_nShapeType) +
+ "\" o:preferrelative=\"t\" path=\"m@4@5l@4@11@9@11@9@5xe\" filled=\"f\" stroked=\"f\">\n"
+ "<v:stroke joinstyle=\"miter\"/>\n"
"<v:formulas>\n"
"<v:f eqn=\"if lineDrawn pixelLineWidth 0\"/>\n"
"<v:f eqn=\"sum @0 1 0\"/>\n"
@@ -1223,8 +1223,8 @@ sal_Int32 VMLExport::StartShape()
"</v:formulas>\n"
"<v:path o:extrusionok=\"f\" gradientshapeok=\"t\" o:connecttype=\"rect\"/>\n"
"<o:lock v:ext=\"edit\" aspectratio=\"t\"/>\n"
- "</v:shapetype>");
- m_pSerializer->write(sShapeType.makeStringAndClear());
+ "</v:shapetype>";
+ m_pSerializer->write(sShapeType);
m_aShapeTypeWritten[ m_nShapeType ] = true;
}
break;