summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Thondapu <arunkumar.thondapu@in.ibm.com>2012-09-12 23:51:00 +0530
committerArun Thondapu <arunkumar.thondapu@in.ibm.com>2012-09-12 23:51:00 +0530
commitfcedd75ab00195e6ab4eff556609d14004db3d8c (patch)
tree711ef1efea712e16bce8648975603f8ae947ae1b
parent21331182885d36e87fd7aa26872a15a6f6734271 (diff)
downloadeclipse.platform.swt-fcedd75ab00195e6ab4eff556609d14004db3d8c.tar.gz
eclipse.platform.swt-fcedd75ab00195e6ab4eff556609d14004db3d8c.tar.xz
eclipse.platform.swt-fcedd75ab00195e6ab4eff556609d14004db3d8c.zip
Bug 388369 Remove redundant else check in Label and helper function in
Theme
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java4
2 files changed, 7 insertions, 17 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java
index 569bd5b822..dddb83a991 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java
@@ -37,7 +37,11 @@ public Theme(Device device) {
progressHandle = OS.gtk_progress_bar_new();
toolbarHandle = OS.gtk_toolbar_new();
treeHandle = OS.gtk_tree_view_new_with_model(0);
- separatorHandle = gtk_separator_new (OS.GTK_ORIENTATION_VERTICAL);
+ if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ separatorHandle = OS.gtk_separator_new (OS.GTK_ORIENTATION_VERTICAL);
+ } else {
+ separatorHandle = OS.gtk_vseparator_new();
+ }
labelHandle = OS.gtk_label_new(null);
OS.gtk_container_add (fixedHandle, labelHandle);
OS.gtk_container_add (fixedHandle, frameHandle);
@@ -215,18 +219,4 @@ void transferClipping(GC gc, int /*long*/ style) {
OS.gdk_region_destroy(clipping);
}
}
-
-int /*long*/ gtk_separator_new (int orientation) {
- int /*long*/ separator = 0;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
- separator = OS.gtk_separator_new (orientation);
- } else {
- if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) {
- separator = OS.gtk_hseparator_new ();
- } else if (orientation == OS.GTK_ORIENTATION_VERTICAL) {
- separator = OS.gtk_vseparator_new ();
- }
- }
- return separator;
-}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
index 345295fae7..d7f8ab56ee 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
@@ -587,12 +587,12 @@ void showWidget () {
int /*long*/ gtk_separator_new (int orientation) {
int /*long*/ separator = 0;
- if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
separator = OS.gtk_separator_new (orientation);
} else {
if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) {
separator = OS.gtk_hseparator_new ();
- } else if (orientation == OS.GTK_ORIENTATION_VERTICAL) {
+ } else {
separator = OS.gtk_vseparator_new ();
}
}