diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-03 14:04:18 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-04 16:53:09 +0000 |
commit | aa09fd58bd499a2a2c3a32c5f613892bad54076c (patch) | |
tree | db69be3d4624a906a979dac309f90f3235f7052e /sw | |
parent | df18f96a3a30701286691bfeeacd34c3bba68ce0 (diff) |
tdf#105684 crash in mail merge wizard
commit eca5ea9f79181d45cd7fbabe2313617d3025818a
"make the AbstractDialog stuff extend from VclReferenceBase"
introduced this regression.
Fix up the asynchronous delete to work again - necessary because
the delete is triggered from deep inside the object it wants to
delete.
Change-Id: I18d5a899fbb2da772552ebba7fe6a8e810314010
Reviewed-on: https://gerrit.libreoffice.org/33881
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 71863c6188a5a0bf9dd1c31c8ad9c7b8b9b9001b)
Reviewed-on: https://gerrit.libreoffice.org/33889
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/app/apphdl.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 00a9f81b9718..5e2b80979791 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -383,11 +383,13 @@ class SwMailMergeWizardExecutor : public salhelper::SimpleReferenceObject SwView* m_pView; // never owner SwView* m_pView2Close; // never owner VclPtr<AbstractMailMergeWizard> m_pWizard; // always owner + VclPtr<AbstractMailMergeWizard> m_pWizardToDestroyInCallback; + bool m_bDestroyMMToolbarOnCancel; DECL_LINK( EndDialogHdl, Dialog&, void ); DECL_LINK( DestroyDialogHdl, void*, void ); - DECL_STATIC_LINK( SwMailMergeWizardExecutor, DestroyWizardHdl, void*, void ); + DECL_LINK( DestroyWizardHdl, void*, void ); DECL_LINK( CancelHdl, void*, void ); DECL_LINK( CloseFrameHdl, void*, void ); @@ -505,9 +507,11 @@ IMPL_LINK_NOARG( SwMailMergeWizardExecutor, EndDialogHdl, Dialog&, void ) { SwView* pNewView = lcl_LoadDoc(m_pView, m_pWizard->GetReloadDocument()); - // destroy wizard asynchronously + // Destroy wizard asynchronously, since we are deep inside the wizard and dialog + // machinery code here + m_pWizardToDestroyInCallback = m_pWizard; Application::PostUserEvent( - LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), m_pWizard ); + LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), nullptr ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem(); @@ -537,8 +541,9 @@ IMPL_LINK_NOARG( SwMailMergeWizardExecutor, EndDialogHdl, Dialog&, void ) if(pTargetView) { // destroy wizard asynchronously + m_pWizardToDestroyInCallback = m_pWizard; Application::PostUserEvent( - LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), m_pWizard ); + LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), nullptr ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); m_pWizard = pFact->CreateMailMergeWizard(*pTargetView, xMMConfig); @@ -616,10 +621,9 @@ IMPL_LINK_NOARG(SwMailMergeWizardExecutor, DestroyDialogHdl, void*, void) release(); } -IMPL_STATIC_LINK(SwMailMergeWizardExecutor, DestroyWizardHdl, void*, pDialog, void ) +IMPL_LINK_NOARG(SwMailMergeWizardExecutor, DestroyWizardHdl, void*, void) { - VclPtr<AbstractMailMergeWizard> p = static_cast<AbstractMailMergeWizard*>(pDialog); - p.disposeAndClear(); + m_pWizardToDestroyInCallback.disposeAndClear(); } IMPL_LINK_NOARG(SwMailMergeWizardExecutor, CancelHdl, void*, void) |