vcl/source/gdi/CommonSalLayout.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+)
New commits: commit 8736cc0f5c6d4cb80ccb39ca6797d2f4490dade9 Author: Khaled Hosny <khaledho...@eglug.org> AuthorDate: Tue Jun 4 03:57:00 2019 +0200 Commit: Khaled Hosny <khaledho...@eglug.org> CommitDate: Tue Jun 4 14:46:24 2019 +0200 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: Mark Hung <mark...@gmail.com> diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index e146fb245131..90c519385bd2 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -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); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits