summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-12 12:22:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-12 13:03:58 +0000
commita0bae848d42b675e4638420d632d710ed3cf76c3 (patch)
tree5f99f1c45e7f10735e5cdd5ef15a2cbc84e85e93 /svtools
parent401a8cecee5861d37bd91239200dd49719a0cac4 (diff)
coverity#736486 try and make coverity see through this better
Change-Id: I53d858cad02ae2c8f36de926b380d3a50810e141
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/itemdel.cxx22
1 files changed, 13 insertions, 9 deletions
diff --git a/svtools/source/misc/itemdel.cxx b/svtools/source/misc/itemdel.cxx
index ad5624083c3e..d6f7d65e4e63 100644
--- a/svtools/source/misc/itemdel.cxx
+++ b/svtools/source/misc/itemdel.cxx
@@ -38,12 +38,13 @@ class SfxItemDesruptor_Impl
Link aLink;
private:
- DECL_LINK( Delete, void * );
- SfxItemDesruptor_Impl( const SfxItemDesruptor_Impl& ); // n.i.
+ DECL_LINK( Delete, SfxItemDesruptor_Impl * );
+ SfxItemDesruptor_Impl( const SfxItemDesruptor_Impl& ); // n.i.
public:
- SfxItemDesruptor_Impl( SfxPoolItem *pItemToDesrupt );
- ~SfxItemDesruptor_Impl();
+ SfxItemDesruptor_Impl( SfxPoolItem *pItemToDesrupt );
+ void LaunchDeleteOnIdle();
+ ~SfxItemDesruptor_Impl();
};
// ------------------------------------------------------------------------
@@ -55,7 +56,10 @@ SfxItemDesruptor_Impl::SfxItemDesruptor_Impl( SfxPoolItem *pItemToDesrupt ):
DBG_ASSERT( 0 == pItem->GetRefCount(), "disrupting pooled item" );
pItem->SetKind( SFX_ITEMS_DELETEONIDLE );
+}
+void SfxItemDesruptor_Impl::LaunchDeleteOnIdle()
+{
// process in Idle
GetpApp()->InsertIdleHdl( aLink, 1 );
}
@@ -75,18 +79,18 @@ SfxItemDesruptor_Impl::~SfxItemDesruptor_Impl()
}
// ------------------------------------------------------------------------
-IMPL_LINK_NOARG(SfxItemDesruptor_Impl, Delete)
+IMPL_LINK(SfxItemDesruptor_Impl, Delete, SfxItemDesruptor_Impl*, pImpl)
{
{DBG_CHKTHIS(SfxItemDesruptor_Impl, 0);}
- delete this;
+ delete pImpl;
return 0;
}
-// ------------------------------------------------------------------------
-void DeleteItemOnIdle( SfxPoolItem* pItem )
+void DeleteItemOnIdle(SfxPoolItem* pItem)
{
DBG_ASSERT( 0 == pItem->GetRefCount(), "deleting item in use" );
- new SfxItemDesruptor_Impl( pItem );
+ SfxItemDesruptor_Impl *pDesruptor = new SfxItemDesruptor_Impl(pItem);
+ pDesruptor->LaunchDeleteOnIdle();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */