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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 14 03:49:44 PST 2012


 vcl/inc/unx/gtk/gtksalmenu.hxx |    4 +++-
 vcl/unx/gtk/app/gtkinst.cxx    |   36 ++++++++++++------------------------
 2 files changed, 15 insertions(+), 25 deletions(-)

New commits:
commit 260586e47f70321d1738fd5c170b02da0bca5b06
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Wed Nov 14 11:49:08 2012 +0000

    cleanup gmenu conditionals, remove redundant casts.
    
    Change-Id: I51ee0f6c8671c914626cf4332408b4e2b4918b47

diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 05e1af9..03aa700 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -31,7 +31,9 @@
 #include <unx/gtk/gtkframe.hxx>
 
 #if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
-#  define ENABLE_GMENU_INTEGRATION
+#  ifdef GLIB_AVAILABLE_IN_2_32
+#    define ENABLE_GMENU_INTEGRATION
+#  endif
 #  include <unx/gtk/glomenu.h>
 #  include <unx/gtk/gloactiongroup.h>
 #else
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 38786f7..294fd1a 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -510,49 +510,37 @@ SalBitmap* GtkInstance::CreateSalBitmap()
 #endif
 }
 
-#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
+#ifdef ENABLE_GMENU_INTEGRATION
+
 SalMenu* GtkInstance::CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu )
 {
     GtkSalMenu* pSalMenu = new GtkSalMenu( bMenuBar );
     pSalMenu->SetMenu( pVCLMenu );
-
-    return static_cast<SalMenu*>( pSalMenu );
+    return pSalMenu;
 }
-#else
-SalMenu* GtkInstance::CreateMenu( sal_Bool, Menu* ) { return NULL; }
-#endif
 
-#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
 void GtkInstance::DestroyMenu( SalMenu* pMenu )
 {
-    (void)pMenu;
     delete pMenu;
-//    OSL_ENSURE( pMenu == 0, "DestroyMenu called with non-native menus" );
 }
-#else
-void GtkInstance::DestroyMenu( SalMenu* ) {}
-#endif
 
-#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
 SalMenuItem* GtkInstance::CreateMenuItem( const SalItemParams* pItemData )
 {
-    GtkSalMenuItem* pMenuItem = new GtkSalMenuItem( pItemData );
-
-    return static_cast<SalMenuItem*>( pMenuItem );
+    return new GtkSalMenuItem( pItemData );
 }
-#else
-SalMenuItem* GtkInstance::CreateMenuItem( const SalItemParams* ) { return NULL; }
-#endif
 
-#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
 void GtkInstance::DestroyMenuItem( SalMenuItem* pItem )
 {
-    (void)pItem;
     delete pItem;
-//    OSL_ENSURE( pItem == 0, "DestroyMenu called with non-native menus" );
 }
-#else
-void GtkInstance::DestroyMenuItem( SalMenuItem* ) {}
+
+#else // not ENABLE_GMENU_INTEGRATION
+
+SalMenu*     GtkInstance::CreateMenu( sal_Bool, Menu* )          { return NULL; }
+void         GtkInstance::DestroyMenu( SalMenu* )                {}
+SalMenuItem* GtkInstance::CreateMenuItem( const SalItemParams* ) { return NULL; }
+void         GtkInstance::DestroyMenuItem( SalMenuItem* )        {}
+
 #endif
 
 SalTimer* GtkInstance::CreateSalTimer()


More information about the Libreoffice-commits mailing list