Ticket #21279: 21279.patch
| File 21279.patch, 1.5 KB (added by , 5 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/tagging/ac/AutoCompComboBox.java
104 104 @Override 105 105 public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) 106 106 throws BadLocationException { 107 int newLen = fb.getDocument().getLength() + string.length();107 int newLen = fb.getDocument().getLength() + ((string == null) ? 0 : string.length()); 108 108 if (maxTextLength == -1 || newLen <= maxTextLength || 109 109 // allow longer text while composing characters or it will be hard to compose 110 110 // the last characters before the limit … … 116 116 @Override 117 117 public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr) 118 118 throws BadLocationException { 119 int newLen = fb.getDocument().getLength() - length + string.length();119 int newLen = fb.getDocument().getLength() - length + ((string == null) ? 0 : string.length()); 120 120 if (maxTextLength == -1 || newLen <= maxTextLength || 121 121 // allow longer text while composing characters or it will be hard to compose 122 122 // the last characters before the limit
