diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-21 14:48:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-27 06:08:30 +0000 |
commit | eca5ea9f79181d45cd7fbabe2313617d3025818a (patch) | |
tree | 10b5837fe04212349825742b38f5a37be9ce7009 /sw/source/uibase/app | |
parent | bbd44f8f89839b5abb4ec6c7ea195431de5b2f48 (diff) |
make the AbstractDialog stuff extend from VclReferenceBase
Because some stuff wants to multiple-inherit from VclAbstractDialog and
OutputDevice-subclasses, and we'd prefer to keep all the lifetime
management through a single smart pointer class (VclPtr)
The change in msgbox.cxx and window.cxx is to workaround a bug in
VS2013 to do with virtual inheritance and delegating constructors.
Change-Id: I178e8983b7d20a7d2790aa283be838dca5d14773
Reviewed-on: https://gerrit.libreoffice.org/29140
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r-- | sw/source/uibase/app/apphdl.cxx | 11 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 8d575cc80672..00a9f81b9718 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -382,7 +382,7 @@ class SwMailMergeWizardExecutor : public salhelper::SimpleReferenceObject { SwView* m_pView; // never owner SwView* m_pView2Close; // never owner - AbstractMailMergeWizard* m_pWizard; // always owner + VclPtr<AbstractMailMergeWizard> m_pWizard; // always owner bool m_bDestroyMMToolbarOnCancel; DECL_LINK( EndDialogHdl, Dialog&, void ); @@ -611,15 +611,15 @@ IMPL_LINK_NOARG( SwMailMergeWizardExecutor, EndDialogHdl, Dialog&, void ) IMPL_LINK_NOARG(SwMailMergeWizardExecutor, DestroyDialogHdl, void*, void) { - delete m_pWizard; - m_pWizard = nullptr; + m_pWizard.disposeAndClear(); release(); } IMPL_STATIC_LINK(SwMailMergeWizardExecutor, DestroyWizardHdl, void*, pDialog, void ) { - delete static_cast<AbstractMailMergeWizard*>(pDialog); + VclPtr<AbstractMailMergeWizard> p = static_cast<AbstractMailMergeWizard*>(pDialog); + p.disposeAndClear(); } IMPL_LINK_NOARG(SwMailMergeWizardExecutor, CancelHdl, void*, void) @@ -653,8 +653,7 @@ IMPL_LINK_NOARG(SwMailMergeWizardExecutor, CancelHdl, void*, void) xMMConfig->Commit(); } - delete m_pWizard; - m_pWizard = nullptr; + m_pWizard.disposeAndClear(); release(); } diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 8b5a6d95f704..28553126d76d 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -372,9 +372,10 @@ void SwDocShell::Execute(SfxRequest& rReq) aSet.Put( *static_cast<const SfxBoolItem*>(pOpenSmartTagOptionsItem) ); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - SfxAbstractTabDialog* pDlg = pFact->CreateAutoCorrTabDialog( &aSet ); + VclPtr<SfxAbstractTabDialog> pDlg = pFact->CreateAutoCorrTabDialog( &aSet ); pDlg->Execute(); - delete pDlg; + pDlg.disposeAndClear(); + rACW.SetLockWordLstLocked( bOldLocked ); diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index bd551ffdc74b..cd5745715e36 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -554,7 +554,7 @@ private: sal_uInt16 m_nRet; rtl::Reference< SwDocStyleSheet > m_xTmp; SfxStyleFamily m_nFamily; - SfxAbstractApplyTabDialog *m_pDlg; + VclPtr<SfxAbstractApplyTabDialog> m_pDlg; rtl::Reference< SfxStyleSheetBasePool > m_xBasePool; bool m_bModified; }; |