openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From truck...@apache.org
Subject svn commit: r1837765 - /openoffice/trunk/main/vcl/source/gdi/sallayout.cxx
Date Thu, 09 Aug 2018 23:01:28 GMT
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



Mime
View raw message