diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-17 12:10:27 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-17 12:14:28 +0100 |
commit | 0a497cb52a2ffecd94178eed296ba8ae7f526358 (patch) | |
tree | 9ca24fc64bc20085dc8f055114b67736cd08119b | |
parent | 0703fc22519b391cece54f9d67012cffd9867765 (diff) |
Use VclPtr for OGenericUnoDialog::createDialog.
Change-Id: I0c2040889931a4700735339c5252f8d5fee234ff
44 files changed, 88 insertions, 100 deletions
diff --git a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx index ee3d904814a8..b6145c902c8f 100644 --- a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx @@ -79,9 +79,9 @@ void ChartTypeUnoDlg::implInitialize(const uno::Any& _rValue) else ChartTypeUnoDlg_BASE::implInitialize(_rValue); } -Dialog* ChartTypeUnoDlg::createDialog(vcl::Window* _pParent) +VclPtr<Dialog> ChartTypeUnoDlg::createDialog(vcl::Window* _pParent) { - return new ChartTypeDialog( _pParent, m_xChartModel, m_aContext ); + return VclPtr<ChartTypeDialog>::Create( _pParent, m_xChartModel, m_aContext ); } uno::Reference<beans::XPropertySetInfo> SAL_CALL ChartTypeUnoDlg::getPropertySetInfo() throw(uno::RuntimeException, std::exception) { diff --git a/chart2/source/controller/inc/dlg_ChartType_UNO.hxx b/chart2/source/controller/inc/dlg_ChartType_UNO.hxx index 95dc944b7aae..f91d2226b157 100644 --- a/chart2/source/controller/inc/dlg_ChartType_UNO.hxx +++ b/chart2/source/controller/inc/dlg_ChartType_UNO.hxx @@ -44,7 +44,7 @@ private: // OGenericUnoDialog overridables virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE; - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; // XTypeProvider virtual com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; diff --git a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx index f61045458791..45d0467d5b77 100644 --- a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx @@ -88,7 +88,7 @@ namespace dbmm virtual ~MacroMigrationDialogService(); protected: - virtual Dialog* createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; virtual void destroyDialog() SAL_OVERRIDE; private: @@ -121,9 +121,9 @@ namespace dbmm return *(new MacroMigrationDialogService( _rxContext ) ); } - Dialog* MacroMigrationDialogService::createDialog( vcl::Window* _pParent ) + VclPtr<Dialog> MacroMigrationDialogService::createDialog( vcl::Window* _pParent ) { - return new MacroMigrationDialog( _pParent, m_aContext, m_xDocument ); + return VclPtr<MacroMigrationDialog>::Create( _pParent, m_aContext, m_xDocument ); } void MacroMigrationDialogService::destroyDialog() diff --git a/dbaccess/source/ui/inc/unosqlmessage.hxx b/dbaccess/source/ui/inc/unosqlmessage.hxx index 438f455f324b..29c98ea0f570 100644 --- a/dbaccess/source/ui/inc/unosqlmessage.hxx +++ b/dbaccess/source/ui/inc/unosqlmessage.hxx @@ -71,7 +71,7 @@ protected: virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& _rConvertedValue, com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const com::sun::star::uno::Any& _rValue) throw(com::sun::star::lang::IllegalArgumentException) SAL_OVERRIDE; // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; }; } // namespace dbaui diff --git a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx index cf90db45463b..b4c41272ba2d 100644 --- a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx +++ b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx @@ -63,7 +63,7 @@ namespace dbaui virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE; protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; }; OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference< XComponentContext >& _rxORB) @@ -119,10 +119,9 @@ namespace dbaui describeProperties(aProps); return new ::cppu::OPropertyArrayHelper(aProps); } - Dialog* OAdvancedSettingsDialog::createDialog(vcl::Window* _pParent) + VclPtr<Dialog> OAdvancedSettingsDialog::createDialog(vcl::Window* _pParent) { - AdvancedSettingsDialog* pDlg = new AdvancedSettingsDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); - return pDlg; + return VclPtr<AdvancedSettingsDialog>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); } } // namespace dbaui diff --git a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx index bc1873982ea0..f7cf6b6f15d8 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx @@ -92,10 +92,9 @@ Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialog::getPropertySetInfo() thr return new ::cppu::OPropertyArrayHelper(aProps); } -Dialog* ODBTypeWizDialog::createDialog(vcl::Window* _pParent) +VclPtr<Dialog> ODBTypeWizDialog::createDialog(vcl::Window* _pParent) { - ODbTypeWizDialog* pDlg = new ODbTypeWizDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); - return pDlg; + return VclPtr<ODbTypeWizDialog>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); } } // namespace dbaui diff --git a/dbaccess/source/ui/uno/DBTypeWizDlg.hxx b/dbaccess/source/ui/uno/DBTypeWizDlg.hxx index 4a3a265a6a68..7c3b4105f682 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlg.hxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlg.hxx @@ -55,7 +55,7 @@ public: virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE; protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; }; } // namespace dbaui diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx index 6bfbabab11ed..25e9c4c1d705 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx @@ -106,9 +106,9 @@ Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialogSetup::getPropertySetInfo( return new ::cppu::OPropertyArrayHelper(aProps); } -Dialog* ODBTypeWizDialogSetup::createDialog(vcl::Window* _pParent) +VclPtr<Dialog> ODBTypeWizDialogSetup::createDialog(vcl::Window* _pParent) { - return new ODbTypeWizDialogSetup(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); + return VclPtr<ODbTypeWizDialogSetup>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); } void ODBTypeWizDialogSetup::executedDialog(sal_Int16 _nExecutionResult) diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx index 45f0c7b50e8c..cea42280df7b 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx @@ -57,7 +57,7 @@ public: virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE; protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; virtual void executedDialog(sal_Int16 _nExecutionResult) SAL_OVERRIDE; }; diff --git a/dbaccess/source/ui/uno/TableFilterDlg.cxx b/dbaccess/source/ui/uno/TableFilterDlg.cxx index 9f284263bb1e..fcbf26bf6059 100644 --- a/dbaccess/source/ui/uno/TableFilterDlg.cxx +++ b/dbaccess/source/ui/uno/TableFilterDlg.cxx @@ -92,10 +92,9 @@ Reference<XPropertySetInfo> SAL_CALL OTableFilterDialog::getPropertySetInfo() t return new ::cppu::OPropertyArrayHelper(aProps); } -Dialog* OTableFilterDialog::createDialog(vcl::Window* _pParent) +VclPtr<Dialog> OTableFilterDialog::createDialog(vcl::Window* _pParent) { - OTableSubscriptionDialog* pDlg = new OTableSubscriptionDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); - return pDlg; + return VclPtr<OTableSubscriptionDialog>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); } } // namespace dbaui diff --git a/dbaccess/source/ui/uno/TableFilterDlg.hxx b/dbaccess/source/ui/uno/TableFilterDlg.hxx index 408457ea8cc1..28d84259cf68 100644 --- a/dbaccess/source/ui/uno/TableFilterDlg.hxx +++ b/dbaccess/source/ui/uno/TableFilterDlg.hxx @@ -55,7 +55,7 @@ public: virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE; protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; }; } // namespace dbaui diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.cxx b/dbaccess/source/ui/uno/UserSettingsDlg.cxx index e66d888c25a1..7d3627acc2ba 100644 --- a/dbaccess/source/ui/uno/UserSettingsDlg.cxx +++ b/dbaccess/source/ui/uno/UserSettingsDlg.cxx @@ -92,10 +92,9 @@ Reference<XPropertySetInfo> SAL_CALL OUserSettingsDialog::getPropertySetInfo() return new ::cppu::OPropertyArrayHelper(aProps); } -Dialog* OUserSettingsDialog::createDialog(vcl::Window* _pParent) +VclPtr<Dialog> OUserSettingsDialog::createDialog(vcl::Window* _pParent) { - OUserAdminDlg* pDlg = new OUserAdminDlg(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection, m_xActiveConnection); - return pDlg; + return VclPtr<OUserAdminDlg>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection, m_xActiveConnection); } } // namespace dbaui diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.hxx b/dbaccess/source/ui/uno/UserSettingsDlg.hxx index 043fa1a52410..e0394e99b358 100644 --- a/dbaccess/source/ui/uno/UserSettingsDlg.hxx +++ b/dbaccess/source/ui/uno/UserSettingsDlg.hxx @@ -55,7 +55,7 @@ public: virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE; protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; }; } // namespace dbaui diff --git a/dbaccess/source/ui/uno/admindlg.cxx b/dbaccess/source/ui/uno/admindlg.cxx index f2f52d656174..097156925efc 100644 --- a/dbaccess/source/ui/uno/admindlg.cxx +++ b/dbaccess/source/ui/uno/admindlg.cxx @@ -92,10 +92,9 @@ Reference<XPropertySetInfo> SAL_CALL ODataSourcePropertyDialog::getPropertySetI return new ::cppu::OPropertyArrayHelper(aProps); } -Dialog* ODataSourcePropertyDialog::createDialog(vcl::Window* _pParent) +VclPtr<Dialog> ODataSourcePropertyDialog::createDialog(vcl::Window* _pParent) { - - ODbAdminDialog* pDialog = new ODbAdminDialog(_pParent, m_pDatasourceItems, m_aContext); + VclPtrInstance<ODbAdminDialog> pDialog(_pParent, m_pDatasourceItems, m_aContext); // the initial selection if ( m_aInitialSelection.hasValue() ) diff --git a/dbaccess/source/ui/uno/admindlg.hxx b/dbaccess/source/ui/uno/admindlg.hxx index c791129851f3..e2300420566f 100644 --- a/dbaccess/source/ui/uno/admindlg.hxx +++ b/dbaccess/source/ui/uno/admindlg.hxx @@ -55,7 +55,7 @@ public: virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE; protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; }; } // namespace dbaui diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index 373badf7492c..a4b29d889ecf 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -77,7 +77,7 @@ namespace dbaui IMPLEMENT_PROPERTYCONTAINER_DEFAULTS( ComposerDialog ) - Dialog* ComposerDialog::createDialog(vcl::Window* _pParent) + VclPtr<Dialog> ComposerDialog::createDialog(vcl::Window* _pParent) { // obtain all the objects needed for the dialog Reference< XConnection > xConnection; @@ -140,9 +140,9 @@ namespace dbaui return static_cast< XServiceInfo* >(new RowsetFilterDialog( comphelper::getComponentContext(_rxORB))); } - Dialog* RowsetFilterDialog::createComposerDialog( vcl::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns ) + VclPtr<Dialog> RowsetFilterDialog::createComposerDialog( vcl::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns ) { - return new DlgFilterCrit( _pParent, m_aContext, _rxConnection, m_xComposer, _rxColumns ); + return VclPtr<DlgFilterCrit>::Create( _pParent, m_aContext, _rxConnection, m_xComposer, _rxColumns ); } void SAL_CALL RowsetFilterDialog::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException, std::exception) @@ -188,9 +188,9 @@ namespace dbaui return static_cast< XServiceInfo* >(new RowsetOrderDialog( comphelper::getComponentContext(_rxORB))); } - Dialog* RowsetOrderDialog::createComposerDialog( vcl::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns ) + VclPtr<Dialog> RowsetOrderDialog::createComposerDialog( vcl::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns ) { - return new DlgOrderCrit( _pParent, _rxConnection, m_xComposer, _rxColumns ); + return VclPtr<DlgOrderCrit>::Create( _pParent, _rxConnection, m_xComposer, _rxColumns ); } void SAL_CALL RowsetOrderDialog::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException, std::exception) diff --git a/dbaccess/source/ui/uno/composerdialogs.hxx b/dbaccess/source/ui/uno/composerdialogs.hxx index 4eb6fe8c2de1..3423427d89af 100644 --- a/dbaccess/source/ui/uno/composerdialogs.hxx +++ b/dbaccess/source/ui/uno/composerdialogs.hxx @@ -62,7 +62,7 @@ namespace dbaui protected: // own overridables - virtual Dialog* createComposerDialog( + virtual VclPtr<Dialog> createComposerDialog( vcl::Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns @@ -70,7 +70,7 @@ namespace dbaui private: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; }; // RowsetFilterDialog @@ -85,7 +85,7 @@ namespace dbaui protected: // own overridables - virtual Dialog* createComposerDialog( + virtual VclPtr<Dialog> createComposerDialog( vcl::Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns @@ -110,7 +110,7 @@ namespace dbaui protected: // own overridables - virtual Dialog* createComposerDialog( + virtual VclPtr<Dialog> createComposerDialog( vcl::Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index b6e307ffaa13..e5ac251907a6 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -193,7 +193,7 @@ namespace dbaui virtual ~CopyTableWizard(); // OGenericUnoDialog overridables - virtual Dialog* createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; virtual void executedDialog( sal_Int16 _nExecutionResult ) SAL_OVERRIDE; private: @@ -1514,12 +1514,12 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) return new ::cppu::OPropertyArrayHelper( aProps ); } -Dialog* CopyTableWizard::createDialog( vcl::Window* _pParent ) +VclPtr<Dialog> CopyTableWizard::createDialog( vcl::Window* _pParent ) { OSL_PRECOND( isInitialized(), "CopyTableWizard::createDialog: not initialized!" ); // this should have been prevented in ::execute already - OCopyTableWizard* pWizard = new OCopyTableWizard( + VclPtrInstance<OCopyTableWizard> pWizard( _pParent, m_sDestinationTable, m_nOperation, diff --git a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx index d0c4969b57fb..9744b5af026b 100644 --- a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx +++ b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx @@ -104,7 +104,7 @@ namespace dbaui protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; virtual void implInitialize( const com::sun::star::uno::Any& _rValue ) SAL_OVERRIDE; protected: using OTextConnectionSettingsDialog_BASE::getFastPropertyValue; @@ -204,9 +204,9 @@ namespace dbaui return new ::cppu::OPropertyArrayHelper( aProps ); } - Dialog* OTextConnectionSettingsDialog::createDialog(vcl::Window* _pParent) + VclPtr<Dialog> OTextConnectionSettingsDialog::createDialog(vcl::Window* _pParent) { - return new TextConnectionSettingsDialog( _pParent, *m_pDatasourceItems ); + return VclPtr<TextConnectionSettingsDialog>::Create( _pParent, *m_pDatasourceItems ); } void OTextConnectionSettingsDialog::implInitialize(const Any& _rValue) diff --git a/dbaccess/source/ui/uno/unoDirectSql.cxx b/dbaccess/source/ui/uno/unoDirectSql.cxx index 9f752dac81d0..94b57f10f090 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.cxx +++ b/dbaccess/source/ui/uno/unoDirectSql.cxx @@ -78,7 +78,7 @@ namespace dbaui IMPLEMENT_PROPERTYCONTAINER_DEFAULTS( ODirectSQLDialog ) - Dialog* ODirectSQLDialog::createDialog(vcl::Window* _pParent) + VclPtr<Dialog> ODirectSQLDialog::createDialog(vcl::Window* _pParent) { // obtain all the objects needed for the dialog Reference< XConnection > xConnection = m_xActiveConnection; @@ -99,7 +99,7 @@ namespace dbaui // can't create the dialog if I have improper settings return NULL; - return new DirectSQLDialog( _pParent, xConnection); + return VclPtr<DirectSQLDialog>::Create( _pParent, xConnection ); } void ODirectSQLDialog::implInitialize(const Any& _rValue) { diff --git a/dbaccess/source/ui/uno/unoDirectSql.hxx b/dbaccess/source/ui/uno/unoDirectSql.hxx index 43844874009e..d3330170b538 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.hxx +++ b/dbaccess/source/ui/uno/unoDirectSql.hxx @@ -57,7 +57,7 @@ namespace dbaui protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE; }; diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx index df635164f7fe..4f381a77793b 100644 --- a/dbaccess/source/ui/uno/unosqlmessage.cxx +++ b/dbaccess/source/ui/uno/unosqlmessage.cxx @@ -141,13 +141,13 @@ Reference<XPropertySetInfo> SAL_CALL OSQLMessageDialog::getPropertySetInfo() th return new ::cppu::OPropertyArrayHelper(aProps); } -Dialog* OSQLMessageDialog::createDialog(vcl::Window* _pParent) +VclPtr<Dialog> OSQLMessageDialog::createDialog(vcl::Window* _pParent) { if ( m_aException.hasValue() ) - return new OSQLMessageBox( _pParent, SQLExceptionInfo( m_aException ), WB_OK | WB_DEF_OK, m_sHelpURL ); + return VclPtr<OSQLMessageBox>::Create( _pParent, SQLExceptionInfo( m_aException ), WB_OK | WB_DEF_OK, m_sHelpURL ); OSL_FAIL("OSQLMessageDialog::createDialog : You should use the SQLException property to specify the error to display!"); - return new OSQLMessageBox(_pParent, SQLException()); + return VclPtr<OSQLMessageBox>::Create(_pParent, SQLException()); } } // namespace dbaui diff --git a/extensions/source/abpilot/unodialogabp.cxx b/extensions/source/abpilot/unodialogabp.cxx index 8a0714eb17be..f21ac3198be3 100644 --- a/extensions/source/abpilot/unodialogabp.cxx +++ b/extensions/source/abpilot/unodialogabp.cxx @@ -152,9 +152,9 @@ namespace abp } - Dialog* OABSPilotUno::createDialog(vcl::Window* _pParent) + VclPtr<Dialog> OABSPilotUno::createDialog(vcl::Window* _pParent) { - return new OAddessBookSourcePilot(_pParent, m_aContext ); + return VclPtr<OAddessBookSourcePilot>::Create(_pParent, m_aContext ); } diff --git a/extensions/source/abpilot/unodialogabp.hxx b/extensions/source/abpilot/unodialogabp.hxx index ff58b6e9a456..2f07630094de 100644 --- a/extensions/source/abpilot/unodialogabp.hxx +++ b/extensions/source/abpilot/unodialogabp.hxx @@ -84,7 +84,7 @@ namespace abp using OABSPilotUno_DBase::execute; protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; virtual void executedDialog(sal_Int16 _nExecutionResult) SAL_OVERRIDE; }; diff --git a/extensions/source/dbpilots/unoautopilot.hxx b/extensions/source/dbpilots/unoautopilot.hxx index d176321acacf..67a48aa799e5 100644 --- a/extensions/source/dbpilots/unoautopilot.hxx +++ b/extensions/source/dbpilots/unoautopilot.hxx @@ -85,7 +85,7 @@ namespace dbp protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE; }; diff --git a/extensions/source/dbpilots/unoautopilot.inl b/extensions/source/dbpilots/unoautopilot.inl index 77f3cf6e795d..55e5861f3595 100644 --- a/extensions/source/dbpilots/unoautopilot.inl +++ b/extensions/source/dbpilots/unoautopilot.inl @@ -96,9 +96,9 @@ template <class TYPE, class SERVICEINFO> template <class TYPE, class SERVICEINFO> -Dialog* OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(::vcl::Window* _pParent) +VclPtr<Dialog> OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(::vcl::Window* _pParent) { - return new TYPE(_pParent, m_xObjectModel, m_aContext); + return VclPtr<TYPE>::Create(_pParent, m_xObjectModel, m_aContext); } diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx index 351669a95d57..1a9c1d69f3a1 100644 --- a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx +++ b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx @@ -103,9 +103,9 @@ namespace pcr } - Dialog* MasterDetailLinkDialog::createDialog(vcl::Window* _pParent) + VclPtr<Dialog> MasterDetailLinkDialog::createDialog(vcl::Window* _pParent) { - return new FormLinkDialog(_pParent,m_xDetail,m_xMaster, m_aContext + return VclPtr<FormLinkDialog>::Create(_pParent,m_xDetail,m_xMaster, m_aContext ,m_sExplanation,m_sDetailLabel,m_sMasterLabel); } diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.hxx b/extensions/source/propctrlr/MasterDetailLinkDialog.hxx index 3ff5f64ec0cf..c09ca1db99f7 100644 --- a/extensions/source/propctrlr/MasterDetailLinkDialog.hxx +++ b/extensions/source/propctrlr/MasterDetailLinkDialog.hxx @@ -60,7 +60,7 @@ namespace pcr virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE; // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xDetail; diff --git a/extensions/source/propctrlr/controlfontdialog.cxx b/extensions/source/propctrlr/controlfontdialog.cxx index c06fc1f880ae..21ec3d27006c 100644 --- a/extensions/source/propctrlr/controlfontdialog.cxx +++ b/extensions/source/propctrlr/controlfontdialog.cxx @@ -141,7 +141,7 @@ namespace pcr } - Dialog* OControlFontDialog::createDialog(vcl::Window* _pParent) + VclPtr<Dialog> OControlFontDialog::createDialog(vcl::Window* _pParent) { ControlCharacterDialog::createItemSet(m_pFontItems, m_pItemPool, m_pItemPoolDefaults); @@ -152,8 +152,7 @@ namespace pcr // sets a new introspectee and re-executes us. In this case, the dialog returned here (upon the first // execute) will be re-used upon the second execute, and thus it won't be initialized correctly. - ControlCharacterDialog* pDialog = new ControlCharacterDialog(_pParent, *m_pFontItems); - return pDialog; + return VclPtr<ControlCharacterDialog>::Create(_pParent, *m_pFontItems); } diff --git a/extensions/source/propctrlr/controlfontdialog.hxx b/extensions/source/propctrlr/controlfontdialog.hxx index a5bd97d45b81..1a2fa3b867b2 100644 --- a/extensions/source/propctrlr/controlfontdialog.hxx +++ b/extensions/source/propctrlr/controlfontdialog.hxx @@ -82,7 +82,7 @@ namespace pcr protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; virtual void destroyDialog() SAL_OVERRIDE; virtual void executedDialog(sal_Int16 _nExecutionResult) SAL_OVERRIDE; }; diff --git a/extensions/source/propctrlr/pcrunodialogs.cxx b/extensions/source/propctrlr/pcrunodialogs.cxx index 9c26eb5465d6..518ebbbe5064 100644 --- a/extensions/source/propctrlr/pcrunodialogs.cxx +++ b/extensions/source/propctrlr/pcrunodialogs.cxx @@ -130,9 +130,9 @@ namespace pcr } - Dialog* OTabOrderDialog::createDialog( vcl::Window* _pParent ) + VclPtr<Dialog> OTabOrderDialog::createDialog( vcl::Window* _pParent ) { - return new TabOrderDialog( _pParent, m_xTabbingModel, m_xControlContext, m_aContext ); + return VclPtr<TabOrderDialog>::Create( _pParent, m_xTabbingModel, m_xControlContext, m_aContext ); } void OTabOrderDialog::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException, std::exception) diff --git a/extensions/source/propctrlr/pcrunodialogs.hxx b/extensions/source/propctrlr/pcrunodialogs.hxx index 61a76bf24f4c..19ac76cff393 100644 --- a/extensions/source/propctrlr/pcrunodialogs.hxx +++ b/extensions/source/propctrlr/pcrunodialogs.hxx @@ -78,7 +78,7 @@ namespace pcr protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; }; diff --git a/filter/source/flash/swfdialog.cxx b/filter/source/flash/swfdialog.cxx index 0817f86bcbed..9fa75b711001 100644 --- a/filter/source/flash/swfdialog.cxx +++ b/filter/source/flash/swfdialog.cxx @@ -146,9 +146,9 @@ Sequence< OUString > SAL_CALL SWFDialog::getSupportedServiceNames() -Dialog* SWFDialog::createDialog( vcl::Window* pParent ) +VclPtr<Dialog> SWFDialog::createDialog( vcl::Window* pParent ) { - Dialog* pRet = NULL; + VclPtr<Dialog> pRet; if (mxSrcDoc.is()) { @@ -172,8 +172,7 @@ Dialog* SWFDialog::createDialog( vcl::Window* pParent ) { } */ - ImpSWFDialog* pDlg = new ImpSWFDialog( pParent, maFilterData ); - pRet = pDlg; + pRet.reset( VclPtr<ImpSWFDialog>::Create( pParent, maFilterData ) ); } return pRet; diff --git a/filter/source/flash/swfdialog.hxx b/filter/source/flash/swfdialog.hxx index 931432e33c4c..2130f79f38b2 100644 --- a/filter/source/flash/swfdialog.hxx +++ b/filter/source/flash/swfdialog.hxx @@ -54,7 +54,7 @@ protected: virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual Dialog* createDialog( vcl::Window* pParent ) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog( vcl::Window* pParent ) SAL_OVERRIDE; virtual void executedDialog( sal_Int16 nExecutionResult ) SAL_OVERRIDE; virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE; diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx index 0c5c9b4b9d0d..a4c914928873 100644 --- a/filter/source/pdf/pdfdialog.cxx +++ b/filter/source/pdf/pdfdialog.cxx @@ -107,17 +107,11 @@ Sequence< OUString > SAL_CALL PDFDialog::getSupportedServiceNames() -Dialog* PDFDialog::createDialog( vcl::Window* pParent ) +VclPtr<Dialog> PDFDialog::createDialog( vcl::Window* pParent ) { - Dialog* pRet = NULL; - if( mxSrcDoc.is() ) - { - ImpPDFTabDialog* pDlg = new ImpPDFTabDialog( pParent, maFilterData, mxSrcDoc ); - pRet = pDlg; - } - - return pRet; + return VclPtr<ImpPDFTabDialog>::Create( pParent, maFilterData, mxSrcDoc ); + return VclPtr<Dialog>(); } diff --git a/filter/source/pdf/pdfdialog.hxx b/filter/source/pdf/pdfdialog.hxx index 85135fa24079..e343902e2481 100644 --- a/filter/source/pdf/pdfdialog.hxx +++ b/filter/source/pdf/pdfdialog.hxx @@ -51,7 +51,7 @@ protected: virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(RuntimeException, std::exception) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw (RuntimeException, std::exception) SAL_OVERRIDE; virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (RuntimeException, std::exception) SAL_OVERRIDE; - virtual Dialog* createDialog( vcl::Window* pParent ) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog( vcl::Window* pParent ) SAL_OVERRIDE; virtual void executedDialog( sal_Int16 nExecutionResult ) SAL_OVERRIDE; virtual Reference< XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(RuntimeException, std::exception) SAL_OVERRIDE; virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE; diff --git a/filter/source/svg/svgdialog.cxx b/filter/source/svg/svgdialog.cxx index 0420570004f2..70318fe0f6a5 100644 --- a/filter/source/svg/svgdialog.cxx +++ b/filter/source/svg/svgdialog.cxx @@ -143,11 +143,12 @@ Sequence< OUString > SAL_CALL SVGDialog::getSupportedServiceNames() -Dialog* SVGDialog::createDialog( vcl::Window* pParent ) +VclPtr<Dialog> SVGDialog::createDialog( vcl::Window* pParent ) { - return( ( /*KA: *mapResMgr.get() &&*/ mxSrcDoc.is() ) ? - new ImpSVGDialog( pParent/*KA: , *mapResMgr*/, maFilterData ) : - NULL ); + if( mxSrcDoc.is() ) + return VclPtr<ImpSVGDialog>::Create( pParent, maFilterData ); + else + return VclPtr<Dialog>(); } diff --git a/filter/source/svg/svgdialog.hxx b/filter/source/svg/svgdialog.hxx index 064240ff49c7..7c87789c2438 100644 --- a/filter/source/svg/svgdialog.hxx +++ b/filter/source/svg/svgdialog.hxx @@ -56,7 +56,7 @@ protected: virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual Dialog* createDialog( vcl::Window* pParent ) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog( vcl::Window* pParent ) SAL_OVERRIDE; virtual void executedDialog( sal_Int16 nExecutionResult ) SAL_OVERRIDE; virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE; diff --git a/include/svtools/genericunodialog.hxx b/include/svtools/genericunodialog.hxx index 73fc6eb8f539..072516f3d5ce 100644 --- a/include/svtools/genericunodialog.hxx +++ b/include/svtools/genericunodialog.hxx @@ -125,7 +125,7 @@ namespace svt but the application-wide solar mutex is (to guard the not thread-safe ctor of the dialog). @param pParent the parent window for the new dialog */ - virtual Dialog* createDialog(vcl::Window* _pParent) = 0; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) = 0; /// called to destroy the dialog used. the default implementation just deletes m_pDialog and resets it to NULL virtual void destroyDialog(); diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx index 7b6aba43a7c9..d21a3baefa6f 100644 --- a/svtools/source/uno/addrtempuno.cxx +++ b/svtools/source/uno/addrtempuno.cxx @@ -71,7 +71,7 @@ namespace { protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE; @@ -212,12 +212,12 @@ namespace { } - Dialog* OAddressBookSourceDialogUno::createDialog(vcl::Window* _pParent) + VclPtr<Dialog> OAddressBookSourceDialogUno::createDialog(vcl::Window* _pParent) { if ( m_xDataSource.is() && !m_sTable.isEmpty() ) - return new AddressBookSourceDialog(_pParent, m_aContext, m_xDataSource, m_sDataSourceName, m_sTable, m_aAliases ); + return VclPtr<AddressBookSourceDialog>::Create(_pParent, m_aContext, m_xDataSource, m_sDataSourceName, m_sTable, m_aAliases ); else - return new AddressBookSourceDialog( _pParent, m_aContext ); + return VclPtr<AddressBookSourceDialog>::Create( _pParent, m_aContext ); } } diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx index 8c70e93f1184..4b7f82f3d753 100644 --- a/svtools/source/uno/genericunodialog.cxx +++ b/svtools/source/uno/genericunodialog.cxx @@ -178,7 +178,7 @@ bool OGenericUnoDialog::impl_ensureDialog_lck() // the title OUString sTitle = m_sTitle; - Dialog* pDialog = createDialog( pParent ); + VclPtr<Dialog> pDialog = createDialog( pParent ); OSL_ENSURE( pDialog, "OGenericUnoDialog::impl_ensureDialog_lck: createDialog returned nonsense!" ); if ( !pDialog ) return false; diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index 20e44f65b0a7..7fb5d2384f81 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -136,7 +136,7 @@ namespace { virtual ~Wizard(); protected: - virtual Dialog* createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; virtual void destroyDialog() SAL_OVERRIDE; private: @@ -268,12 +268,12 @@ namespace { } - Dialog* Wizard::createDialog( vcl::Window* i_pParent ) + VclPtr<Dialog> Wizard::createDialog( vcl::Window* i_pParent ) { - WizardShell* pDialog( new WizardShell( i_pParent, m_xController, m_aWizardSteps ) ); + VclPtrInstance<WizardShell> pDialog( i_pParent, m_xController, m_aWizardSteps ); pDialog->SetHelpId( lcl_getHelpId( m_sHelpURL ) ); pDialog->setTitleBase( m_sTitle ); - return pDialog; + return pDialog.get(); } diff --git a/svx/source/form/xfm_addcondition.cxx b/svx/source/form/xfm_addcondition.cxx index a0da5da65266..3caead135599 100644 --- a/svx/source/form/xfm_addcondition.cxx +++ b/svx/source/form/xfm_addcondition.cxx @@ -145,12 +145,12 @@ namespace svxform } - Dialog* OAddConditionDialog::createDialog(vcl::Window* _pParent) + VclPtr<Dialog> OAddConditionDialog::createDialog(vcl::Window* _pParent) { if ( !m_xBinding.is() || m_sFacetName.isEmpty() ) throw RuntimeException( OUString(), *this ); - return new AddConditionDialog( _pParent, m_sFacetName, m_xBinding ); + return VclPtr<AddConditionDialog>::Create( _pParent, m_sFacetName, m_xBinding ); } diff --git a/svx/source/inc/xfm_addcondition.hxx b/svx/source/inc/xfm_addcondition.hxx index b55a0f3f9a03..c3a4db2cae87 100644 --- a/svx/source/inc/xfm_addcondition.hxx +++ b/svx/source/inc/xfm_addcondition.hxx @@ -67,7 +67,7 @@ namespace svxform protected: // OGenericUnoDialog overridables - virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE; virtual void executedDialog(sal_Int16 _nExecutionResult) SAL_OVERRIDE; }; |