diff options
author | Dani Megert | 2013-09-06 14:48:39 +0000 |
---|---|---|
committer | Dani Megert | 2013-09-06 14:48:39 +0000 |
commit | f52fcfb7ad23781706e80efd2e74f064d36edf56 (patch) | |
tree | 8e65aeb593e6a4f230e21fa6d630d3a765afa218 | |
parent | ee6146d56273ea37a0626233aabf999048eb264a (diff) | |
download | eclipse.platform.text-f52fcfb7ad23781706e80efd2e74f064d36edf56.tar.gz eclipse.platform.text-f52fcfb7ad23781706e80efd2e74f064d36edf56.tar.xz eclipse.platform.text-f52fcfb7ad23781706e80efd2e74f064d36edf56.zip |
Fixed bug 416666: [JFace] IllegalArgumentException: Argument not valid while using large text with DefaultInformationControlI20131015-0800I20131009-0430I20131008-2330I20131001-0800I20130924-1130I20130924-0800I20130918-2000I20130918-0800I20130917-2000I20130917-0800I20130916-2330I20130916-2000I20130916-0900I20130915-2000I20130914-1900I20130914-1500I20130913-2000I20130912-2000I20130911-2000I20130910-2000I20130910-0800I20130909-2000I20130908-2000I20130906-2000
2 files changed, 28 insertions, 5 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLTextPresenter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLTextPresenter.java index 3216f8e2afe..cff9634b1ff 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLTextPresenter.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLTextPresenter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -124,7 +124,7 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation int maxNumberOfLines= Math.round(maxHeight / gc.getFontMetrics().getHeight()); fCounter= 0; - LineBreakingReader reader= new LineBreakingReader(createReader(hoverInfo, presentation), gc, maxWidth); + LineBreakingReader reader= new LineBreakingReader(createReader(hoverInfo, presentation), hoverInfo.length(), gc, maxWidth); boolean lastLineFormatted= false; String lastLineIndent= null; diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java index 480591cf73b..4bfebf2ac8c 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java @@ -36,13 +36,36 @@ public class LineBreakingReader { /** * Creates a reader that breaks an input text to fit in a given width. - * - * @param reader Reader of the input text + * + * @param reader reader for the input text * @param gc The graphic context that defines the currently used font sizes * @param maxLineWidth The max width (pixels) where the text has to fit in */ public LineBreakingReader(Reader reader, GC gc, int maxLineWidth) { - fReader= new BufferedReader(reader); + this(new BufferedReader(reader), gc, maxLineWidth); + } + + /** + * Creates a reader that breaks an input text to fit in a given width. + * + * @param reader the reader for the input text + * @param bufferSize the buffer size + * @param gc The graphic context that defines the currently used font sizes + * @param maxLineWidth The max width (pixels) where the text has to fit in + */ + public LineBreakingReader(Reader reader, int bufferSize, GC gc, int maxLineWidth) { + this(new BufferedReader(reader, bufferSize), gc, maxLineWidth); + } + + /** + * Creates a reader that breaks an input text to fit in a given width. + * + * @param reader the buffered reader for the input text + * @param gc The graphic context that defines the currently used font sizes + * @param maxLineWidth The max width (pixels) where the text has to fit in + */ + private LineBreakingReader(BufferedReader reader, GC gc, int maxLineWidth) { + fReader= reader; fGC= gc; fMaxWidth= maxLineWidth; fOffset= 0; |