Kaydet (Commit) 8736cc0f authored tarafından Khaled Hosny's avatar Khaled Hosny

Use ICU UCHAR_VERTICAL_ORIENTATION when available

Starting from ICU 63, the vertical orientation property is provided by ICU so
we use it instead of our inyternal, and potentially outdated data file. Old
code is kept until support for ICU < 63 is dropped.

Change-Id: I0df1f3f5e853ca90945a36a8123bec9ae7f691cc
Reviewed-on: https://gerrit.libreoffice.org/73425
Tested-by: Jenkins
Reviewed-by: 's avatarMark Hung <marklh9@gmail.com>
üst fce79b23
......@@ -121,6 +121,14 @@ namespace vcl {
} // namespace vcl
namespace {
#if U_ICU_VERSION_MAJOR_NUM >= 63
enum class VerticalOrientation {
Upright = U_VO_UPRIGHT,
Rotated = U_VO_ROTATED,
TransformedUpright = U_VO_TRANSFORMED_UPRIGHT,
TransformedRotated = U_VO_TRANSFORMED_ROTATED
};
#else
#include "VerticalOrientationData.cxx"
// These must match the values in the file included above.
......@@ -130,6 +138,7 @@ namespace {
TransformedUpright = 2,
TransformedRotated = 3
};
#endif
VerticalOrientation GetVerticalOrientation(sal_UCS4 cCh, const LanguageTag& rTag)
{
......@@ -140,6 +149,9 @@ namespace {
&& rTag.getLanguage() == "zh")
return VerticalOrientation::TransformedUpright;
#if U_ICU_VERSION_MAJOR_NUM >= 63
int32_t nRet = u_getIntPropertyValue(cCh, UCHAR_VERTICAL_ORIENTATION);
#else
uint8_t nRet = 1;
if (cCh < 0x10000)
......@@ -158,6 +170,7 @@ namespace {
// Default value for unassigned
SAL_WARN("vcl.gdi", "Getting VerticalOrientation for codepoint outside Unicode range");
}
#endif
return VerticalOrientation(nRet);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment