diff options
author | Mark Hung <marklh9@gmail.com> | 2018-02-28 17:08:20 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2018-03-01 13:39:32 +0100 |
commit | e85aa0cc8b306c2f5ca6240b99e1704f772dbebb (patch) | |
tree | aea830abac34808db5f80034b657a082b0772677 | |
parent | 66564dac88ffcc781b4fade7ca0f4f72af6b8bca (diff) |
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@libreoffice.org>
Reviewed-by: Mark Hung <marklh9@gmail.com>
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 5 |
1 files changed, 1 insertions, 4 deletions
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 |