summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Trimble2013-04-19 19:55:02 (EDT)
committerIan Trimble2013-04-19 19:55:02 (EDT)
commit445b6f4c3f59e5e0ea64c50b8dd87f617a693b3f (patch)
treecff7d8cd6cf807bd915ae5a686a9d9a470c1b367
parent013b89b7db9438b76af7cd19e8495e50b6be34ed (diff)
downloadwebtools.jsf-445b6f4c3f59e5e0ea64c50b8dd87f617a693b3f.zip
webtools.jsf-445b6f4c3f59e5e0ea64c50b8dd87f617a693b3f.tar.gz
webtools.jsf-445b6f4c3f59e5e0ea64c50b8dd87f617a693b3f.tar.bz2
Bug 396969
Error shows in Web HTML editior of Basic app when set the width of text area to 21px
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextAreaWidgetProvider.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextAreaWidgetProvider.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextAreaWidgetProvider.java
index 77aea65..495465c 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextAreaWidgetProvider.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/widget/TextAreaWidgetProvider.java
@@ -181,8 +181,9 @@ public class TextAreaWidgetProvider extends AbstractWidgetProvider {
}
private int getTextCount(int begin, int end, Font swtFont, int textWidth) {
- while (FigureUtilities.getTextWidth(_value.substring(begin, end),
- swtFont) > textWidth) {
+ while (begin > -1 && end > begin &&
+ FigureUtilities.getTextWidth(
+ _value.substring(begin, end), swtFont) > textWidth) {
end--;
}
return end;