summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2017-05-28 19:41:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-17 11:55:13 +0200
commit9881bea8d41997fb46579eb5f0314300159c96cc (patch)
treef52daa7055d2d28959e2d1ad576d963b7c0d3b2d /i18npool
parentec4034c4a4f23574401ba2a74b635d9ed4befbc8 (diff)
remove unnecessary use of OUString::getStr
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/breakiterator/gendict.cxx15
-rw-r--r--i18npool/source/indexentry/genindex_data.cxx5
-rw-r--r--i18npool/source/textconversion/genconv_dict.cxx20
3 files changed, 18 insertions, 22 deletions
diff --git a/i18npool/source/breakiterator/gendict.cxx b/i18npool/source/breakiterator/gendict.cxx
index 16950287d82b..dd3376835dd1 100644
--- a/i18npool/source/breakiterator/gendict.cxx
+++ b/i18npool/source/breakiterator/gendict.cxx
@@ -121,7 +121,6 @@ static inline void printDataArea(FILE *dictionary_fp, FILE *source_fp, vector<sa
// input file is in UTF-8 encoding
// don't convert last new line character to Ostr.
OUString Ostr(str, strlen(str) - 1, RTL_TEXTENCODING_UTF8);
- const sal_Unicode *u = Ostr.getStr();
const sal_Int32 len = Ostr.getLength();
@@ -130,24 +129,24 @@ static inline void printDataArea(FILE *dictionary_fp, FILE *source_fp, vector<sa
if (len == i)
continue; // skip one character word
- if (u[0] != current) {
- OSL_ENSURE( (u[0] > current), "Dictionary file should be sorted");
- current = u[0];
+ if (Ostr[0] != current) {
+ OSL_ENSURE( (Ostr[0] > current), "Dictionary file should be sorted");
+ current = Ostr[0];
charArray[current] = lenArray.size();
}
lenArray.push_back(lenArrayCurr);
- set_exists(u[0]);
+ set_exists(Ostr[0]);
// first character is stored in charArray, so start from second
for (i = 1; i < len; i++, lenArrayCurr++) {
- set_exists(u[i]);
+ set_exists(Ostr[i]);
#ifndef DICT_JA_ZH_IN_DATAFILE
- fprintf(source_fp, "0x%04x, ", u[i]);
+ fprintf(source_fp, "0x%04x, ", Ostr[i]);
if ((lenArrayCurr & 0x0f) == 0x0f)
fputs("\n\t", source_fp);
#else
- fwrite(&u[i], sizeof(u[i]), 1, source_fp);
+ fwrite(&Ostr[i], sizeof(Ostr[i]), 1, source_fp);
#endif
}
}
diff --git a/i18npool/source/indexentry/genindex_data.cxx b/i18npool/source/indexentry/genindex_data.cxx
index a185d753462c..d505dc9b661f 100644
--- a/i18npool/source/indexentry/genindex_data.cxx
+++ b/i18npool/source/indexentry/genindex_data.cxx
@@ -119,7 +119,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
fprintf(fp, "\n};\n\n");
sal_Int32 len=result.getLength();
- const sal_Unicode *ustr=result.getStr();
fprintf(fp, "\nstatic const sal_uInt16 idx2[] = {");
for (i = k = 0; i <= max_index; i++) {
if (index[i] != 0xFFFF) {
@@ -129,7 +128,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
fprintf(
fp, "0x%04lx, ",
sal::static_int_cast< unsigned long >(
- ad == -1 ? 0 : max == 2 ? ustr[ad] : ad));
+ ad == -1 ? 0 : max == 2 ? result[ad] : ad));
}
fprintf(fp, "\n\t");
}
@@ -142,7 +141,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
fprintf(fp, "\nstatic const sal_uInt16 idx3[] = {");
for (i = k = 0; i < len; i++) {
if (k++ % 16 == 0) fprintf(fp, "\n\t");
- fprintf(fp, "0x%04x, ", (sep.toChar() == ustr[i]) ? 0 : ustr[i]);
+ fprintf(fp, "0x%04x, ", (sep.toChar() == result[i]) ? 0 : result[i]);
}
fprintf(fp, "\n};\n\n");
}
diff --git a/i18npool/source/textconversion/genconv_dict.cxx b/i18npool/source/textconversion/genconv_dict.cxx
index e6903a11f643..13c234670af3 100644
--- a/i18npool/source/textconversion/genconv_dict.cxx
+++ b/i18npool/source/textconversion/genconv_dict.cxx
@@ -101,19 +101,18 @@ void make_hhc_char(FILE *sfp, FILE *cfp)
// input file is in UTF-8 encoding (Hangul:Hanja)
// don't convert last new line character to Ostr.
OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8);
- const sal_Unicode *Ustr = Ostr.getStr();
sal_Int32 len = Ostr.getLength();
- Hangul2HanjaData[count][0] = Ustr[0];
+ Hangul2HanjaData[count][0] = Ostr[0];
Hangul2HanjaData[count][1] = sal::static_int_cast<sal_uInt16>( address );
Hangul2HanjaData[count][2] = sal::static_int_cast<sal_uInt16>( len - 2 );
count++;
for (i = 2; i < len; i++) {
- Hanja2HangulData[Ustr[i]] = Ustr[0];
+ Hanja2HangulData[Ostr[i]] = Ostr[0];
if (address++ % 16 == 0)
fprintf(cfp, "\n\t");
- fprintf(cfp, "0x%04x, ", Ustr[i]);
+ fprintf(cfp, "0x%04x, ", Ostr[i]);
}
}
fprintf(cfp, "\n};\n");
@@ -189,17 +188,16 @@ void make_stc_char(FILE *sfp, FILE *cfp)
// input file is in UTF-8 encoding (SChinese:TChinese)
// don't convert last new line character to Ostr.
OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8);
- const sal_Unicode *Ustr = Ostr.getStr();
sal_Int32 len = Ostr.getLength();
- if (Ustr[1] == 'v')
- SChinese2VChineseData[Ustr[0]] = Ustr[2];
+ if (Ostr[1] == 'v')
+ SChinese2VChineseData[Ostr[0]] = Ostr[2];
else {
- SChinese2TChineseData[Ustr[0]] = Ustr[2];
- if (SChinese2VChineseData[Ustr[0]] == 0)
- SChinese2VChineseData[Ustr[0]] = Ustr[2];
+ SChinese2TChineseData[Ostr[0]] = Ostr[2];
+ if (SChinese2VChineseData[Ostr[0]] == 0)
+ SChinese2VChineseData[Ostr[0]] = Ostr[2];
}
for (i = 2; i < len; i++)
- TChinese2SChineseData[Ustr[i]] = Ustr[0];
+ TChinese2SChineseData[Ostr[i]] = Ostr[0];
}
fprintf(cfp, "\nstatic const sal_uInt16 STC_CharIndex_S2T[] = {");