summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-05-10 22:54:56 -0400
committerDavid Ostrovsky <david@ostrovsky.org>2012-07-27 17:20:02 +0200
commit9b03b7b466603a9a001252c55aff9757de5090c6 (patch)
tree67988930fb0f9c15c91f4d2dd38b61b2eb9cf09c
parent68456747d780fbedc7c6b785132f1ba1e25d9f76 (diff)
gtk3: simplify code
Change-Id: Iad78f62bedb93c456830b2133b67e081ab035b5e
-rw-r--r--vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx43
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;