[Libreoffice-commits] core.git: Branch 'aoo/trunk' - vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Aug 10 00:09:31 UTC 2018
vcl/source/gdi/sallayout.cxx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 793b66d942edd74e9e0368895575e48527e0793a
Author: Don Lewis <truckman at apache.org>
AuthorDate: Thu Aug 9 23:01:28 2018 +0000
Commit: Don Lewis <truckman at apache.org>
CommitDate: Thu Aug 9 23:01:28 2018 +0000
nActiveCharPos can be less than mnMinCharPos if the ScriptItemize() call
in UniscribeLayout::LayoutText() finds a mult-character script item
that starts in the leading context and overlaps into the start of the
run. UniscribeLayout::LayoutText() drops the glyphs for the context
characters, but does not (yet?) adjust the starting character position
of the item. Since the text layout direction can't change in the
middle of the offending script item, we can safely use the direction at
the start of the run.
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 0c59f79c4cc5..50fcf3346735 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1871,7 +1871,15 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
// get the next codepoint index that needs fallback
int nActiveCharPos = nCharPos[0];
// get the end index of the active run
- int nLastRunEndChar = (vRtl[nActiveCharPos - mnMinCharPos])?
+ // nActiveCharPos can be less than mnMinCharPos if the ScriptItemize() call
+ // in UniscribeLayout::LayoutText() finds a mult-character script item
+ // that starts in the leading context and overlaps into the start of the
+ // run. UniscribeLayout::LayoutText() drops the glyphs for the context
+ // characters, but does not (yet?) adjust the starting character position
+ // of the item. Since the text layout direction can't change in the
+ // middle of the offending script item, we can safely use the direction at
+ // the start of the run
+ int nLastRunEndChar = (vRtl[nActiveCharPos >= mnMinCharPos ? (nActiveCharPos - mnMinCharPos) : 0])?
rArgs.mnEndCharPos : rArgs.mnMinCharPos - 1;
int nRunVisibleEndChar = nCharPos[0];
// merge the fallback levels
More information about the Libreoffice-commits
mailing list