summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-07-27 20:55:45 +0200
committerMichael Stahl <mstahl@redhat.com>2016-07-28 09:04:17 +0000
commit22c75d86db9351ab271942a755a2a75a76920943 (patch)
treebf3642488f61695439d858b7ae864b24bfbfbcea
parent2777b6380c17bad8a966454947b9d991f9592224 (diff)
sfx2: just use Idle in SfxItemDisruptor_Impl
This Application::InsertIdleHdl() stuff is ancient and now obsolete. Change-Id: I082870328711b2159b05d8cb077c0e439b7ee94c Reviewed-on: https://gerrit.libreoffice.org/27597 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sfx2/source/control/itemdel.cxx26
1 files changed, 11 insertions, 15 deletions
diff --git a/sfx2/source/control/itemdel.cxx b/sfx2/source/control/itemdel.cxx
index d29f5fd4e703..1ac8ab8aa358 100644
--- a/sfx2/source/control/itemdel.cxx
+++ b/sfx2/source/control/itemdel.cxx
@@ -20,20 +20,17 @@
#include <sal/config.h>
#include "itemdel.hxx"
-#include <vcl/svapp.hxx>
-#include <tools/errcode.hxx>
-#include <limits.h>
-#include <vector>
+#include <vcl/idle.hxx>
#include <svl/itempool.hxx>
class SfxItemDisruptor_Impl
{
SfxPoolItem * pItem;
- Link<Application*,void> aLink;
+ Idle m_Idle;
private:
- DECL_LINK_TYPED( Delete, Application*, void );
+ DECL_LINK_TYPED( Delete, Idle*, void );
public:
explicit SfxItemDisruptor_Impl(SfxPoolItem *pItemToDesrupt);
@@ -43,10 +40,12 @@ public:
SfxItemDisruptor_Impl& operator=(const SfxItemDisruptor_Impl&) = delete;
};
-SfxItemDisruptor_Impl::SfxItemDisruptor_Impl( SfxPoolItem *pItemToDesrupt ):
- pItem(pItemToDesrupt),
- aLink( LINK(this, SfxItemDisruptor_Impl, Delete) )
+SfxItemDisruptor_Impl::SfxItemDisruptor_Impl(SfxPoolItem *const pItemToDisrupt)
+ : pItem(pItemToDisrupt)
+ , m_Idle("SfxItemDisruptor_Impl")
{
+ m_Idle.SetIdleHdl(LINK(this, SfxItemDisruptor_Impl, Delete));
+ m_Idle.SetPriority(SchedulerPriority::DEFAULT_IDLE);
DBG_ASSERT( 0 == pItem->GetRefCount(), "disrupting pooled item" );
pItem->SetKind( SFX_ITEMS_DELETEONIDLE );
@@ -54,15 +53,12 @@ SfxItemDisruptor_Impl::SfxItemDisruptor_Impl( SfxPoolItem *pItemToDesrupt ):
void SfxItemDisruptor_Impl::LaunchDeleteOnIdle()
{
- // process in Idle
- Application::InsertIdleHdl( aLink, 1 );
+ m_Idle.Start();
}
SfxItemDisruptor_Impl::~SfxItemDisruptor_Impl()
{
-
- // remove from Idle-Handler
- Application::RemoveIdleHdl( aLink );
+ m_Idle.Stop();
// reset RefCount (was set to SFX_ITEMS_SPECIAL before!)
pItem->SetRefCount( 0 );
@@ -70,7 +66,7 @@ SfxItemDisruptor_Impl::~SfxItemDisruptor_Impl()
delete pItem;
}
-IMPL_LINK_NOARG_TYPED(SfxItemDisruptor_Impl, Delete, Application*, void)
+IMPL_LINK_NOARG_TYPED(SfxItemDisruptor_Impl, Delete, Idle*, void)
{
delete this;
}