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 /reportdesign | |
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 'reportdesign')
-rw-r--r-- | reportdesign/source/core/misc/reportformula.cxx | 7 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx | 9 | ||||
-rw-r--r-- | reportdesign/source/ui/report/FormattedFieldBeautifier.cxx | 5 |
3 files changed, 6 insertions, 15 deletions
diff --git a/reportdesign/source/core/misc/reportformula.cxx b/reportdesign/source/core/misc/reportformula.cxx index c5026a545e94..1f743afd765f 100644 --- a/reportdesign/source/core/misc/reportformula.cxx +++ b/reportdesign/source/core/misc/reportformula.cxx @@ -58,12 +58,7 @@ namespace rptui case Field: { - OUStringBuffer aBuffer; - aBuffer.append( sFieldPrefix ); - aBuffer.append( "[" ); - aBuffer.append( _rFieldOrExpression ); - aBuffer.append( "]" ); - m_sCompleteFormula = aBuffer.makeStringAndClear(); + m_sCompleteFormula = sFieldPrefix + OUStringLiteral("[") + _rFieldOrExpression + "]"; } break; default: diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index 2116ca0c0893..4d8f8356f6be 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -49,12 +49,11 @@ static void lcl_exportPrettyPrinting(const uno::Reference< xml::sax::XDocumentHa OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,const xmloff::token::XMLTokenEnum& _eAttribute) { - OUStringBuffer sQName; + return // ...if it's in our map, make the prefix - sQName.append ( xmloff::token::GetXMLToken(_eNamespace) ); - sQName.append ( ':' ); - sQName.append ( xmloff::token::GetXMLToken(_eAttribute) ); - return sQName.makeStringAndClear(); + xmloff::token::GetXMLToken(_eNamespace) + + ":" + + xmloff::token::GetXMLToken(_eAttribute); } static void lcl_correctCellAddress(const OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & xAttribs) diff --git a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx index 7021ed43f1ae..329b57014b53 100644 --- a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx +++ b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx @@ -90,10 +90,7 @@ namespace rptui OUString sLabel = m_rReportController.getColumnLabel_throw(sColumnName); if ( !sLabel.isEmpty() ) { - OUStringBuffer aBuffer; - aBuffer.append( "=" ); - aBuffer.append( sLabel ); - sDataField = aBuffer.makeStringAndClear(); + sDataField = "=" + sLabel; bSet = false; } } |