changeset 10376:d9bd92184434

8055489: Better substitution formats Reviewed-by: srl, bae, mschoene
author prr
date Thu, 11 Sep 2014 10:27:25 -0700
parents e0d89a863142
children 2dfb4ef6c76d
files src/share/native/sun/font/layout/ContextualSubstSubtables.cpp src/share/native/sun/font/layout/LETableReference.h
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp	Thu Sep 11 13:25:44 2014 +0400
+++ b/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp	Thu Sep 11 10:27:25 2014 -0700
@@ -583,6 +583,8 @@
                 LEReferenceTo<ChainSubClassRuleTable>
                      chainSubClassRuleTable(chainSubClassSetTable, success, chainSubClassRuleTableOffset);
                 le_uint16 backtrackGlyphCount = SWAPW(chainSubClassRuleTable->backtrackGlyphCount);
+                LEReferenceToArrayOf<le_uint16>   backtrackClassArray(base, success, chainSubClassRuleTable->backtrackClassArray, backtrackGlyphCount);
+                if( LE_FAILURE(success) ) { return 0; }
                 le_uint16 inputGlyphCount = SWAPW(chainSubClassRuleTable->backtrackClassArray[backtrackGlyphCount]) - 1;
                 LEReferenceToArrayOf<le_uint16>   inputClassArray(base, success, &chainSubClassRuleTable->backtrackClassArray[backtrackGlyphCount + 1],inputGlyphCount+2); // +2 for the lookaheadGlyphCount count
                 le_uint16 lookaheadGlyphCount = SWAPW(inputClassArray.getObject(inputGlyphCount, success));
@@ -599,8 +601,6 @@
                 }
 
                 tempIterator.prev();
-                LEReferenceToArrayOf<le_uint16>   backtrackClassArray(base, success, chainSubClassRuleTable->backtrackClassArray, backtrackGlyphCount);
-                if( LE_FAILURE(success) ) { return 0; }
                 if (! matchGlyphClasses(backtrackClassArray, backtrackGlyphCount,
                                         &tempIterator, backtrackClassDefinitionTable, success, TRUE)) {
                     continue;
--- a/src/share/native/sun/font/layout/LETableReference.h	Thu Sep 11 13:25:44 2014 +0400
+++ b/src/share/native/sun/font/layout/LETableReference.h	Thu Sep 11 10:27:25 2014 -0700
@@ -470,7 +470,12 @@
 #endif
 
   const T& getObject(le_uint32 i, LEErrorCode &success) const {
-    return *getAlias(i,success);
+      const T *ret = getAlias(i, success);
+      if (LE_FAILURE(success) || ret==NULL) {
+          return *(new T(0));
+      } else {
+          return *ret;
+     }
   }
 
   /**