[Libreoffice-commits] core.git: 2 commits - qadevOOo/tests vcl/unx

Caolán McNamara caolanm at redhat.com
Tue Mar 1 15:51:16 UTC 2016


 qadevOOo/tests/java/ifc/awt/_XWindow.java |   29 +++++------------------------
 vcl/unx/gtk/gtksalmenu.cxx                |    6 ++++++
 2 files changed, 11 insertions(+), 24 deletions(-)

New commits:
commit 9f61007bb01ac7f47fa164e4cb252a4338ee9bdc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 1 15:49:39 2016 +0000

    valgrind: fix g_variant leak
    
    Change-Id: I6d10c7d20f9bc1dfcaa60ad89a9092fe06922074

diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index d828a7c..5634922 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -825,13 +825,19 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
         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 );
+            pTarget = nullptr;
+        }
 
         g_free( aItemCommand );
     }
 
     if ( aCurrentCommand )
         g_free( aCurrentCommand );
+
+    if (pTarget)
+        g_variant_unref(pTarget);
 }
 
 GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean bGetSubmenu )
commit d45c60daf83003507ff6556e6fbc43ddc8abb673
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 1 12:03:09 2016 +0000

    coverity#1327140 UrF: Unread field
    
    Change-Id: Iab2d56eae3d068db7347a486e848a1bedb917034

diff --git a/qadevOOo/tests/java/ifc/awt/_XWindow.java b/qadevOOo/tests/java/ifc/awt/_XWindow.java
index 472a91d..10498bd 100644
--- a/qadevOOo/tests/java/ifc/awt/_XWindow.java
+++ b/qadevOOo/tests/java/ifc/awt/_XWindow.java
@@ -406,12 +406,10 @@ public class _XWindow extends MultiMethodTest {
     * removeKeyListener()
     */
     public static class TestKeyListener implements XKeyListener {
-        public boolean pressed = false;
-        public boolean released = false;
-        public void keyPressed(KeyEvent e) { pressed = true; }
-        public void keyReleased(KeyEvent e) { released = true; }
+        public void keyPressed(KeyEvent e) {}
+        public void keyReleased(KeyEvent e) {}
         public void disposing(EventObject e) {}
-        public void init() { pressed = false; released = false; }
+        public void init() {}
     }
 
     private final TestKeyListener kListener = new TestKeyListener();
@@ -445,34 +443,22 @@ public class _XWindow extends MultiMethodTest {
     * removeMouseListener()
     */
     public static class TestMouseListener implements XMouseListener {
-        public boolean pressed = false;
-        public boolean released = false;
-        public boolean entered = false;
-        public boolean exited = false;
 
         public void mousePressed(MouseEvent e) {
-            pressed = true;
         }
 
         public void mouseReleased(MouseEvent e) {
-            released = true;
         }
 
         public void mouseEntered(MouseEvent e) {
-            entered = true;
         }
 
         public void mouseExited(MouseEvent e) {
-            exited = true;
         }
 
         public void disposing(EventObject e) {}
 
         public void init() {
-            pressed = false;
-            released = false;
-            exited = false;
-            entered = false;
         }
 
     }
@@ -508,22 +494,17 @@ public class _XWindow extends MultiMethodTest {
     * removeMouseMotionListener()
     */
     public static class TestMouseMotionListener implements XMouseMotionListener {
-        public boolean dragged = false;
-        public boolean moved = false;
 
         public void mouseDragged(MouseEvent e) {
-            dragged = true;
         }
 
         public void mouseMoved(MouseEvent e) {
-            moved = true;
         }
 
-        public void disposing(EventObject e) {}
+        public void disposing(EventObject e) {
+        }
 
         public void init() {
-            dragged = false;
-            moved = false;
         }
 
     }


More information about the Libreoffice-commits mailing list