summaryrefslogtreecommitdiff
path: root/forms/source/component/DatabaseForm.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-02-18 13:39:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-18 14:52:28 +0100
commitdbc7fc7587008b376f28605264f45f967680e4ff (patch)
treed47c5946ed4c66a3b5f96cfe1e59f7050d1ac9f9 /forms/source/component/DatabaseForm.cxx
parentc70f5f32e2537639c7ad7e6e63fb760fd7a4ed90 (diff)
use unique_ptr in OComponentEventThread
and simplify - by passing in a std::unique_ptr to addEvent we avoid the need to have a virtual clone method Change-Id: Ie425476a3158c7a66e399c2a9f33d2612dab5cbb Reviewed-on: https://gerrit.libreoffice.org/67962 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms/source/component/DatabaseForm.cxx')
-rw-r--r--forms/source/component/DatabaseForm.cxx15
1 files changed, 2 insertions, 13 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index ab58fae4ddf6..18d96af1364a 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -134,9 +134,6 @@ class OFormSubmitResetThread: public OComponentEventThread
{
protected:
- // duplicate an event with respect to its type
- virtual EventObject *cloneEvent( const EventObject *pEvt ) const override;
-
// process an event. while processing the mutex isn't locked, and pCompImpl
// is made sure to remain valid
virtual void processEvent( ::cppu::OComponentHelper* _pCompImpl,
@@ -150,13 +147,6 @@ public:
};
-EventObject* OFormSubmitResetThread::cloneEvent(
- const EventObject *pEvt ) const
-{
- return new css::awt::MouseEvent( *static_cast<const css::awt::MouseEvent *>(pEvt) );
-}
-
-
void OFormSubmitResetThread::processEvent(
::cppu::OComponentHelper* pCompImpl,
const EventObject *_pEvt,
@@ -1908,8 +1898,7 @@ void SAL_CALL ODatabaseForm::reset()
m_pThread = new OFormSubmitResetThread(this);
m_pThread->create();
}
- EventObject aEvt;
- m_pThread->addEvent(&aEvt);
+ m_pThread->addEvent(std::make_unique<EventObject>());
}
else
{
@@ -2078,7 +2067,7 @@ void SAL_CALL ODatabaseForm::submit( const Reference<XControl>& Control,
m_pThread = new OFormSubmitResetThread(this);
m_pThread->create();
}
- m_pThread->addEvent(&MouseEvt, Control, true);
+ m_pThread->addEvent(std::make_unique<css::awt::MouseEvent>(MouseEvt), Control, true);
}
else
{