Bug 483937 - use new JFaceTextUtil.computeLineHeight() in DiffPainter

For client interested in *full real* text line height (including all
wrapped line segments) replaced call to StyledText.getLineHeight(int)
with new JFaceTextUtil.computeLineHeight() API.

Change-Id: I7df34cb98f00051367fd6b4680d1ead3499f5549
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java
index a615bba..53c82fe 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2015 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 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
@@ -17,7 +17,6 @@
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
@@ -222,20 +221,8 @@
 
 		if (info != null) {
 			int y= fWidget.getLinePixel(widgetLine);
-			boolean isWrapActive= fWidget.getWordWrap();
-			int lineHeight;
-			int offset= fWidget.getOffsetAtLine(widgetLine);
-			if (!isWrapActive) {
-				lineHeight= fWidget.getLineHeight(offset);
-			} else {
-				int offsetEnd= offset + fWidget.getLine(widgetLine).length();
-				if (offsetEnd == fWidget.getCharCount()) {
-					lineHeight= fWidget.getLineHeight(offset);
-				} else {
-					Rectangle textBounds= fWidget.getTextBounds(offset, offsetEnd);
-					lineHeight= textBounds.height;
-				}
-			}
+			int lineHeight = JFaceTextUtil.computeLineHeight(fWidget, widgetLine);
+
 			// draw background color if special
 			if (hasSpecialColor(info)) {
 				gc.setBackground(getColor(info));