You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by tr...@apache.org on 2018/08/09 23:01:28 UTC

svn commit: r1837765 - /openoffice/trunk/main/vcl/source/gdi/sallayout.cxx

Author: truckman
Date: Thu Aug  9 23:01:28 2018
New Revision: 1837765

URL: http://svn.apache.org/viewvc?rev=1837765&view=rev
Log:
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.


Modified:
    openoffice/trunk/main/vcl/source/gdi/sallayout.cxx

Modified: openoffice/trunk/main/vcl/source/gdi/sallayout.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/sallayout.cxx?rev=1837765&r1=1837764&r2=1837765&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/sallayout.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/sallayout.cxx Thu Aug  9 23:01:28 2018
@@ -1871,7 +1871,15 @@ void MultiSalLayout::AdjustLayout( ImplL
     // 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