This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: GTK peer
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Tue, 20 Apr 2004 11:47:06 +0200
- Subject: FYI: Patch: GTK peer
Hi list,
I just merged the attached patch from GNU classpath to trunk.
Michael
2004-04-20 Mark Wielaard <mark@klomp.org>
* gnu/java/awt/peer/gtk/GtkFontPeer.java: Use fallback when
MissingResourceException is thrown.
* gnu/java/awt/peer/gtk/GtkToolkit.java (getFontPeer): Don't return
null when a MissingResourceException is thrown. Should never happen.
Index: gnu/java/awt/peer/gtk/GtkFontPeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java,v
retrieving revision 1.4
diff -u -r1.4 GtkFontPeer.java
--- gnu/java/awt/peer/gtk/GtkFontPeer.java 17 Mar 2004 21:28:57 -0000 1.4
+++ gnu/java/awt/peer/gtk/GtkFontPeer.java 20 Apr 2004 09:31:46 -0000
@@ -43,6 +43,7 @@
import java.awt.font.*;
import java.util.Locale;
import java.util.ResourceBundle;
+import java.util.MissingResourceException;
import java.text.*;
import gnu.java.awt.peer.ClasspathFontPeer;
@@ -74,9 +75,20 @@
{
super(name, style, size);
+ String Xname = null;
if (bundle != null)
- Xname = bundle.getString (name.toLowerCase () + "." + style);
- else
+ {
+ try
+ {
+ Xname = bundle.getString (name.toLowerCase () + "." + style);
+ }
+ catch (MissingResourceException mre)
+ {
+ // ignored
+ }
+ }
+
+ if (Xname == null)
{
String weight;
String slant;
@@ -98,6 +110,8 @@
Xname = "-*-*-" + weight + "-" + slant + "-normal-*-*-" + size + "-*-*-" + spacing + "-*-*-*";
}
+
+ this.Xname = Xname;
}
public String getXLFD ()
Index: gnu/java/awt/peer/gtk/GtkToolkit.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java,v
retrieving revision 1.9
diff -u -r1.9 GtkToolkit.java
--- gnu/java/awt/peer/gtk/GtkToolkit.java 17 Mar 2004 21:28:57 -0000 1.9
+++ gnu/java/awt/peer/gtk/GtkToolkit.java 20 Apr 2004 09:31:46 -0000
@@ -377,12 +377,8 @@
*/
private FontPeer getFontPeer (String name, int style, int size)
{
- try {
- GtkFontPeer fp = new GtkFontPeer (name, style, size);
- return fp;
- } catch (MissingResourceException ex) {
- return null;
- }
+ GtkFontPeer fp = new GtkFontPeer (name, style, size);
+ return fp;
}
/**