Skip to content

Commit b278afe

Browse files
committed
[Gtk] Remove GC.stringExtentInPixel
It simply calls textExtentInPixel(Sting, 0) thus inline it in the 2 places used.
1 parent 7d0ec2a commit b278afe

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,7 @@ int fixMnemonic (char [] buffer) {
18711871
public int getAdvanceWidth(char ch) {
18721872
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
18731873
//BOGUS
1874-
return stringExtentInPixels(new String(new char[]{ch})).x;
1874+
return textExtentInPixels(new String(new char[]{ch}), 0).x;
18751875
}
18761876

18771877
/**
@@ -2002,7 +2002,7 @@ public Pattern getBackgroundPattern() {
20022002
public int getCharWidth(char ch) {
20032003
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
20042004
//BOGUS
2005-
return stringExtentInPixels(new String(new char[]{ch})).x;
2005+
return textExtentInPixels(new String(new char[]{ch}), 0).x;
20062006
}
20072007

20082008
/**
@@ -3789,9 +3789,6 @@ public Point stringExtent(String string) {
37893789
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
37903790
return textExtentInPixels(string, 0);
37913791
}
3792-
Point stringExtentInPixels(String string) {
3793-
return textExtentInPixels(string, 0);
3794-
}
37953792

37963793
/**
37973794
* Returns the extent of the given string. Tab expansion and

0 commit comments

Comments
 (0)