summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-09-01 21:56:16 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-09-01 21:56:16 +0200
commitca707070e754a6fafba5ae75f36db4f7430efe1b (patch)
tree3a5627f8bfe85f34484fe2b8c287b67bf36db6cf
parent607d1b720a296580e476e9b3a601445c2a6c9fcf (diff)
dba33i: #i112694# care for mouse handlers which tamper with the tree: survive this
-rw-r--r--svx/source/dialog/checklbx.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index 06730c4bf6..2e070cacdd 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -212,7 +212,7 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( rMEvt.IsLeft() )
{
- Point aPnt = rMEvt.GetPosPixel();
+ const Point aPnt = rMEvt.GetPosPixel();
SvLBoxEntry* pEntry = GetEntry( aPnt );
if ( pEntry )
@@ -230,6 +230,13 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt )
{
ToggleCheckButton( pEntry );
SvTreeListBox::MouseButtonDown( rMEvt );
+
+ // check if the entry below the mouse changed during the base method call. This is possible if,
+ // for instance, a handler invoked by the base class tampers with the list entries.
+ const SvLBoxEntry* pNewEntry = GetEntry( aPnt );
+ if ( pNewEntry != pEntry )
+ return;
+
if ( bCheck != ( GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED ) )
CheckButtonHdl();
return;