7124223: [macosx] Regression test failure with new exception, when glyph is positioned explicitly
authorbae
Fri, 30 Nov 2012 11:32:36 +0400
changeset 14644 fae7cdc442d5
parent 14643 be37da9c57d7
child 14645 1dd83dfd49ff
7124223: [macosx] Regression test failure with new exception, when glyph is positioned explicitly Reviewed-by: jgodinez
jdk/src/share/classes/sun/print/PathGraphics.java
--- a/jdk/src/share/classes/sun/print/PathGraphics.java	Wed Nov 28 14:12:32 2012 +0400
+++ b/jdk/src/share/classes/sun/print/PathGraphics.java	Fri Nov 30 11:32:36 2012 +0400
@@ -1025,7 +1025,8 @@
                 continue;
             }
             glyph = font2D.charToGlyph(c);
-            if (glyph != missingGlyph && glyph < numGlyphs &&
+            if (glyph != missingGlyph &&
+                glyph >= 0 && glyph < numGlyphs &&
                 (glyphToCharMap[glyph] ==
                  CharToGlyphMapper.INVISIBLE_GLYPH_ID)) {
                 glyphToCharMap[glyph] = c;