[Libreoffice-commits] .: 2 commits - vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Oct 21 03:29:39 PDT 2012


 vcl/unx/gtk/app/gtksys.cxx               |    3 +--
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |    6 ++----
 vcl/unx/gtk/window/gtkframe.cxx          |    6 ++----
 3 files changed, 5 insertions(+), 10 deletions(-)

New commits:
commit ba99a88511e5b0b5140837fde69dfa139d7aeb7a
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Oct 20 20:37:46 2012 +0200

    Some cppcheck cleaning
    
    Change-Id: I5c119795077f9fbb84c32bc6ca95533d689998b9

diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index cc921b8..5342130 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -118,9 +118,8 @@ SalX11Screen
 GtkSalSystem::getXScreenFromDisplayScreen(unsigned int nScreen)
 {
     gint nMonitor;
-    GdkScreen *pScreen = NULL;
 
-    pScreen = getScreenMonitorFromIdx (nScreen, nMonitor);
+    GdkScreen *pScreen = getScreenMonitorFromIdx (nScreen, nMonitor);
     if (!pScreen)
         return SalX11Screen (0);
 #if GTK_CHECK_VERSION(3,0,0)
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 4985c43..5870070 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -2846,7 +2846,6 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
     GtkShadowType    shadowType;
     gint            x, y, w, h;
     gint            g_x=0, g_y=0, g_w=10, g_h=10;
-    bool            bPaintButton = true;
     GtkWidget*      pButtonWidget = gWidgetData[m_nXScreen].gToolbarButtonWidget;
     GdkRectangle    clipRect;
 
@@ -2898,7 +2897,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
     // handle button
     else if( nPart == PART_BUTTON )
     {
-        bPaintButton = (nState & CTRL_STATE_PRESSED)
+        bool bPaintButton = (nState & CTRL_STATE_PRESSED)
             || (nState & CTRL_STATE_ROLLOVER);
         if( aValue.getTristateVal() == BUTTONVALUE_ON )
         {
commit 0a2eb9cfd667c1f3186cdeb9f7375aad81c66c0e
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Oct 20 20:25:57 2012 +0200

    Fix some Variable "X" is reassigned a value before the old one has been used
    
    Change-Id: I2fbdf26441f64183676035692391e65db0efe069

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 8c603ed..4985c43 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -4025,13 +4025,12 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
 
     aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_LARGE );
 
-    const cairo_font_options_t* pNewOptions = NULL;
 #if !GTK_CHECK_VERSION(2,9,0)
     static cairo_font_options_t* (*gdk_screen_get_font_options)(GdkScreen*) =
         (cairo_font_options_t*(*)(GdkScreen*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_font_options" );
     if( gdk_screen_get_font_options != NULL )
 #endif
-        pNewOptions = gdk_screen_get_font_options( pScreen );
+        const cairo_font_options_t* pNewOptions = gdk_screen_get_font_options( pScreen );
     aStyleSet.SetCairoFontOptions( pNewOptions );
 
     // finally update the collected settings
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index d749b6d..1d65ffb 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1853,8 +1853,7 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, int eType, Rectangle *pSiz
         return;
 
     gint nMonitor;
-    GdkScreen *pScreen = NULL;
-    pScreen = getDisplay()->getSystem()->getScreenMonitorFromIdx( nNewScreen, nMonitor );
+    GdkScreen *pScreen = getDisplay()->getSystem()->getScreenMonitorFromIdx( nNewScreen, nMonitor );
 
     // Heavy lifting, need to move screen ...
     if( pScreen != gtk_widget_get_screen( m_pWindow ))
@@ -2047,10 +2046,9 @@ dbus_inhibit_gsm (const gchar *appname,
         guint            cookie;
         GError          *error = NULL;
         DBusGProxy      *proxy = NULL;
-        DBusGConnection *session_connection = NULL;
 
         /* get the DBUS session connection */
-        session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+        DBusGConnection *session_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
         if (error != NULL) {
                 g_debug ("DBUS cannot connect : %s", error->message);
                 g_error_free (error);


More information about the Libreoffice-commits mailing list