diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-29 12:24:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-29 18:25:31 +0200 |
commit | 04aafba860f613c20e7078d038cc83eb02de0b54 (patch) | |
tree | 8153152b87089419bde17313d9ac7b9de6fcce32 /sc/source/filter/xml | |
parent | 76c793d2acf66f46e9edcda43d2f4327e8374841 (diff) |
loplugin:stringadd simplify some *StringBuffer operations
pulled from a larger patch which I created with a more permissive
variant of this plugin
Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r-- | sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 16 |
2 files changed, 9 insertions, 13 deletions
diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx index 73362197a771..bbcba23903e9 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx @@ -208,11 +208,9 @@ public: if (meRangeType == ScDBCollection::GlobalAnonymous) { // name - OUStringBuffer aBuf; - aBuf.append(STR_DB_GLOBAL_NONAME); - aBuf.append(++mnCounter); // 1-based, for entirely arbitrary reasons. The numbers are ignored on import. + OUString aBuf = STR_DB_GLOBAL_NONAME + OUString::number(++mnCounter); // 1-based, for entirely arbitrary reasons. The numbers are ignored on import. - write(aBuf.makeStringAndClear(), rData); + write(aBuf, rData); } else if (meRangeType == ScDBCollection::GlobalNamed) write(rData.GetName(), rData); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 2a01ad60ce6f..9df7d551e88b 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -827,15 +827,13 @@ sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, std::u16string_vi { ScXMLImport::MutexGuard aGuard(*this); LocaleDataWrapper aLocaleData( comphelper::getProcessComponentContext(), LanguageTag( aLocale) ); - OUStringBuffer aBuffer(15); - aBuffer.append("#"); - aBuffer.append( aLocaleData.getNumThousandSep() ); - aBuffer.append("##0"); - aBuffer.append( aLocaleData.getNumDecimalSep() ); - aBuffer.append("00 [$"); - aBuffer.append(rCurrency); - aBuffer.append("]"); - sFormatString = aBuffer.makeStringAndClear(); + sFormatString = "#" + + aLocaleData.getNumThousandSep() + + "##0" + + aLocaleData.getNumDecimalSep() + + "00 [$" + + rCurrency + + "]"; } sal_Int32 nNewKey = xLocalNumberFormats->queryKey(sFormatString, aLocale, true); if (nNewKey == -1) |