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 /linguistic | |
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 'linguistic')
-rw-r--r-- | linguistic/source/dicimp.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 3ba3c9d2effa..f7d4d1b3b0c4 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -389,14 +389,13 @@ ErrCode DictionaryNeo::loadEntries(const OUString &rMainURL) static OString formatForSave(const uno::Reference< XDictionaryEntry > &xEntry, rtl_TextEncoding eEnc ) { - OStringBuffer aStr(OUStringToOString(xEntry->getDictionaryWord(), eEnc)); + OUStringBuffer aStr(xEntry->getDictionaryWord()); if (xEntry->isNegative() || !xEntry->getReplacementText().isEmpty()) { - aStr.append("=="); - aStr.append(OUStringToOString(xEntry->getReplacementText(), eEnc)); + aStr.append("==" + xEntry->getReplacementText()); } - return aStr.makeStringAndClear(); + return OUStringToOString(aStr, eEnc); } ErrCode DictionaryNeo::saveEntries(const OUString &rURL) @@ -438,9 +437,8 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL) pStream->WriteLine("lang: <none>"); else { - OStringBuffer aLine("lang: "); - aLine.append(OUStringToOString(LanguageTag::convertToBcp47(nLanguage), eEnc)); - pStream->WriteLine(aLine.makeStringAndClear()); + OString aLine = "lang: " + OUStringToOString(LanguageTag::convertToBcp47(nLanguage), eEnc); + pStream->WriteLine(aLine); } if (ERRCODE_NONE != (nErr = pStream->GetError())) return nErr; |