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 /dbaccess/source | |
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 'dbaccess/source')
4 files changed, 10 insertions, 7 deletions
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index bf6c989bb040..a09fd63a63d7 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1837,7 +1837,7 @@ void SbaXDataBrowserController::ExecuteSearch() Reference< css::util::XNumberFormatsSupplier > xNFS(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), true, getORB())); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - AbstractFmSearchDialog* pDialog = nullptr; + VclPtr<AbstractFmSearchDialog> pDialog; if ( pFact ) { ::std::vector< OUString > aContextNames; @@ -1851,7 +1851,7 @@ void SbaXDataBrowserController::ExecuteSearch() pDialog->SetFoundHandler( LINK( this, SbaXDataBrowserController, OnFoundData ) ); pDialog->SetCanceledNotFoundHdl( LINK( this, SbaXDataBrowserController, OnCanceledNotFound ) ); pDialog->Execute(); - delete pDialog; + pDialog.disposeAndClear(); } // restore the grid's normal operating state diff --git a/dbaccess/source/ui/querydesign/QTableConnection.cxx b/dbaccess/source/ui/querydesign/QTableConnection.cxx index 0f546066be32..4a17b327f923 100644 --- a/dbaccess/source/ui/querydesign/QTableConnection.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnection.cxx @@ -31,7 +31,8 @@ OQueryTableConnection::OQueryTableConnection(OQueryTableView* pContainer, const } OQueryTableConnection::OQueryTableConnection(const OQueryTableConnection& rConn) - : OTableConnection( rConn ) + : VclReferenceBase(), + OTableConnection( rConn ) , m_bVisited(false) { // no own members, so base class functionality is sufficient diff --git a/dbaccess/source/ui/querydesign/TableConnection.cxx b/dbaccess/source/ui/querydesign/TableConnection.cxx index ebf2e179ff96..5cd282fba121 100644 --- a/dbaccess/source/ui/querydesign/TableConnection.cxx +++ b/dbaccess/source/ui/querydesign/TableConnection.cxx @@ -42,9 +42,11 @@ namespace dbaui Show(); } - OTableConnection::OTableConnection( const OTableConnection& _rConn ) : Window(_rConn.m_pParent.get()) - ,m_pData(_rConn.GetData()->NewInstance()) - ,m_pParent(nullptr) + OTableConnection::OTableConnection( const OTableConnection& _rConn ) + : VclReferenceBase() + ,Window(_rConn.m_pParent.get()) + ,m_pData(_rConn.GetData()->NewInstance()) + ,m_pParent(nullptr) { *this = _rConn; } diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx index 61834237b388..4b5824a0dbb0 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx @@ -33,7 +33,7 @@ ORelationTableConnection::ORelationTableConnection( ORelationTableView* pContain } ORelationTableConnection::ORelationTableConnection( const ORelationTableConnection& rConn ) - : OTableConnection( rConn ) + : VclReferenceBase(), OTableConnection( rConn ) { // no own members, thus the base class functionality is enough } |