summaryrefslogtreecommitdiff
path: root/sw/source/filter
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 /sw/source/filter
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 'sw/source/filter')
-rw-r--r--sw/source/filter/html/swhtml.cxx5
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx9
-rw-r--r--sw/source/filter/ww8/docxexport.cxx13
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx5
4 files changed, 14 insertions, 18 deletions
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index c2dbad75a1d9..d638abac1052 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2013,9 +2013,8 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken )
}
else
{
- OUStringBuffer aComment;
- aComment.append('<').append(aToken).append('>');
- InsertComment( aComment.makeStringAndClear() );
+ OUString aComment = "<" + aToken + ">";
+ InsertComment( aComment );
}
}
break;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 196970c2b4da..e7468c1c8d6d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5422,11 +5422,10 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
m_pSerializer->startElementNS(XML_w, XML_object);
}
- OStringBuffer sShapeStyle, sShapeId;
- sShapeStyle.append( "width:" ).append( double( rSize.Width() ) / 20 )
- .append( "pt;height:" ).append( double( rSize.Height() ) / 20 )
- .append( "pt" ); //from VMLExport::AddRectangleDimensions(), it does: value/20
- sShapeId.append( "ole_" ).append( sId );
+ OString sShapeStyle = "width:" + OString::number( double( rSize.Width() ) / 20 ) +
+ "pt;height:" + OString::number( double( rSize.Height() ) / 20 ) +
+ "pt"; //from VMLExport::AddRectangleDimensions(), it does: value/20
+ OString sShapeId = "ole_" + sId;
// shape definition
m_pSerializer->startElementNS( XML_v, XML_shape,
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 6651124711dc..1ff5f4bb25e6 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -992,13 +992,12 @@ void DocxExport::WriteSettings()
SwDBData aData = m_pDoc->GetDBData();
if ( !aData.sDataSource.isEmpty() && aData.nCommandType == css::sdb::CommandType::TABLE && !aData.sCommand.isEmpty() )
{
- OUStringBuffer aDataSource;
- aDataSource.append("SELECT * FROM ");
- aDataSource.append(aData.sDataSource); // current database
- aDataSource.append(".dbo."); // default database owner
- aDataSource.append(aData.sCommand); // sheet name
- aDataSource.append("$"); // sheet identifier
- const OUString sDataSource = aDataSource.makeStringAndClear();
+ OUString sDataSource =
+ "SELECT * FROM " +
+ aData.sDataSource + // current database
+ ".dbo." + // default database owner
+ aData.sCommand + // sheet name
+ "$"; // sheet identifier
pFS->startElementNS( XML_w, XML_mailMerge );
pFS->singleElementNS(XML_w, XML_mainDocumentType,
FSNS( XML_w, XML_val ), "formLetters" );
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 7932a848cc4a..f3d1fb00997e 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -3049,10 +3049,9 @@ void SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrUnoObj& rFo
tools::SvRef<SotStorage> xObjPool = rWW8Wrt.GetWriter().GetStorage().OpenSotStorage(SL::aObjectPool);
//Create a destination storage for the microsoft control
- OUStringBuffer sStorageName;
sal_uInt32 nObjId = ++mnObjectId;
- sStorageName.append('_').append( static_cast<sal_Int64>( nObjId ));
- tools::SvRef<SotStorage> xOleStg = xObjPool->OpenSotStorage(sStorageName.makeStringAndClear());
+ OUString sStorageName = "_" + OUString::number( static_cast<sal_Int64>( nObjId ));
+ tools::SvRef<SotStorage> xOleStg = xObjPool->OpenSotStorage(sStorageName);
if (!xOleStg.is())
return;