[Libreoffice-commits] .: svtools/source

David Tardon dtardon at kemper.freedesktop.org
Mon Mar 28 05:21:47 PDT 2011


 svtools/source/toolpanel/paneltabbar.cxx |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit e3bcec0b263d524de08e3fa8a3fcd12fb71e448d
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Mar 28 14:20:19 2011 +0200

    WaE: possible use of unitialized variable

diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index d2b868a..12bae2a 100644
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -1098,16 +1098,21 @@ namespace svt
         ::boost::optional< size_t > aNewItem( m_pImpl->FindItemForPoint( i_rMouseEvent.GetPosPixel() ) );
 
         if  ( i_rMouseEvent.IsLeaveWindow() )
-            aNewItem.reset();
-
-        if ( aOldItem != aNewItem )
+            aNewItem = ::boost::optional< size_t >();
+
+        bool const bChanged(
+                ( !aOldItem && aNewItem )
+                || ( aOldItem && !aNewItem )
+                || ( aOldItem && aNewItem && aOldItem != aNewItem ) )
+            ;
+        if ( bChanged )
         {
-            if ( !!aOldItem )
+            if ( aOldItem )
                 m_pImpl->InvalidateItem( *aOldItem );
 
             m_pImpl->m_aHoveredItem = aNewItem;
 
-            if ( !!aNewItem )
+            if ( aNewItem )
                 m_pImpl->InvalidateItem( *aNewItem );
         }
     }


More information about the Libreoffice-commits mailing list