diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-04-20 09:46:28 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-04-20 09:46:28 +0000 |
commit | db9f865b604b3d8b11148dbe115e90b75343f08c (patch) | |
tree | c1ff41daa3bcd175f39b8da1d8b275e6d534f0fe /libjava | |
parent | 1ddc6392b91a1279a5e3609149bceaea7abdd820 (diff) | |
download | gcc-db9f865b604b3d8b11148dbe115e90b75343f08c.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80888 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 7 | ||||
-rw-r--r-- | libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java | 18 | ||||
-rw-r--r-- | libjava/gnu/java/awt/peer/gtk/GtkToolkit.java | 8 |
3 files changed, 25 insertions, 8 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index a30122fc17e..7e4f4c15846 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +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. + 2004-04-20 Sascha Brawer <brawer@dandelis.ch> * java/awt/image/DataBufferShort.java, diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java index 1ab7bc13420..5de3301270d 100644 --- a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java +++ b/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java @@ -43,6 +43,7 @@ import java.awt.geom.*; 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 @@ public class GtkFontPeer extends ClasspathFontPeer { 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 @@ public class GtkFontPeer extends ClasspathFontPeer Xname = "-*-*-" + weight + "-" + slant + "-normal-*-*-" + size + "-*-*-" + spacing + "-*-*-*"; } + + this.Xname = Xname; } public String getXLFD () diff --git a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java index 1d961f2d5b7..ed1c567624b 100644 --- a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java +++ b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java @@ -377,12 +377,8 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit */ 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; } /** |