changeset 5163:2441235395a4

RT-27199: HTML Editor, in ja and ko locales, can't open "Font Size" menu. Reviewed-by: mickf
author leifs
date Fri, 20 Sep 2013 09:33:24 -0700
parents 8db542421315
children 047354976850
files modules/web/src/main/java/com/sun/javafx/scene/web/skin/HTMLEditorSkin.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/web/src/main/java/com/sun/javafx/scene/web/skin/HTMLEditorSkin.java	Thu Sep 19 09:42:26 2013 -0700
+++ b/modules/web/src/main/java/com/sun/javafx/scene/web/skin/HTMLEditorSkin.java	Fri Sep 20 09:33:24 2013 -0700
@@ -696,7 +696,9 @@
                         super.updateItem(item, empty);
                         if (item != null) {
                             setText(item);
-                            setFont(new Font((String)fontFamilyComboBox.getValue(), Double.valueOf(item.substring(0, item.indexOf(" ")))));
+                            // Remove trailing non-digits to get the size (don't assume there's a space).
+                            String size = item.replaceFirst("[^0-9.]*$", "");
+                            setFont(new Font((String)fontFamilyComboBox.getValue(), Double.valueOf(size)));
                         }
                     }
                 };