summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-04-29 12:24:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-29 18:25:31 +0200
commit04aafba860f613c20e7078d038cc83eb02de0b54 (patch)
tree8153152b87089419bde17313d9ac7b9de6fcce32 /linguistic
parent76c793d2acf66f46e9edcda43d2f4327e8374841 (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.cxx12
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;