Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 268402 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ui/forms/widgets/FormText.java (-9 / +8 lines)
Lines 1596-1617 Link Here
1596
1596
1597
	private void paintFocusTransfer(IHyperlinkSegment oldLink,
1597
	private void paintFocusTransfer(IHyperlinkSegment oldLink,
1598
			IHyperlinkSegment newLink) {
1598
			IHyperlinkSegment newLink) {
1599
		GC gc = new GC(this);
1600
		Color bg = getBackground();
1601
		Color fg = getForeground();
1602
		gc.setFont(getFont());
1603
		if (oldLink != null) {
1599
		if (oldLink != null) {
1604
			gc.setBackground(bg);
1600
			Rectangle r = oldLink.getBounds();
1605
			gc.setForeground(fg);
1601
			redraw(r.x, r.y, r.width, r.height, true);
1606
			oldLink.paintFocus(gc, bg, fg, false, null);
1602
			update();
1607
		}
1603
		}
1608
		if (newLink != null) {
1604
		if (newLink != null) {
1609
			// ensureVisible(newLink);
1605
			GC gc = new GC(this);
1606
			Color bg = getBackground();
1607
			Color fg = getForeground();
1608
			gc.setFont(getFont());
1610
			gc.setBackground(bg);
1609
			gc.setBackground(bg);
1611
			gc.setForeground(fg);
1610
			gc.setForeground(fg);
1612
			newLink.paintFocus(gc, bg, fg, true, null);
1611
			newLink.paintFocus(gc, bg, fg, true, null);
1612
			gc.dispose();
1613
		}
1613
		}
1614
		gc.dispose();
1615
	}
1614
	}
1616
1615
1617
	private void ensureVisible(IFocusSelectable segment) {
1616
	private void ensureVisible(IFocusSelectable segment) {
(-)src/org/eclipse/ui/internal/forms/widgets/AggregateHyperlinkSegment.java (-8 / +7 lines)
Lines 117-132 Link Here
117
	 * @see org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment#getBounds()
117
	 * @see org.eclipse.ui.internal.forms.widgets.IHyperlinkSegment#getBounds()
118
	 */
118
	 */
119
	public Rectangle getBounds() {
119
	public Rectangle getBounds() {
120
		Rectangle bounds = new Rectangle(Integer.MAX_VALUE, Integer.MAX_VALUE,
120
		if (segments.size() == 0)
121
				0, 0);
121
			return new Rectangle(Integer.MAX_VALUE, Integer.MAX_VALUE, 0, 0);
122
		// TODO this is wrong
122
			
123
		for (int i = 0; i < segments.size(); i++) {
123
		IHyperlinkSegment segment0 = (IHyperlinkSegment) segments.get(0);
124
		Rectangle bounds = segment0.getBounds();
125
		for (int i = 1; i < segments.size(); i++) {
124
			IHyperlinkSegment segment = (IHyperlinkSegment) segments.get(i);
126
			IHyperlinkSegment segment = (IHyperlinkSegment) segments.get(i);
125
			Rectangle sbounds = segment.getBounds();
127
			Rectangle sbounds = segment.getBounds();
126
			bounds.x = Math.min(bounds.x, sbounds.x);
128
			bounds.add(sbounds);
127
			bounds.y = Math.min(bounds.y, sbounds.y);
128
			bounds.width = Math.max(bounds.width, sbounds.width);
129
			bounds.height = Math.max(bounds.height, sbounds.height);
130
		}
129
		}
131
		return bounds;
130
		return bounds;
132
	}
131
	}
(-)src/org/eclipse/ui/internal/forms/widgets/TextSegment.java (-12 / +9 lines)
Lines 15-20 Link Here
15
import java.util.Hashtable;
15
import java.util.Hashtable;
16
import java.util.Vector;
16
import java.util.Vector;
17
17
18
import org.eclipse.jface.util.Geometry;
18
import org.eclipse.swt.SWT;
19
import org.eclipse.swt.SWT;
19
import org.eclipse.swt.graphics.Color;
20
import org.eclipse.swt.graphics.Color;
20
import org.eclipse.swt.graphics.Font;
21
import org.eclipse.swt.graphics.Font;
Lines 206-225 Link Here
206
	}
207
	}
207
208
208
	public Rectangle getBounds() {
209
	public Rectangle getBounds() {
209
		int x = 0, y = 0;
210
		if (areaRectangles.size() == 0)
210
		int width = 0, height = 0;
211
			return new Rectangle(0, 0, 0, 0);
211
212
		
212
		for (int i = 0; i < areaRectangles.size(); i++) {
213
		AreaRectangle ar0 = (AreaRectangle) areaRectangles.get(0);
214
		Rectangle bounds = Geometry.copy(ar0.rect);
215
		for (int i = 1; i < areaRectangles.size(); i++) {
213
			AreaRectangle ar = (AreaRectangle) areaRectangles.get(i);
216
			AreaRectangle ar = (AreaRectangle) areaRectangles.get(i);
214
			if (i == 0) {
217
			bounds.add(ar.rect);
215
				x = ar.rect.x;
216
				y = ar.rect.y;
217
			} else
218
				x = Math.min(ar.rect.x, x);
219
			width = Math.max(ar.rect.width, width);
220
			height += ar.rect.height;
221
		}
218
		}
222
		return new Rectangle(x, y, width, height);
219
		return bounds;
223
	}
220
	}
224
221
225
	public boolean advanceLocator(GC gc, int wHint, Locator locator,
222
	public boolean advanceLocator(GC gc, int wHint, Locator locator,

Return to bug 268402