sfx2/source/dialog/templdlg.cxx | 17 ++++++++++------- sfx2/source/inc/templdgi.hxx | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-)
New commits: commit b18ff2a2ef8dae006d6bc976a61510f2dbaa27f2 Author: Michael Stahl <mst...@redhat.com> Date: Mon May 19 22:12:51 2014 +0200 fdo#78536: sfx2: remove (likely) accidentally duplicated call It looks like commit dda842bec338efb06457551136678340d0718807 wanted to #ifdef this Execute_Impl() call but somehow duplicated it. Change-Id: I745e16cb0be19cf38eb70dd261204c879aa6986e diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index e59e14f..58d903a 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -999,9 +999,6 @@ void SfxCommonTemplateDialog_Impl::Initialize() SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl() { OUString aEmpty; - Execute_Impl(SID_STYLE_END_PREVIEW, - OUString(), OUString(), - 0, 0, 0, 0 ); #if defined STYLESPREVIEW Execute_Impl(SID_STYLE_END_PREVIEW, OUString(), OUString(), commit 838c580fdba8b1c72bc854d101d302be0e3861d5 Author: Michael Stahl <mst...@redhat.com> Date: Mon May 19 22:03:18 2014 +0200 fdo#78536: sfx2: template dialog: make the am-i-dead-yet check reentrant In the fine tradition of our enterprise-grade code base, this lets the check in SfxCommonTemplateDialog_Impl::Execute_Impl() do an early return if the "this" instance has signalled its untimely demise even if there are multiple calls of Execute_Impl() on the stack; extending the scheme with further epicycles to make it work if the Execute_Impl() calls happen on 2 different threads is left as an exercise for the interested reader. (regression from bcc52fb2ebdf77a1cc089857775fd742085b45b6) Change-Id: I1d9f0d82bf6d9f5da8f9bd2be57d01937d71fd26 diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index fd6b5ef..e59e14f 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -101,20 +101,22 @@ class SfxCommonTemplateDialog_Impl::DeletionWatcher : private boost::noncopyable public: explicit DeletionWatcher(SfxCommonTemplateDialog_Impl& rDialog) : m_pDialog(&rDialog) + , m_pPrevious(m_pDialog->impl_setDeletionWatcher(this)) { - m_pDialog->impl_setDeletionWatcher(this); } ~DeletionWatcher() { if (m_pDialog) - m_pDialog->impl_setDeletionWatcher(0); + m_pDialog->impl_setDeletionWatcher(m_pPrevious); } // Signal that the dialog was deleted void signal() { m_pDialog = 0; + if (m_pPrevious) + m_pPrevious->signal(); } // Return true if the dialog was deleted @@ -125,6 +127,7 @@ public: private: SfxCommonTemplateDialog_Impl* m_pDialog; + DeletionWatcher *const m_pPrevious; /// let's add more epicycles! }; // Re-direct functions @@ -961,13 +964,16 @@ void SfxCommonTemplateDialog_Impl::impl_clear() DELETEZ( m_pStyleFamiliesId ); } -void SfxCommonTemplateDialog_Impl::impl_setDeletionWatcher(DeletionWatcher* pNewWatcher) +SfxCommonTemplateDialog_Impl::DeletionWatcher * +SfxCommonTemplateDialog_Impl::impl_setDeletionWatcher( + DeletionWatcher *const pNewWatcher) { + DeletionWatcher *const pRet(m_pDeletionWatcher); m_pDeletionWatcher = pNewWatcher; + return pRet; } - void SfxCommonTemplateDialog_Impl::Initialize() { // Read global user resource diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index 3a34953..d313a6b 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -155,7 +155,7 @@ private: void ReadResource(); void ClearResource(); void impl_clear(); - void impl_setDeletionWatcher(DeletionWatcher* pNewWatcher); + DeletionWatcher * impl_setDeletionWatcher(DeletionWatcher* pNewWatcher); protected: #define MAX_FAMILIES 5 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits