summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/tplcitem.cxx
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2001-09-07 12:17:20 +0000
committerOliver Specht <os@openoffice.org>2001-09-07 12:17:20 +0000
commitaeb690b54b01af24742a6be96e49c17c744772e5 (patch)
tree36271e07f1dd523b7a792a672a9fd72a34f5a864 /sfx2/source/dialog/tplcitem.cxx
parent16422147367d26d83f43bf1d8cf83edbff5c45f9 (diff)
#91966# posted user events have to be removed in the D'tor if not already processed
Diffstat (limited to 'sfx2/source/dialog/tplcitem.cxx')
-rw-r--r--sfx2/source/dialog/tplcitem.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx
index e6f4e299428a..d634a54cf75b 100644
--- a/sfx2/source/dialog/tplcitem.cxx
+++ b/sfx2/source/dialog/tplcitem.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tplcitem.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: os $ $Date: 2001-09-05 09:41:34 $
+ * last change: $Author: os $ $Date: 2001-09-07 13:17:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -84,9 +84,16 @@ SfxTemplateControllerItem::SfxTemplateControllerItem(
SfxBindings &rBindings):
SfxControllerItem(nId, rBindings),
rTemplateDlg(rDlg),
- nWaterCanState(0xff)
+ nWaterCanState(0xff),
+ nUserEventId(0)
{
}
+// -----------------------------------------------------------------------
+SfxTemplateControllerItem::~SfxTemplateControllerItem()
+{
+ if(nUserEventId)
+ Application::RemoveUserEvent(nUserEventId);
+}
// -----------------------------------------------------------------------
@@ -143,7 +150,7 @@ void SfxTemplateControllerItem::StateChanged( USHORT nSID, SfxItemState eState,
DBG_ASSERT(pStateItem != 0, "BoolItem erwartet");
nWaterCanState = pStateItem->GetValue() ? 1 : 0;
}
- Application::PostUserEvent( STATIC_LINK(
+ nUserEventId = Application::PostUserEvent( STATIC_LINK(
this, SfxTemplateControllerItem, SetWaterCanStateHdl_Impl ) );
break;
}
@@ -192,6 +199,7 @@ void SfxTemplateControllerItem::StateChanged( USHORT nSID, SfxItemState eState,
IMPL_STATIC_LINK(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl,
SfxTemplateControllerItem*, EMPTYARG)
{
+ pThis->nUserEventId = 0;
SfxBoolItem* pState = 0;
switch(pThis->nWaterCanState)
{