summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfx2/source/dialog/templdlg.cxx13
-rw-r--r--sfx2/source/inc/templdgi.hxx2
2 files changed, 11 insertions, 4 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index cbd856ff617a..11b430cddaf2 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -100,20 +100,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
@@ -124,6 +126,7 @@ public:
private:
SfxCommonTemplateDialog_Impl* m_pDialog;
+ DeletionWatcher *const m_pPrevious; /// let's add more epicycles!
};
// Re-direct functions
@@ -1015,9 +1018,13 @@ 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;
}
//-------------------------------------------------------------------------
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 0011aed2796c..844acdb79eb0 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -111,7 +111,7 @@ private:
void ReadResource();
void ClearResource();
void impl_clear();
- void impl_setDeletionWatcher(DeletionWatcher* pNewWatcher);
+ DeletionWatcher * impl_setDeletionWatcher(DeletionWatcher* pNewWatcher);
protected:
#define MAX_FAMILIES 5