[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - vcl/source

Mark Hung marklh9 at gmail.com
Sun Mar 19 07:20:29 UTC 2017


 vcl/source/gdi/CommonSalLayout.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 465da7d95e17367e615ec5ef65f368d89c8d7f5d
Author: Mark Hung <marklh9 at gmail.com>
Date:   Fri Mar 17 20:00:03 2017 +0800

    tdf#106295 fix vertical orientation for fullwidth colon and semicolon.
    
    Chinese users would expect fullwidth colon (U+FF1A) and semi-colon (U+FF1B)
    to be Tu( transformed upright ) instead of Tr ( Transformed rotated ) in
    vertical writing mode. Make them exceptions of UTR50 when language is zh.
    
    Change-Id: If7d01199973d73136a621bf2f32377da76ccb22a
    Reviewed-on: https://gerrit.libreoffice.org/34980
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/35382

diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index df2849828df7..4d8d65f9501c 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -330,8 +330,12 @@ namespace vcl {
 
     #include "VerticalOrientationData.cxx"
 
-    VerticalOrientation GetVerticalOrientation(sal_UCS4 cCh)
+    VerticalOrientation GetVerticalOrientation(sal_UCS4 cCh, const LanguageTag& rTag)
     {
+        // Override fullwidth colon and semi-colon orientation. Tu is preferred.
+        if ((cCh == 0xff1a || cCh == 0xff1b) && rTag.getLanguage() == "zh")
+            return VerticalOrientation::TransformedUpright;
+
         uint8_t nRet = 1;
 
         if (cCh < 0x10000)
@@ -524,7 +528,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
                 {
                     sal_Int32 nPrevIdx = nIdx;
                     sal_UCS4 aChar = rArgs.mrStr.iterateCodePoints(&nIdx);
-                    VerticalOrientation aVo = vcl::GetVerticalOrientation(aChar);
+                    VerticalOrientation aVo = vcl::GetVerticalOrientation(aChar, rArgs.maLanguageTag);
 
                     sal_UCS4 aVariationSelector = 0;
                     if (nIdx < nEndRunPos)


More information about the Libreoffice-commits mailing list