[Libreoffice-commits] core.git: vcl/source

Mark Hung marklh9 at gmail.com
Thu Mar 1 12:39:57 UTC 2018


 vcl/source/gdi/sallayout.cxx |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit e85aa0cc8b306c2f5ca6240b99e1704f772dbebb
Author: Mark Hung <marklh9 at gmail.com>
Date:   Wed Feb 28 17:08:20 2018 +0800

    tdf#60533 invoke ubidi_setPara with correct paraLevel parameter.
    
    Replace UBIDI_DEFAULT_LTR and UBIDI_DEFAULT_RTL with 0 and 1
    respectively.
    
    According to the ICU document for ubidi_setPara, paraLevel
    specifies the default level for the text, and the function shall
    determine the level from the text when UBIDI_DEFAULT_LTR or
    UBIDI_DEFAULT_RTL is used as paraLevel.
    
    However we already know that the paragraph is right-to-left when
    SalLayoutFlags::BiDiRtl is set. Besides, having default writing
    direction deteremined based on text cause a problem when the text
    contains only latin or weak directionality characters like
    brackets in a right-to-left paragraph.
    
    Change-Id: I4d627d2c2112ab1bba67408433f2e09f87b1ea46
    Reviewed-on: https://gerrit.libreoffice.org/50493
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mark Hung <marklh9 at gmail.com>

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 65bd59b57951..368247cfb76d 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -415,10 +415,7 @@ ImplLayoutArgs::ImplLayoutArgs(const OUString& rStr,
     else
     {
         // handle weak BiDi mode
-
-        UBiDiLevel nLevel = UBIDI_DEFAULT_LTR;
-        if( mnFlags & SalLayoutFlags::BiDiRtl )
-            nLevel = UBIDI_DEFAULT_RTL;
+        UBiDiLevel nLevel = (mnFlags & SalLayoutFlags::BiDiRtl)? 1 : 0;
 
         // prepare substring for BiDi analysis
         // TODO: reuse allocated pParaBidi


More information about the Libreoffice-commits mailing list