diff options
-rw-r--r-- | dbaccess/source/core/dataaccess/databasedocument.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/databasedocument.hxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/unoadmin.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/unoadmin.cxx | 10 |
4 files changed, 8 insertions, 17 deletions
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 9d758ad6566d..1f769fbc633b 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -192,9 +192,6 @@ ODatabaseDocument::~ODatabaseDocument() acquire(); dispose(); } - - delete m_pEventContainer; - m_pEventContainer = nullptr; } Any SAL_CALL ODatabaseDocument::queryInterface( const Type& _rType ) @@ -2003,7 +2000,7 @@ Reference< provider::XScriptProvider > SAL_CALL ODatabaseDocument::getScriptProv Reference< XNameReplace > SAL_CALL ODatabaseDocument::getEvents( ) { DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit ); - return m_pEventContainer; + return m_pEventContainer.get(); } Reference< XInterface > ODatabaseDocument::getThis() const diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx index 0532a764fb9b..5a0bda893d45 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.hxx +++ b/dbaccess/source/core/dataaccess/databasedocument.hxx @@ -167,11 +167,11 @@ class ODatabaseDocument :public ModelDependentComponent // ModelDepe typedef std::map< OUString, css::uno::Reference< css::frame::XUntitledNumbers > > TNumberedController; css::uno::Reference< css::ui::XUIConfigurationManager2> m_xUIConfigurationManager; - ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners; - ::comphelper::OInterfaceContainerHelper2 m_aCloseListener; - ::comphelper::OInterfaceContainerHelper2 m_aStorageListeners; + ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners; + ::comphelper::OInterfaceContainerHelper2 m_aCloseListener; + ::comphelper::OInterfaceContainerHelper2 m_aStorageListeners; - DocumentEvents* m_pEventContainer; + rtl::Reference<DocumentEvents> m_pEventContainer; ::rtl::Reference< DocumentEventExecutor > m_pEventExecutor; DocumentEventNotifier m_aEventNotifier; diff --git a/dbaccess/source/ui/inc/unoadmin.hxx b/dbaccess/source/ui/inc/unoadmin.hxx index 00ad6a2cff93..2839eca417fa 100644 --- a/dbaccess/source/ui/inc/unoadmin.hxx +++ b/dbaccess/source/ui/inc/unoadmin.hxx @@ -42,7 +42,7 @@ protected: SfxItemPool* m_pItemPool; // item pool for the item set for the dialog std::vector<SfxPoolItem*>* m_pItemPoolDefaults; // pool defaults - ::dbaccess::ODsnTypeCollection* + std::unique_ptr<::dbaccess::ODsnTypeCollection> m_pCollection; // datasource type collection css::uno::Any m_aInitialSelection; diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx index 59e2647324c6..0a37676010a7 100644 --- a/dbaccess/source/ui/uno/unoadmin.cxx +++ b/dbaccess/source/ui/uno/unoadmin.cxx @@ -45,11 +45,9 @@ ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XC ,m_pDatasourceItems(nullptr) ,m_pItemPool(nullptr) ,m_pItemPoolDefaults(nullptr) - ,m_pCollection(nullptr) { - - m_pCollection = new ::dbaccess::ODsnTypeCollection(_rxORB); - ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection); + m_pCollection.reset( new ::dbaccess::ODsnTypeCollection(_rxORB) ); + ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection.get()); } ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog() @@ -63,10 +61,6 @@ ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog() ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults); } } - - delete m_pCollection; - m_pCollection = nullptr; - } void ODatabaseAdministrationDialog::implInitialize(const Any& _rValue) |