changeset 1633:1c9399ade69e

2009-07-10 Lillian Angel <langel@redhat.com> * patches/icedtea-graphics.patch: Updated patch to fix Sun bugs * 6491856 and 6593649. Filed upstream: https://bugs.openjdk.java.net/show_bug.cgi?id=100073. * patches/icedtea-messageutils.patch: Updated to the patch accepted upstream: https://bugs.openjdk.java.net/show_bug.cgi?id=100074
author langel
date Fri, 10 Jul 2009 13:12:21 -0400
parents 7acbff01007f
children dd1ce0a6da73
files ChangeLog patches/icedtea-graphics.patch patches/icedtea-messageutils.patch
diffstat 3 files changed, 53 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jul 09 17:29:13 2009 -0400
+++ b/ChangeLog	Fri Jul 10 13:12:21 2009 -0400
@@ -1,3 +1,11 @@
+2009-07-10  Lillian Angel  <langel@redhat.com>
+
+	* patches/icedtea-graphics.patch: Updated patch to fix Sun bugs 6491856 and
+	6593649. Filed upstream:
+	https://bugs.openjdk.java.net/show_bug.cgi?id=100073.
+	* patches/icedtea-messageutils.patch: Updated to the patch accepted
+	upstream:  https://bugs.openjdk.java.net/show_bug.cgi?id=100074
+
 2009-07-09  Omair Majid  <omajid@redhat.com>
 
 	* rt/net/sourceforge/jnlp/Launcher.java
--- a/patches/icedtea-graphics.patch	Thu Jul 09 17:29:13 2009 -0400
+++ b/patches/icedtea-graphics.patch	Fri Jul 10 13:12:21 2009 -0400
@@ -1,60 +1,42 @@
 --- ../opienjdkb23/openjdk/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	2007-10-30 04:37:06.000000000 -0400
 +++ openjdk/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	2007-11-13 12:50:52.000000000 -0500
-@@ -236,9 +236,6 @@
-         Segment segment = SegmentCache.getSharedSegment();
-         loadText(segment, p0, p1);
-         int currentWidth = getWidth();
--        if (currentWidth == Integer.MAX_VALUE) {
--            currentWidth = (int) getDefaultSpan(View.X_AXIS);
--        }
-         if (wordWrap) {
-             p = p0 + Utilities.getBreakLocation(segment, metrics,
-                                                 tabBase, tabBase + currentWidth,
-@@ -324,20 +321,6 @@
-         tabSize = getTabSize() * metrics.charWidth('m');
-     }
- 
--    /**
--     * Return reasonable default values for the view dimensions.  The standard
--     * text terminal size 80x24 is pretty suitable for the wrapped plain view.
--     */
--    private float getDefaultSpan(int axis) {
--         switch (axis) {
--            case View.X_AXIS:
+@@ -327,13 +327,37 @@
+     /**
+      * Return reasonable default values for the view dimensions.  The standard
+      * text terminal size 80x24 is pretty suitable for the wrapped plain view.
++     *
++     * The size should not be larger than the component housing the view's 
++     * container.
+      */
+     private float getDefaultSpan(int axis) {
++	 Container host = getContainer();
++	 Component parent = null;
++
++	 if (host != null)
++	    parent = host.getParent();	
+          switch (axis) {
+             case View.X_AXIS:
 -                return 80 * metrics.getWidths()['M'];
--            case View.Y_AXIS:
++		int defaultWidth = 80 * metrics.getWidths()['M'];
++		int parentWidth = 0;
++
++		if (parent != null)
++		   parentWidth = parent.getWidth();
++
++		if (defaultWidth > parentWidth)
++		  return parentWidth;
++		return defaultWidth;
+             case View.Y_AXIS:
 -                return 24 * metrics.getHeight();
--            default:
--                throw new IllegalArgumentException("Invalid axis: " + axis);
--        }
--    }
- 
-     // --- TabExpander methods ------------------------------------------
- 
-@@ -573,19 +556,16 @@
-                 if (width == Integer.MAX_VALUE) {
-                     // We have been initially set to MAX_VALUE, but we don't
-                     // want this as our preferred.
--                    width = getDefaultSpan(axis);
-+                    return 100f;
-                 }
-                 return width;
-             case View.Y_AXIS:
--                if (getDocument().getLength() > 0) {
--                    if ((lineCount < 0) || widthChanging) {
--                        breakLines(getStartOffset());
--                    }
--                    return lineCount * metrics.getHeight();
--                } else {
--                    return getDefaultSpan(axis);
--                }
--            default:
-+            	if (lineCount < 0 || widthChanging) {
-+                   breakLines(getStartOffset());
-+               }
-+                int h = lineCount * metrics.getHeight();
-+                return h;
-+	    default:
++		int defaultHeight = 24 * metrics.getHeight();
++		int parentHeight = 0;
++
++		if (parent != null)
++		   parentHeight = parent.getHeight();
++
++		if (defaultHeight > parentHeight)
++		  return parentHeight;
++		return defaultHeight;
+             default:
                  throw new IllegalArgumentException("Invalid axis: " + axis);
-             }
          }
--- a/patches/icedtea-messageutils.patch	Thu Jul 09 17:29:13 2009 -0400
+++ b/patches/icedtea-messageutils.patch	Fri Jul 10 13:12:21 2009 -0400
@@ -1,12 +1,14 @@
---- openjdk/jdk/src/share/native/sun/misc/MessageUtils.c.orig 2008-09-17 15:17:02.000000000 +0200
-+++ openjdk/jdk/src/share/native/sun/misc/MessageUtils.c      2008-09-17 15:56:07.000000000 +0200
-@@ -39,6 +39,9 @@ printToFile(JNIEnv *env, jstring s, FILE
-    int i;
+--- oldMessageUtils.c	2009-06-25 16:39:27.000000000 -0400
++++ openjdk/jdk/src/share/native/sun/misc/MessageUtils.c	2009-06-25 16:40:14.000000000 -0400
+@@ -39,6 +39,11 @@
+     int i;
      const jchar *sAsArray;
-
+ 
 +    if (s == NULL) {
-+       s = (*env)->NewStringUTF(env, "null\0");
++      s = (*env)->NewStringUTF(env, "null");
++      if (s == NULL) return;
 +    }
++
      sAsArray = (*env)->GetStringChars(env, s, NULL);
      length = (*env)->GetStringLength(env, s);
-     sConverted = (char *) malloc(length + 1); 
+     sConverted = (char *) malloc(length + 1);