Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
8ad1d444
Kaydet (Commit)
8ad1d444
authored
Tem 13, 2012
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: fdo#52020 ICU breakiterator not used for Khmer
Change-Id: I4c99129cabe70f17aa223cf8ec0ae1529188b6b7
üst
28d3e647
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
test_breakiterator.cxx
i18npool/qa/cppunit/test_breakiterator.cxx
+24
-0
breakiterator_unicode.cxx
i18npool/source/breakiterator/breakiterator_unicode.cxx
+1
-1
No files found.
i18npool/qa/cppunit/test_breakiterator.cxx
Dosyayı görüntüle @
8ad1d444
...
@@ -59,6 +59,7 @@ public:
...
@@ -59,6 +59,7 @@ public:
#if TODO
#if TODO
void
testNorthernThai
();
void
testNorthernThai
();
#endif
#endif
void
testKhmer
();
CPPUNIT_TEST_SUITE
(
TestBreakIterator
);
CPPUNIT_TEST_SUITE
(
TestBreakIterator
);
CPPUNIT_TEST
(
testLineBreaking
);
CPPUNIT_TEST
(
testLineBreaking
);
...
@@ -69,6 +70,7 @@ public:
...
@@ -69,6 +70,7 @@ public:
#if TODO
#if TODO
CPPUNIT_TEST
(
testNorthernThai
);
CPPUNIT_TEST
(
testNorthernThai
);
#endif
#endif
CPPUNIT_TEST
(
testKhmer
);
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
private
:
private
:
uno
::
Reference
<
i18n
::
XBreakIterator
>
m_xBreak
;
uno
::
Reference
<
i18n
::
XBreakIterator
>
m_xBreak
;
...
@@ -341,6 +343,28 @@ void TestBreakIterator::testNorthernThai()
...
@@ -341,6 +343,28 @@ void TestBreakIterator::testNorthernThai()
}
}
#endif
#endif
//A test to ensure that our khmer word boundary detection is useful
//https://bugs.freedesktop.org/show_bug.cgi?id=52020
void
TestBreakIterator
::
testKhmer
()
{
lang
::
Locale
aLocale
;
aLocale
.
Language
=
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"km"
));
aLocale
.
Country
=
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"KH"
));
const
sal_Unicode
KHMER1
[]
=
{
0x17B2
,
0x17D2
,
0x1799
,
0x1782
,
0x17C1
};
::
rtl
::
OUString
aTest
(
KHMER1
,
SAL_N_ELEMENTS
(
KHMER1
));
i18n
::
Boundary
aBounds
=
m_xBreak
->
getWordBoundary
(
aTest
,
0
,
aLocale
,
i18n
::
WordType
::
DICTIONARY_WORD
,
true
);
CPPUNIT_ASSERT
(
aBounds
.
startPos
==
0
&&
aBounds
.
endPos
==
3
);
aBounds
=
m_xBreak
->
getWordBoundary
(
aTest
,
aBounds
.
endPos
,
aLocale
,
i18n
::
WordType
::
DICTIONARY_WORD
,
true
);
CPPUNIT_ASSERT
(
aBounds
.
startPos
==
3
&&
aBounds
.
endPos
==
5
);
}
void
TestBreakIterator
::
setUp
()
void
TestBreakIterator
::
setUp
()
{
{
BootstrapFixtureBase
::
setUp
();
BootstrapFixtureBase
::
setUp
();
...
...
i18npool/source/breakiterator/breakiterator_unicode.cxx
Dosyayı görüntüle @
8ad1d444
...
@@ -133,7 +133,7 @@ void SAL_CALL BreakIterator_Unicode::loadICUBreakIterator(const com::sun::star::
...
@@ -133,7 +133,7 @@ void SAL_CALL BreakIterator_Unicode::loadICUBreakIterator(const com::sun::star::
rbi
=
new
OOoRuleBasedBreakIterator
(
udata_open
(
"OpenOffice"
,
"brk"
,
rbi
=
new
OOoRuleBasedBreakIterator
(
udata_open
(
"OpenOffice"
,
"brk"
,
OUStringToOString
(
breakRules
[
breakType
],
RTL_TEXTENCODING_ASCII_US
).
getStr
(),
&
status
),
status
);
OUStringToOString
(
breakRules
[
breakType
],
RTL_TEXTENCODING_ASCII_US
).
getStr
(),
&
status
),
status
);
}
}
else
if
(
rLocale
.
Language
!=
"th"
)
//use icu's breakiterator for Thai
else
if
(
rLocale
.
Language
!=
"th"
&&
rLocale
.
Language
!=
"km"
)
//use icu's breakiterator for Thai and Khmer
{
{
status
=
U_ZERO_ERROR
;
status
=
U_ZERO_ERROR
;
OStringBuffer
aUDName
(
64
);
OStringBuffer
aUDName
(
64
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment