Changeset 4170 in josm


Ignore:
Timestamp:
Jun 25, 2011 11:25:43 PM (2 years ago)
Author:
stoecker
Message:

fix #6057 - single quotes in presets impossible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r4148 r4170  
    279279                if (text != null) { 
    280280                    if(text_context != null) { 
    281                         locale_text = trc(text_context, text); 
     281                        locale_text = trc(text_context, text.replaceAll("'","''")); 
    282282                    } else { 
    283                         locale_text = tr(text); 
     283                        locale_text = tr(text.replaceAll("'","''")); 
    284284                    } 
    285285                } 
     
    334334            if(locale_text == null) { 
    335335                if(text_context != null) { 
    336                     locale_text = trc(text_context, text); 
     336                    locale_text = trc(text_context, text.replaceAll("'","''")); 
    337337                } else { 
    338                     locale_text = tr(text); 
     338                    locale_text = tr(text.replaceAll("'","''")); 
    339339                } 
    340340            } 
     
    467467                PresetListEntry e = new PresetListEntry(value_array[i]); 
    468468                e.display_value = (locale_display_values == null) 
    469                 ? (values_context == null ? tr(display_array[i]) 
    470                         : trc(values_context, display_array[i])) : display_array[i]; 
     469                ? (values_context == null ? tr(display_array[i].replaceAll("'","''")) 
     470                        : trc(values_context, display_array[i].replaceAll("'","''"))) : display_array[i]; 
    471471                if (short_descriptions_array != null) { 
    472                     e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i]) 
    473                             : short_descriptions_array[i]; 
     472                    e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i].replaceAll("'","''")) 
     473                            : short_descriptions_array[i].replaceAll("'","''"); 
    474474                } 
    475475                lhm.put(value_array[i], e); 
     
    524524            if(locale_text == null) { 
    525525                if(text_context != null) { 
    526                     locale_text = trc(text_context, text); 
     526                    locale_text = trc(text_context, text.replaceAll("'","''")); 
    527527                } else { 
    528                     locale_text = tr(text); 
     528                    locale_text = tr(text.replaceAll("'","''")); 
    529529                } 
    530530            } 
     
    743743                PresetListEntry e = new PresetListEntry(value_array[i]); 
    744744                e.display_value = (locale_display_values == null) 
    745                 ? (values_context == null ? tr(display_array[i]) 
    746                         : trc(values_context, display_array[i])) : display_array[i]; 
     745                ? (values_context == null ? tr(display_array[i].replaceAll("'","''")) 
     746                        : trc(values_context, display_array[i].replaceAll("'","''"))) : display_array[i]; 
    747747                if (short_descriptions_array != null) { 
    748                     e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i]) 
     748                    e.short_description = locale_short_descriptions == null ? tr(short_descriptions_array[i].replaceAll("'","''")) 
    749749                            : short_descriptions_array[i]; 
    750750                } 
     
    772772            if (locale_text == null) { 
    773773                if(text_context != null) { 
    774                     locale_text = trc(text_context, text); 
     774                    locale_text = trc(text_context, text.replaceAll("'","''")); 
    775775                } else { 
    776                     locale_text = tr(text); 
     776                    locale_text = tr(text.replaceAll("'","''")); 
    777777                } 
    778778            } 
     
    914914            if(locale_text == null) { 
    915915                if(text_context != null) { 
    916                     locale_text = trc(text_context, text); 
     916                    locale_text = trc(text_context, text.replaceAll("'","''")); 
    917917                } else { 
    918                     locale_text = tr(text); 
     918                    locale_text = tr(text.replaceAll("'","''")); 
    919919                } 
    920920            } 
     
    937937                    locale_text = tr("More information about this feature"); 
    938938                } else if(text_context != null) { 
    939                     locale_text = trc(text_context, text); 
     939                    locale_text = trc(text_context, text.replaceAll("'","''")); 
    940940                } else { 
    941                     locale_text = tr(text); 
     941                    locale_text = tr(text.replaceAll("'","''")); 
    942942                } 
    943943            } 
     
    10021002                if (text != null) { 
    10031003                    if(text_context != null) { 
    1004                         locale_text = trc(text_context, text); 
     1004                        locale_text = trc(text_context, text.replaceAll("'","''")); 
    10051005                    } else { 
    1006                         locale_text = tr(text); 
     1006                        locale_text = tr(text.replaceAll("'","''")); 
    10071007                    } 
    10081008                } 
     
    11031103        if(locale_name == null) { 
    11041104            if(name_context != null) { 
    1105                 locale_name = trc(name_context, name); 
     1105                locale_name = trc(name_context, name.replaceAll("'","''")); 
    11061106            } else { 
    1107                 locale_name = tr(name); 
     1107                locale_name = tr(name.replaceAll("'","''")); 
    11081108            } 
    11091109        } 
Note: See TracChangeset for help on using the changeset viewer.