diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2012-05-10 22:54:56 -0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-07-27 14:39:42 +0100 |
commit | b2e5a674c41d892471636209ff39ffe3533f46e4 (patch) | |
tree | b441035b68a0f1f8775b3ad69f9c3b402e8abc1c /vcl | |
parent | 2f874b85b2374f9d609db44ba03210812c8fb405 (diff) |
gtk3: simplify code
Change-Id: Iad78f62bedb93c456830b2133b67e081ab035b5e
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index e5bd3d027d33..11bf0c8d17c5 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1013,29 +1013,22 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart Rectangle aEditRect = rControlRegion; gint indicator_size, point; - if( nPart == PART_ENTIRE_CONTROL) + if(((nType == CTRL_CHECKBOX) || (nType == CTRL_RADIOBUTTON)) && + nPart == PART_ENTIRE_CONTROL) { - switch(nType) - { - case CTRL_CHECKBOX: - case CTRL_RADIOBUTTON: - gtk_style_context_get_style( mpCheckButtonStyle, - "indicator-size", &indicator_size, - (char *)NULL ); + gtk_style_context_get_style( mpCheckButtonStyle, + "indicator-size", &indicator_size, + (char *)NULL ); - point = MAX(0, rControlRegion.GetHeight() - indicator_size); - aEditRect = Rectangle( Point( 0, point / 2), - Size( indicator_size, indicator_size ) ); - break; - default: - return sal_False; - } + point = MAX(0, rControlRegion.GetHeight() - indicator_size); + aEditRect = Rectangle( Point( 0, point / 2), + Size( indicator_size, indicator_size ) ); } - else if( (nPart == PART_MENU_ITEM_CHECK_MARK) || - (nPart == PART_MENU_ITEM_RADIO_MARK) ) { - switch (nType) + else if( nType == CTRL_MENU_POPUP) + { + if (((nPart == PART_MENU_ITEM_CHECK_MARK) || + (nPart == PART_MENU_ITEM_RADIO_MARK) )) { - case CTRL_MENU_POPUP: indicator_size = 0; gtk_style_context_get_style( mpMenuItemStyle, @@ -1046,12 +1039,8 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart aEditRect = Rectangle( Point( 0, point / 2), Size( indicator_size, indicator_size ) ); } - } - else if (nPart == PART_MENU_SEPARATOR) - { - switch (nType) + else if (nPart == PART_MENU_SEPARATOR) { - case CTRL_MENU_POPUP: gint separator_height, separator_width, wide_separators; gtk_style_context_get_style (mpMenuItemStyle, @@ -1063,12 +1052,8 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart aEditRect = Rectangle( aEditRect.TopLeft(), Size( aEditRect.GetWidth(), wide_separators ? separator_height : 1 ) ); } - } - else if (nPart == PART_MENU_SUBMENU_ARROW) - { - switch (nType) + else if (nPart == PART_MENU_SUBMENU_ARROW) { - case CTRL_MENU_POPUP: gfloat arrow_scaling, arrow_size; arrow_scaling = 0; |