changeset 7800:7c18e8582dec

8055489: Better substitution formats Reviewed-by: prr
author bae
date Wed, 08 Oct 2014 11:05:31 +0400
parents 707b534fb895
children e6805ad783c5 1964c973dcc1
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	Wed Oct 08 10:43:46 2014 +0400
+++ b/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp	Wed Oct 08 11:05:31 2014 +0400
@@ -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	Wed Oct 08 10:43:46 2014 +0400
+++ b/src/share/native/sun/font/layout/LETableReference.h	Wed Oct 08 11:05:31 2014 +0400
@@ -471,7 +471,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;
+     }
   }
 
   /**