Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2018-03-05 12:53:44 +0000
committerLakshmi Shanmugam2018-03-06 12:44:10 +0000
commit9624620580c30ac77b086b11e9c6249c4c47bd55 (patch)
tree233eb5980ab83d7fd8c3d6752a02c9400fbb88f3 /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt
parent2cd34c351190f5cbc2cc71fd53b9f5cb08acf091 (diff)
downloadeclipse.platform.swt-9624620580c30ac77b086b11e9c6249c4c47bd55.tar.gz
eclipse.platform.swt-9624620580c30ac77b086b11e9c6249c4c47bd55.tar.xz
eclipse.platform.swt-9624620580c30ac77b086b11e9c6249c4c47bd55.zip
Bug 532063: Replace calls to getAverageCharWidth() with
getAverageCharacterWidth() in SWT Replace calls to getAverageCharWidth() with getAverageCharacterWidth() in SWT code with int cast to fix compiler warnings. Change-Id: I9533bdd17af8569f1ea40ccbc54cd4fb0b91ebf4
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextDropTargetEffect.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java2
3 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java
index ebea72ac46..ff6bc59b5e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/ScrolledCompositeLayout.java
@@ -85,7 +85,7 @@ protected void layout(Composite composite, boolean flushCache) {
if (hBar != null) {
hBar.setMaximum (contentRect.width);
hBar.setThumb (Math.min (contentRect.width, hostRect.width));
- hBar.setIncrement (gc.getFontMetrics ().getAverageCharWidth ());
+ hBar.setIncrement ((int) gc.getFontMetrics ().getAverageCharacterWidth ());
hBar.setPageIncrement (hostRect.width);
int hPage = contentRect.width - hostRect.width;
int hSelection = hBar.getSelection ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextDropTargetEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextDropTargetEffect.java
index 79734d5d14..4be2dfd9ba 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextDropTargetEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextDropTargetEffect.java
@@ -163,7 +163,7 @@ public class StyledTextDropTargetEffect extends DropTargetEffect {
GC gc = new GC(text);
FontMetrics fm = gc.getFontMetrics();
gc.dispose();
- int charWidth = fm.getAverageCharWidth();
+ int charWidth = (int) fm.getAverageCharacterWidth();
int scrollAmount = 10*charWidth;
if (pt.x < area.x + 3*charWidth) {
int leftPixel = text.getHorizontalPixel();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java
index d8144511b3..2148155ecd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java
@@ -1312,7 +1312,7 @@ void setFont(Font font, int tabs) {
layout.dispose();
if (styledText != null) {
GC gc = new GC(styledText);
- averageCharWidth = gc.getFontMetrics().getAverageCharWidth();
+ averageCharWidth = (int) gc.getFontMetrics().getAverageCharacterWidth();
fixedPitch = gc.stringExtent("l").x == gc.stringExtent("W").x; //$NON-NLS-1$ //$NON-NLS-2$
gc.dispose();
}

Back to the top