summaryrefslogtreecommitdiff
path: root/i18npool/source/textconversion
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-09-07 23:10:33 +0300
committerArkadiy Illarionov <qarkai@gmail.com>2019-10-21 19:41:43 +0200
commit00e2f118d7f4f070ebddf16b2cf4e89cf9d551a7 (patch)
tree2f48bf4455360d0f08d8096317ea31012debffbc /i18npool/source/textconversion
parentad3e00237f48c52dbd2833f21f5e2f5acfdd4167 (diff)
Simplify Sequence iterations in i18npool
Use range-based loops, STL and comphelper functions. Change-Id: Ibbc1c14e921585819872f26e8def2a60594e6a63 Reviewed-on: https://gerrit.libreoffice.org/78754 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'i18npool/source/textconversion')
-rw-r--r--i18npool/source/textconversion/textconversion_ko.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/i18npool/source/textconversion/textconversion_ko.cxx b/i18npool/source/textconversion/textconversion_ko.cxx
index 9d88965cd89a..cfcb08d6deb6 100644
--- a/i18npool/source/textconversion/textconversion_ko.cxx
+++ b/i18npool/source/textconversion/textconversion_ko.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/linguistic2/ConversionDirection.hpp>
#include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
#include <com/sun/star/linguistic2/ConversionDictionaryList.hpp>
+#include <comphelper/sequence.hxx>
#include <rtl/ustrbuf.hxx>
#include <unicode/uchar.h>
#include <memory>
@@ -191,21 +192,9 @@ static Sequence< OUString >& operator += (Sequence< OUString > &rSeq1, Sequence<
{
if (! rSeq1.hasElements() && rSeq2.hasElements())
rSeq1 = rSeq2;
- else if (rSeq2.hasElements()) {
- sal_Int32 i, j, k, l;
- k = l = rSeq1.getLength();
- rSeq1.realloc(l + rSeq2.getLength());
-
- for (i = 0; i < rSeq2.getLength(); i++) {
- for (j = 0; j < l; j++)
- if (rSeq1[j] == rSeq2[i])
- break;
- if (j == l)
- rSeq1[k++] = rSeq2[i];
- }
- if (rSeq1.getLength() > k)
- rSeq1.realloc(k);
- }
+ else if (rSeq2.hasElements())
+ rSeq1 = comphelper::combineSequences(rSeq1, rSeq2);
+
return rSeq1;
}