Index: /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 4181)
+++ /trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 4182)
@@ -279,7 +279,7 @@
                 if (text != null) {
                     if(text_context != null) {
-                        locale_text = trc(text_context, text.replaceAll("'","''"));
+                        locale_text = trc(text_context, fixPresetString(text));
                     } else {
-                        locale_text = tr(text.replaceAll("'","''"));
+                        locale_text = tr(fixPresetString(text));
                     }
                 }
@@ -334,7 +334,7 @@
             if(locale_text == null) {
                 if(text_context != null) {
-                    locale_text = trc(text_context, text.replaceAll("'","''"));
+                    locale_text = trc(text_context, fixPresetString(text));
                 } else {
-                    locale_text = tr(text.replaceAll("'","''"));
+                    locale_text = tr(fixPresetString(text));
                 }
             }
@@ -467,9 +467,9 @@
                 PresetListEntry e = new PresetListEntry(value_array[i]);
                 e.display_value = (locale_display_values == null)
-                ? (values_context == null ? tr(display_array[i].replaceAll("'","''"))
-                        : trc(values_context, display_array[i].replaceAll("'","''"))) : display_array[i];
+                ? (values_context == null ? tr(fixPresetString(display_array[i]))
+                        : trc(values_context, fixPresetString(display_array[i]))) : display_array[i];
                 if (short_descriptions_array != null) {
-                    e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i].replaceAll("'","''"))
-                            : short_descriptions_array[i].replaceAll("'","''");
+                    e.short_description = locale_short_descriptions == null ? tr(fixPresetString(short_descriptions_array[i]))
+                            : fixPresetString(short_descriptions_array[i]);
                 }
                 lhm.put(value_array[i], e);
@@ -524,7 +524,7 @@
             if(locale_text == null) {
                 if(text_context != null) {
-                    locale_text = trc(text_context, text.replaceAll("'","''"));
+                    locale_text = trc(text_context, fixPresetString(text));
                 } else {
-                    locale_text = tr(text.replaceAll("'","''"));
+                    locale_text = tr(fixPresetString(text));
                 }
             }
@@ -743,8 +743,8 @@
                 PresetListEntry e = new PresetListEntry(value_array[i]);
                 e.display_value = (locale_display_values == null)
-                ? (values_context == null ? tr(display_array[i].replaceAll("'","''"))
-                        : trc(values_context, display_array[i].replaceAll("'","''"))) : display_array[i];
+                ? (values_context == null ? tr(fixPresetString(display_array[i]))
+                        : trc(values_context, fixPresetString(display_array[i]))) : display_array[i];
                 if (short_descriptions_array != null) {
-                    e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i].replaceAll("'","''"))
+                    e.short_description = locale_short_descriptions == null ? tr(fixPresetString(short_descriptions_array[i]))
                             : short_descriptions_array[i];
                 }
@@ -772,7 +772,7 @@
             if (locale_text == null) {
                 if(text_context != null) {
-                    locale_text = trc(text_context, text.replaceAll("'","''"));
+                    locale_text = trc(text_context, fixPresetString(text));
                 } else {
-                    locale_text = tr(text.replaceAll("'","''"));
+                    locale_text = tr(fixPresetString(text));
                 }
             }
@@ -914,7 +914,7 @@
             if(locale_text == null) {
                 if(text_context != null) {
-                    locale_text = trc(text_context, text.replaceAll("'","''"));
+                    locale_text = trc(text_context, fixPresetString(text));
                 } else {
-                    locale_text = tr(text.replaceAll("'","''"));
+                    locale_text = tr(fixPresetString(text));
                 }
             }
@@ -937,7 +937,7 @@
                     locale_text = tr("More information about this feature");
                 } else if(text_context != null) {
-                    locale_text = trc(text_context, text.replaceAll("'","''"));
+                    locale_text = trc(text_context, fixPresetString(text));
                 } else {
-                    locale_text = tr(text.replaceAll("'","''"));
+                    locale_text = tr(fixPresetString(text));
                 }
             }
@@ -1002,7 +1002,7 @@
                 if (text != null) {
                     if(text_context != null) {
-                        locale_text = trc(text_context, text.replaceAll("'","''"));
+                        locale_text = trc(text_context, fixPresetString(text));
                     } else {
-                        locale_text = tr(text.replaceAll("'","''"));
+                        locale_text = tr(fixPresetString(text));
                     }
                 }
@@ -1103,7 +1103,7 @@
         if(locale_name == null) {
             if(name_context != null) {
-                locale_name = trc(name_context, name.replaceAll("'","''"));
+                locale_name = trc(name_context, fixPresetString(name));
             } else {
-                locale_name = tr(name.replaceAll("'","''"));
+                locale_name = tr(fixPresetString(name));
             }
         }
@@ -1486,4 +1486,8 @@
     }
 
+    private static String fixPresetString(String s) {
+        return s == null ? s : s.replaceAll("'","''");
+    }
+
     public static Command createCommand(Collection<OsmPrimitive> sel, List<Tag> changedTags) {
         List<Command> cmds = new ArrayList<Command>();
