Skip to content

Commit 1a6e82c

Browse files
committed
[Gtk] Remove Control.setLocationInPixels methods
Useless methods that simply duplicate the public ones and create noise in the implementation.
1 parent 94ea672 commit 1a6e82c

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b
452452
Rectangle rect = child.getBoundsInPixels ();
453453
if (Math.min(x + width, rect.x + rect.width) >= Math.max (x, rect.x) &&
454454
Math.min(y + height, rect.y + rect.height) >= Math.max (y, rect.y)) {
455-
child.setLocationInPixels (rect.x + deltaX, rect.y + deltaY);
455+
child.setLocation (rect.x + deltaX, rect.y + deltaY);
456456
}
457457
}
458458
}

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,12 +1267,6 @@ public void setLocation (Point location) {
12671267
setBounds (location.x, location.y, 0, 0, true, false);
12681268
}
12691269

1270-
void setLocationInPixels (Point location) {
1271-
checkWidget ();
1272-
if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
1273-
setBounds (location.x, location.y, 0, 0, true, false);
1274-
}
1275-
12761270
/**
12771271
* Sets the receiver's location to the point specified by the arguments which
12781272
* are relative to the receiver's parent (or its display if its parent is null),
@@ -1292,12 +1286,6 @@ void setLocationInPixels (Point location) {
12921286
* </ul>
12931287
*/
12941288
public void setLocation(int x, int y) {
1295-
checkWidget();
1296-
Point loc = new Point (x, y);
1297-
setBounds (loc.x, loc.y, 0, 0, true, false);
1298-
}
1299-
1300-
void setLocationInPixels(int x, int y) {
13011289
checkWidget();
13021290
setBounds (x, y, 0, 0, true, false);
13031291
}

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ void center () {
669669
} else {
670670
y = Math.max (y, monitorRect.y);
671671
}
672-
setLocationInPixels (x, y);
672+
setLocation (x, y);
673673
}
674674

675675
@Override
@@ -1275,7 +1275,7 @@ Point getLocationInPixels () {
12751275
// Bug in GTK: when shell is moved and then hidden, its location does not get updated.
12761276
// Move it before getting its location.
12771277
if (!getVisible() && moved) {
1278-
setLocationInPixels(oldX, oldY);
1278+
setLocation(oldX, oldY);
12791279
}
12801280
int [] x = new int [1], y = new int [1];
12811281
if (GTK.GTK4) {
@@ -2924,7 +2924,7 @@ public void setVisible (boolean visible) {
29242924
checkWidget();
29252925

29262926
if (moved) { //fix shell location if it was moved.
2927-
setLocationInPixels(oldX, oldY);
2927+
setLocation(oldX, oldY);
29282928
}
29292929
int mask = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL;
29302930
if ((style & mask) != 0) {

0 commit comments

Comments
 (0)