8017469: [macosx] Printing problem using ja and zh_CN locales
authorjgodinez
Fri, 30 Aug 2013 09:10:30 -0700
changeset 19780 9b0b2ea681b7
parent 19779 fe0b98be61a0
child 19781 91b06f016821
8017469: [macosx] Printing problem using ja and zh_CN locales Reviewed-by: prr, jchen
jdk/src/macosx/native/sun/awt/CTextPipe.m
--- a/jdk/src/macosx/native/sun/awt/CTextPipe.m	Wed Aug 28 08:59:50 2013 -0700
+++ b/jdk/src/macosx/native/sun/awt/CTextPipe.m	Fri Aug 30 09:10:30 2013 -0700
@@ -145,11 +145,6 @@
 
     BOOL saved = false;
 
-    /* Save and restore of graphics context is done before the iteration.  
-       This seems to work using our test case (see bug ID 7158350) so we are restoring it at
-       the end of the for loop.  If we find out that save/restore outside the loop
-       doesn't work on all cases then we will move the Save/Restore inside the loop.*/
-    CGContextSaveGState(cgRef);
     CGAffineTransform invTx = CGAffineTransformInvert(strike->fTx);
 
     NSUInteger i;
@@ -226,7 +221,9 @@
 
     }
     // reset the font on the context after striking a unicode with CoreText
-    CGContextRestoreGState(cgRef);
+    if (saved) {
+        CGContextRestoreGState(cgRef);
+    }
 }
 
 // Using the Quartz Surface Data context, draw a hot-substituted character run