[Libreoffice-commits] .: Branch 'feature/unitymenus-master' - vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 14 02:59:29 PST 2012


 vcl/unx/gtk/window/gloactiongroup.cxx |    6 +++---
 vcl/unx/gtk/window/gtksalmenu.cxx     |   10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 58cf8f5b192a922b6853d98f638bbb0b4b934113
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Wed Nov 14 10:58:40 2012 +0000

    gbooleans are true if non-zero, bin == TRUE comparisons.
    
    Change-Id: Ieb6c73993b3ef3854d81fdeb81661d75f1fe954f

diff --git a/vcl/unx/gtk/window/gloactiongroup.cxx b/vcl/unx/gtk/window/gloactiongroup.cxx
index 756779a..ac16865 100644
--- a/vcl/unx/gtk/window/gloactiongroup.cxx
+++ b/vcl/unx/gtk/window/gloactiongroup.cxx
@@ -192,7 +192,7 @@ g_lo_action_group_perform_submenu_action (GLOActionGroup *group,
     if (pSalMenu != NULL) {
         gboolean bState = g_variant_get_boolean (state);
 
-        if (bState == TRUE)
+        if (bState)
             pSalMenu->Activate (action_name);
         else
             pSalMenu->Deactivate (action_name);
@@ -215,7 +215,7 @@ g_lo_action_group_change_state (GActionGroup *group,
 
         if (action != NULL)
         {
-            if (action->submenu == TRUE)
+            if (action->submenu)
                 g_lo_action_group_perform_submenu_action (lo_group, action_name, value);
             else
             {
@@ -229,7 +229,7 @@ g_lo_action_group_change_state (GActionGroup *group,
                     is_new = TRUE;
                 }
 
-                if (g_variant_is_of_type (value, action->state_type) == TRUE)
+                if (g_variant_is_of_type (value, action->state_type))
                 {
                     if (action->state)
                         g_variant_unref(action->state);
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 7c1517e..fa4f228 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -533,11 +533,11 @@ void GtkSalMenu::NativeCheckItem( unsigned nSection, unsigned nItemPos, MenuItem
         GVariant *pCurrentState = g_action_group_get_action_state( mpActionGroup, aCommand );
 
         if ( bits & MIB_RADIOCHECK )
-            pCheckValue = ( bCheck == TRUE ) ? g_variant_new_string( aCommand ) : g_variant_new_string( "" );
+            pCheckValue = bCheck ? g_variant_new_string( aCommand ) : g_variant_new_string( "" );
         else
         {
             // By default, all checked items are checkmark buttons.
-            if ( bCheck == TRUE || ( ( bCheck == FALSE ) && pCurrentState != NULL ) )
+            if ( bCheck || ( !bCheck && pCurrentState != NULL ) )
                 pCheckValue = g_variant_new_boolean( bCheck );
         }
 
@@ -614,7 +614,7 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
     GVariant *pTarget = NULL;
 
     if ( g_action_group_has_action( mpActionGroup, aCommand ) == FALSE ) {
-        if ( ( nBits & MIB_CHECKABLE ) || ( bIsSubmenu == TRUE ) )
+        if ( ( nBits & MIB_CHECKABLE ) || bIsSubmenu )
         {
             // Item is a checkmark button.
             GVariantType* pStateType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_BOOLEAN );
@@ -650,7 +650,7 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
 
         gchar* aItemCommand = g_strconcat("win.", aCommand, NULL );
 
-        if ( bIsSubmenu == TRUE )
+        if ( bIsSubmenu )
             g_lo_menu_set_submenu_action_to_item_in_section( pMenu, nSection, nItemPos, aItemCommand );
         else
             g_lo_menu_set_action_and_target_value_to_item_in_section( pMenu, nSection, nItemPos, aItemCommand, pTarget );
@@ -676,7 +676,7 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean bGetSub
 
         if ( g_strcmp0( aItemCommandStr, aCommand ) == 0 )
         {
-            pMenu = ( bGetSubmenu == TRUE ) ? pSalItem->mpSubMenu : this;
+            pMenu = bGetSubmenu ? pSalItem->mpSubMenu : this;
             break;
         }
         else


More information about the Libreoffice-commits mailing list