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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/view/printer.cxx | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 6717966125b3..b7da7a4af5e8 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1332,10 +1332,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if ( pFact ) { - VclAbstractDialog* pDlg = + VclPtr<VclAbstractDialog> pDlg = pFact->CreateFrameDialog( xFrame, rReq.GetSlot(), sPageURL ); short nRet = pDlg->Execute(); - delete pDlg; + pDlg.disposeAndClear(); SfxViewFrame* pView = SfxViewFrame::GetFirst(); while ( pView ) { @@ -1558,11 +1558,11 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) OUString aLang( aLanguage ); OSL_TRACE("SfxApplication::OfaExec_Impl: about to create dialog for: %s", OUStringToOString( aLang , RTL_TEXTENCODING_ASCII_US ).pData->buffer); // not sure about the vcl::Window* - VclAbstractDialog* pDlg = pFact->CreateSvxScriptOrgDialog( GetTopWindow(), aLanguage ); + VclPtr<VclAbstractDialog> pDlg = pFact->CreateSvxScriptOrgDialog( GetTopWindow(), aLanguage ); if( pDlg ) { pDlg->Execute(); - delete pDlg; + pDlg.disposeAndClear(); } else { diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 996ab8a8f0c2..45f98ad99757 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -136,6 +136,7 @@ SfxPrinter::SfxPrinter( SfxItemSet* pTheOptions, SfxPrinter::SfxPrinter( const SfxPrinter& rPrinter ) : + VclReferenceBase(), Printer( rPrinter.GetName() ), pOptions( rPrinter.GetOptions().Clone() ), pImpl( new SfxPrinter_Impl ), |