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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/dialog/SpellDialogChildWindow.cxx | 7 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws1.cxx | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/svx/source/dialog/SpellDialogChildWindow.cxx b/svx/source/dialog/SpellDialogChildWindow.cxx index dc586803f592..6fb2e1f6cff5 100644 --- a/svx/source/dialog/SpellDialogChildWindow.cxx +++ b/svx/source/dialog/SpellDialogChildWindow.cxx @@ -30,20 +30,19 @@ SpellDialogChildWindow::SpellDialogChildWindow ( SfxBindings* pBindings, SfxChildWinInfo* /*pInfo*/) : SfxChildWindow (_pParent, nId) - { - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "SvxAbstractDialogFactory::Create() failed"); - m_xAbstractSpellDialog.reset(pFact->CreateSvxSpellDialog(_pParent, + m_xAbstractSpellDialog = pFact->CreateSvxSpellDialog(_pParent, pBindings, - this )); + this ); SetWindow( m_xAbstractSpellDialog->GetWindow() ); SetHideNotDelete(true); } SpellDialogChildWindow::~SpellDialogChildWindow() { + m_xAbstractSpellDialog.disposeAndClear(); } SfxBindings& SpellDialogChildWindow::GetBindings() const diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index e4316449a632..c4e4267c47f2 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -334,8 +334,8 @@ IMPL_LINK( GalleryBrowser1, EndThemePropertiesDlgHdl, Dialog&, rDialog, void ) IMPL_LINK( GalleryBrowser1, DestroyThemePropertiesDlgHdl, void*, p, void ) { - VclAbstractDialog2* pDialog = static_cast<VclAbstractDialog2*>(p); - delete pDialog; + VclPtr<VclAbstractDialog2> pDialog = static_cast<VclAbstractDialog2*>(p); + pDialog.disposeAndClear(); delete mpThemePropsDlgItemSet; mpThemePropsDlgItemSet = nullptr; } |