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 /sc/source/filter/excel | |
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 'sc/source/filter/excel')
-rw-r--r-- | sc/source/filter/excel/xepivotxml.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/excel/xltools.cxx | 13 |
2 files changed, 10 insertions, 11 deletions
diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index d2dedf012c46..f39bab0e63bf 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -1168,14 +1168,14 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP XML_showRowStripes, "0", XML_showColStripes, "0", XML_showLastColumn, "1"); - OUStringBuffer aBuf("../pivotCache/pivotCacheDefinition"); - aBuf.append(nCacheId); - aBuf.append(".xml"); + OUString aBuf = "../pivotCache/pivotCacheDefinition" + + OUString::number(nCacheId) + + ".xml"; rStrm.addRelation( pPivotStrm->getOutputStream(), CREATE_OFFICEDOC_RELATION_TYPE("pivotCacheDefinition"), - aBuf.makeStringAndClear()); + aBuf); pPivotStrm->endElement(XML_pivotTableDefinition); } diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 93c6d0ec31b6..2a531a70da61 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -635,13 +635,12 @@ static const char maCFStyleNamePrefix2[] = "ConditionalStyle_"; /// Prefix for c OUString XclTools::GetCondFormatStyleName( SCTAB nScTab, sal_Int32 nFormat, sal_uInt16 nCondition ) { - OUStringBuffer aBuf(maCFStyleNamePrefix1); - aBuf.append(static_cast<sal_Int32>(nScTab+1)); - aBuf.append('_'); - aBuf.append(static_cast<sal_Int32>(nFormat+1)); - aBuf.append('_'); - aBuf.append(static_cast<sal_Int32>(nCondition+1)); - return aBuf.makeStringAndClear(); + return maCFStyleNamePrefix1 + + OUString::number(static_cast<sal_Int32>(nScTab+1)) + + "_" + + OUString::number(static_cast<sal_Int32>(nFormat+1)) + + "_" + + OUString::number(static_cast<sal_Int32>(nCondition+1)); } bool XclTools::IsCondFormatStyleName( const OUString& rStyleName ) |