summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-03-28 14:20:19 +0200
committerDavid Tardon <dtardon@redhat.com>2011-03-28 14:21:37 +0200
commit51a3b004bbed4a8ad5133faa1add6f80f61abd4e (patch)
tree3bfb7805c6edaf278c431527408f202bcb88cf09 /svtools
parentd6fc9301e6a12c29247586e07048d5008aaffbef (diff)
WaE: possible use of unitialized variable
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/toolpanel/paneltabbar.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index 37bbcf4678c2..ae4c7b4e3a3a 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 );
}
}