diff options
Diffstat (limited to 'dbaccess/source')
162 files changed, 1540 insertions, 822 deletions
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx index 41c64799dbe5..2e822197ae2a 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx @@ -67,6 +67,17 @@ namespace dbmm get(m_pCloseDocError, "closedocerror"); } + PreparationPage::~PreparationPage() + { + dispose(); + } + + void PreparationPage::dispose() + { + m_pCloseDocError.clear(); + MacroMigrationPage::dispose(); + } + void PreparationPage::showCloseDocsError( bool _bShow ) { m_pCloseDocError->Show( _bShow ); @@ -101,6 +112,9 @@ namespace dbmm void SaveDBDocPage::dispose() { delete m_pLocationController; + m_pSaveAsLocation.clear(); + m_pBrowseSaveAsLocation.clear(); + m_pStartMigration.clear(); MacroMigrationPage::dispose(); } @@ -180,6 +194,21 @@ namespace dbmm get(m_pMigrationDone, "done"); } + ProgressPage::~ProgressPage() + { + dispose(); + } + + void ProgressPage::dispose() + { + m_pObjectCount.clear(); + m_pCurrentObject.clear(); + m_pCurrentAction.clear(); + m_pAllProgressText.clear(); + m_pMigrationDone.clear(); + MacroMigrationPage::dispose(); + } + TabPage* ProgressPage::Create(::svt::RoadmapWizard& _rParentDialog) { return new ProgressPage(&_rParentDialog); @@ -262,6 +291,19 @@ namespace dbmm get(m_pFailureLabel, "failure"); } + ResultPage::~ResultPage() + { + dispose(); + } + + void ResultPage::dispose() + { + m_pSuccessLabel.clear(); + m_pFailureLabel.clear(); + m_pChanges.clear(); + MacroMigrationPage::dispose(); + } + TabPage* ResultPage::Create(::svt::RoadmapWizard& _rParentDialog) { return new ResultPage(&_rParentDialog); diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.hxx b/dbaccess/source/ext/macromigration/macromigrationpages.hxx index a093313e18bb..d7d11ca8bdab 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.hxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.hxx @@ -57,6 +57,8 @@ namespace dbmm { public: PreparationPage(vcl::Window *pParent); + virtual ~PreparationPage(); + virtual void dispose() SAL_OVERRIDE; static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); @@ -64,7 +66,7 @@ namespace dbmm void showCloseDocsError(bool _bShow); protected: - FixedText* m_pCloseDocError; + VclPtr<FixedText> m_pCloseDocError; }; // SaveDBDocPage @@ -81,9 +83,9 @@ namespace dbmm void grabLocationFocus() { m_pSaveAsLocation->GrabFocus(); } protected: - ::svt::OFileURLControl* m_pSaveAsLocation; - PushButton* m_pBrowseSaveAsLocation; - FixedText* m_pStartMigration; + VclPtr<::svt::OFileURLControl> m_pSaveAsLocation; + VclPtr<PushButton> m_pBrowseSaveAsLocation; + VclPtr<FixedText> m_pStartMigration; ::svx::DatabaseLocationInputController* m_pLocationController; protected: @@ -102,6 +104,8 @@ namespace dbmm { public: ProgressPage(vcl::Window *pParent); + virtual ~ProgressPage(); + virtual void dispose() SAL_OVERRIDE; static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); @@ -119,13 +123,13 @@ namespace dbmm virtual void setOverallProgressValue( const sal_uInt32 _nValue ) SAL_OVERRIDE; private: - FixedText* m_pObjectCount; - FixedText* m_pCurrentObject; - FixedText* m_pCurrentAction; - RangeProgressBar m_aCurrentProgress; - FixedText* m_pAllProgressText; - RangeProgressBar m_aAllProgress; - FixedText* m_pMigrationDone; + VclPtr<FixedText> m_pObjectCount; + VclPtr<FixedText> m_pCurrentObject; + VclPtr<FixedText> m_pCurrentAction; + RangeProgressBar m_aCurrentProgress; + VclPtr<FixedText> m_pAllProgressText; + RangeProgressBar m_aAllProgress; + VclPtr<FixedText> m_pMigrationDone; }; // ResultPage @@ -133,15 +137,17 @@ namespace dbmm { public: ResultPage(vcl::Window *pParent); + virtual ~ResultPage(); + virtual void dispose() SAL_OVERRIDE; static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); void displayMigrationLog( const bool _bSuccessful, const OUString& _rLog ); private: - FixedText* m_pSuccessLabel; - FixedText* m_pFailureLabel; - VclMultiLineEdit* m_pChanges; + VclPtr<FixedText> m_pSuccessLabel; + VclPtr<FixedText> m_pFailureLabel; + VclPtr<VclMultiLineEdit> m_pChanges; }; } // namespace dbmm diff --git a/dbaccess/source/ext/macromigration/rangeprogressbar.hxx b/dbaccess/source/ext/macromigration/rangeprogressbar.hxx index 0dde133e7f10..7b5a1a0e1282 100644 --- a/dbaccess/source/ext/macromigration/rangeprogressbar.hxx +++ b/dbaccess/source/ext/macromigration/rangeprogressbar.hxx @@ -65,7 +65,7 @@ namespace dbmm } private: - ProgressBar *m_pBar; + VclPtr<ProgressBar> m_pBar; sal_uInt32 m_nRange; }; diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 61a047e8809f..4e090e9c7245 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -261,7 +261,6 @@ void OAppDetailPageHelper::dispose() m_pTablePreview.disposeAndClear(); m_aBorder.disposeAndClear(); m_aMenu.reset(); - vcl::Window::dispose(); } diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index a65d6f613849..d68b8a31263f 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -374,6 +374,7 @@ void OTasksWindow::dispose() m_aDescription.disposeAndClear(); m_aHelpText.disposeAndClear(); m_aFL.disposeAndClear(); + m_pDetailView.clear(); vcl::Window::dispose(); } @@ -572,10 +573,10 @@ void OApplicationDetailView::dispose() { set(NULL,NULL); setSplitter(NULL); - m_pControlHelper = NULL; m_aHorzSplitter.disposeAndClear(); m_aTasks.disposeAndClear(); m_aContainer.disposeAndClear(); + m_pControlHelper.clear(); OSplitterView::dispose(); } diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index 052094d67f0d..fadf67574c38 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -115,7 +115,7 @@ namespace dbaui VclPtr<FixedText> m_aDescription; VclPtr<FixedText> m_aHelpText; VclPtr<FixedLine> m_aFL; - OApplicationDetailView* m_pDetailView; + VclPtr<OApplicationDetailView> m_pDetailView; DECL_LINK( OnEntrySelectHdl, SvTreeListBox* ); void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); @@ -149,7 +149,7 @@ namespace dbaui VclPtr<OTitleWindow> m_aTasks; VclPtr<OTitleWindow> m_aContainer; OAppBorderWindow& m_rBorderWin; // my parent - OAppDetailPageHelper* m_pControlHelper; + VclPtr<OAppDetailPageHelper> m_pControlHelper; ::std::vector< TaskPaneData > m_aTaskPaneData; MnemonicGenerator m_aExternalMnemonics; diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx index eb8eebc58e02..c6686f2e6034 100644 --- a/dbaccess/source/ui/app/AppTitleWindow.cxx +++ b/dbaccess/source/ui/app/AppTitleWindow.cxx @@ -56,8 +56,8 @@ void OTitleWindow::dispose() { m_pChild->Hide(); boost::scoped_ptr<vcl::Window> aTemp(m_pChild); - m_pChild = NULL; } + m_pChild.clear(); m_aSpace1.disposeAndClear(); m_aSpace2.disposeAndClear(); m_aTitle.disposeAndClear(); diff --git a/dbaccess/source/ui/app/AppTitleWindow.hxx b/dbaccess/source/ui/app/AppTitleWindow.hxx index d7ffc569f4df..875f693107ab 100644 --- a/dbaccess/source/ui/app/AppTitleWindow.hxx +++ b/dbaccess/source/ui/app/AppTitleWindow.hxx @@ -28,7 +28,7 @@ namespace dbaui VclPtr<FixedText> m_aSpace1; VclPtr<FixedText> m_aSpace2; VclPtr<FixedText> m_aTitle; - vcl::Window* m_pChild; + VclPtr<vcl::Window> m_pChild; bool m_bShift; void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); protected: diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx index 2e67c18acd89..a9382f4b1e88 100644 --- a/dbaccess/source/ui/app/AppView.cxx +++ b/dbaccess/source/ui/app/AppView.cxx @@ -95,15 +95,14 @@ void OAppBorderWindow::dispose() if ( m_pPanel ) { m_pPanel->Hide(); - boost::scoped_ptr<vcl::Window> aTemp(m_pPanel); - m_pPanel = NULL; } if ( m_pDetailView ) { m_pDetailView->Hide(); - boost::scoped_ptr<vcl::Window> aTemp(m_pDetailView); - m_pDetailView = NULL; } + m_pPanel.clear(); + m_pDetailView.clear(); + m_pView.clear(); vcl::Window::dispose(); } @@ -219,12 +218,7 @@ void OApplicationView::dispose() stopComponentListening(m_xObject); m_xObject.clear(); } - if (m_pWin) - { - m_pWin->Hide(); - boost::scoped_ptr<vcl::Window> aTemp(m_pWin); - m_pWin = NULL; - } + m_pWin.clear(); ODataView::dispose(); } diff --git a/dbaccess/source/ui/app/AppView.hxx b/dbaccess/source/ui/app/AppView.hxx index c480c4f91520..41f30c85b99e 100644 --- a/dbaccess/source/ui/app/AppView.hxx +++ b/dbaccess/source/ui/app/AppView.hxx @@ -44,9 +44,9 @@ namespace dbaui class OTitleWindow; class OAppBorderWindow : public vcl::Window { - OTitleWindow* m_pPanel; - OApplicationDetailView* m_pDetailView; - OApplicationView* m_pView; + VclPtr<OTitleWindow> m_pPanel; + VclPtr<OApplicationDetailView> m_pDetailView; + VclPtr<OApplicationView> m_pView; void ImplInitSettings(); protected: @@ -80,7 +80,7 @@ namespace dbaui ::com::sun::star::lang::Locale m_aLocale; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xObject; - OAppBorderWindow* m_pWin; + VclPtr<OAppBorderWindow> m_pWin; IApplicationController& m_rAppController; ChildFocusState m_eChildFocus; diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx index e4c05397585b..880504587747 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.cxx +++ b/dbaccess/source/ui/app/subcomponentmanager.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <tools/diagnose_ex.h> +#include <dbaccess/dataview.hxx> #include <vcl/svapp.hxx> #include <osl/mutex.hxx> diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 3e66f5cb6db3..83a436aa63e3 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -106,7 +106,7 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont m_pVclControl = NULL; getVclControl(); - OSL_ENSURE(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !"); + OSL_ENSURE(m_pVclControl != nullptr, "UnoDataBrowserView::Construct : no real grid control !"); } catch(const Exception&) { @@ -122,17 +122,10 @@ UnoDataBrowserView::~UnoDataBrowserView() void UnoDataBrowserView::dispose() { - { - boost::scoped_ptr<Splitter> aTemp(m_pSplitter); - m_pSplitter = NULL; - } + m_pSplitter.clear(); setTreeView(NULL); - if ( m_pStatus ) - { - delete m_pStatus; - m_pStatus = NULL; - } + m_pStatus.clear(); try { @@ -141,6 +134,8 @@ void UnoDataBrowserView::dispose() } catch(const Exception&) {} + m_pTreeView.clear(); + m_pVclControl.clear(); ODataView::dispose(); } @@ -162,13 +157,9 @@ void UnoDataBrowserView::setSplitter(Splitter* _pSplitter) void UnoDataBrowserView::setTreeView(DBTreeView* _pTreeView) { - if (m_pTreeView != _pTreeView) + if (m_pTreeView.get() != _pTreeView) { - if (m_pTreeView) - { - boost::scoped_ptr<vcl::Window> aTemp(m_pTreeView); - m_pTreeView = NULL; - } + m_pTreeView.clear(); m_pTreeView = _pTreeView; } } diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx index 0956ff13a6e2..d80dc3d0b09f 100644 --- a/dbaccess/source/ui/browser/dbtreeview.cxx +++ b/dbaccess/source/ui/browser/dbtreeview.cxx @@ -58,9 +58,8 @@ void DBTreeView::dispose() m_pTreeListBox->GetModel()->RemoveView(m_pTreeListBox); m_pTreeListBox->DisconnectFromModel(); } - boost::scoped_ptr<vcl::Window> aTemp(m_pTreeListBox); - m_pTreeListBox = NULL; } + m_pTreeListBox.clear(); vcl::Window::dispose(); } diff --git a/dbaccess/source/ui/browser/dbtreeview.hxx b/dbaccess/source/ui/browser/dbtreeview.hxx index bc9e11be4cb1..5313583fc061 100644 --- a/dbaccess/source/ui/browser/dbtreeview.hxx +++ b/dbaccess/source/ui/browser/dbtreeview.hxx @@ -31,7 +31,7 @@ namespace dbaui class DBTreeView : public vcl::Window { private: - DBTreeListBox* m_pTreeListBox; + VclPtr<DBTreeListBox> m_pTreeListBox; protected: // window overridables virtual void Resize() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 0613b7d54c50..7b129ee4f313 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -983,6 +983,16 @@ Reference< XConnection > OGenericUnoController::connect( const OUString& _rDataS return xConnection; } +void OGenericUnoController::setView( ODataView& i_rView ) +{ + m_pView = &i_rView; +} + +void OGenericUnoController::clearView() +{ + m_pView = NULL; +} + void OGenericUnoController::showError(const SQLExceptionInfo& _rInfo) { ::dbaui::showError(_rInfo,getView(),getORB()); diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 826384e4eb54..73495b56dcab 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -76,17 +76,15 @@ using namespace ::com::sun::star::util; namespace { - template< typename T1, typename T2> void lcl_HideAndDeleteControl(short& _nPos,T1** _pControl,T2** _pControlText) + template< typename T1, typename T2> void lcl_HideAndDeleteControl(short& _nPos,VclPtr<T1>& _pControl, VclPtr<T2>& _pControlText) { - if ( *_pControl ) + if ( _pControl ) { --_nPos; - (*_pControl)->Hide(); - (*_pControlText)->Hide(); - delete *_pControl; - delete *_pControlText; - (*_pControl) = NULL; - (*_pControlText) = NULL; + _pControl->Hide(); + _pControlText->Hide(); + _pControl.clear(); + _pControlText.clear(); } } @@ -191,6 +189,36 @@ void OFieldDescControl::dispose() DeactivateAggregate( tpColumnName ); DeactivateAggregate( tpType ); DeactivateAggregate( tpAutoIncrementValue ); + pHelp.clear(); + pLastFocusWindow.clear(); + m_pActFocusWindow.clear(); + pDefaultText.clear(); + pRequiredText.clear(); + pAutoIncrementText.clear(); + pTextLenText.clear(); + pNumTypeText.clear(); + pLengthText.clear(); + pScaleText.clear(); + pFormatText.clear(); + pBoolDefaultText.clear(); + m_pColumnNameText.clear(); + m_pTypeText.clear(); + m_pAutoIncrementValueText.clear(); + pRequired.clear(); + pNumType.clear(); + pAutoIncrement.clear(); + pDefault.clear(); + pTextLen.clear(); + pLength.clear(); + pScale.clear(); + pFormatSample.clear(); + pBoolDefault.clear(); + m_pColumnName.clear(); + m_pType.clear(); + m_pAutoIncrementValue.clear(); + pFormat.clear(); + m_pVertScroll.clear(); + m_pHorzScroll.clear(); TabPage::dispose(); } @@ -685,8 +713,8 @@ void OFieldDescControl::ArrangeAggregates() // A Control's description struct AGGREGATE_DESCRIPTION { - Control* pctrlInputControl; // The actual Control for input - Control* pctrlTextControl; // The corresponding Label + VclPtr<Control> pctrlInputControl; // The actual Control for input + VclPtr<Control> pctrlTextControl; // The corresponding Label sal_uInt16 nPosSizeArgument; // The second argument for SetPosSize }; AGGREGATE_DESCRIPTION adAggregates[] = { @@ -722,8 +750,8 @@ void OFieldDescControl::ArrangeAggregates() { if (adAggregates[i].pctrlInputControl) { - SetPosSize(&adAggregates[i].pctrlTextControl, nCurrentControlPos, 0); - SetPosSize(&adAggregates[i].pctrlInputControl, nCurrentControlPos, adAggregates[i].nPosSizeArgument); + SetPosSize(adAggregates[i].pctrlTextControl, nCurrentControlPos, 0); + SetPosSize(adAggregates[i].pctrlInputControl, nCurrentControlPos, adAggregates[i].nPosSizeArgument); // Set the z-order in a way such that the Controls can be traversed in the same sequence in which they have been arranged here adAggregates[i].pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? WINDOW_ZORDER_BEHIND : WINDOW_ZORDER_FIRST); @@ -976,62 +1004,61 @@ void OFieldDescControl::DeactivateAggregate( EControlType eType ) switch( eType ) { case tpDefault: - lcl_HideAndDeleteControl(m_nPos,&pDefault,&pDefaultText); + lcl_HideAndDeleteControl(m_nPos,pDefault,pDefaultText); break; case tpAutoIncrementValue: - lcl_HideAndDeleteControl(m_nPos,&m_pAutoIncrementValue,&m_pAutoIncrementValueText); + lcl_HideAndDeleteControl(m_nPos,m_pAutoIncrementValue,m_pAutoIncrementValueText); break; case tpColumnName: - lcl_HideAndDeleteControl(m_nPos,&m_pColumnName,&m_pColumnNameText); + lcl_HideAndDeleteControl(m_nPos,m_pColumnName,m_pColumnNameText); break; case tpType: - lcl_HideAndDeleteControl(m_nPos,&m_pType,&m_pTypeText); + lcl_HideAndDeleteControl(m_nPos,m_pType,m_pTypeText); break; case tpAutoIncrement: - lcl_HideAndDeleteControl(m_nPos,&pAutoIncrement,&pAutoIncrementText); + lcl_HideAndDeleteControl(m_nPos,pAutoIncrement,pAutoIncrementText); break; case tpRequired: - lcl_HideAndDeleteControl(m_nPos,&pRequired,&pRequiredText); + lcl_HideAndDeleteControl(m_nPos,pRequired,pRequiredText); break; case tpTextLen: - lcl_HideAndDeleteControl(m_nPos,&pTextLen,&pTextLenText); + lcl_HideAndDeleteControl(m_nPos,pTextLen,pTextLenText); break; case tpNumType: - lcl_HideAndDeleteControl(m_nPos,&pNumType,&pNumTypeText); + lcl_HideAndDeleteControl(m_nPos,pNumType,pNumTypeText); break; case tpLength: - lcl_HideAndDeleteControl(m_nPos,&pLength,&pLengthText); + lcl_HideAndDeleteControl(m_nPos,pLength,pLengthText); break; case tpScale: - lcl_HideAndDeleteControl(m_nPos,&pScale,&pScaleText); + lcl_HideAndDeleteControl(m_nPos,pScale,pScaleText); break; case tpFormat: // TODO: we have to check if we have to increment m_nPos again - lcl_HideAndDeleteControl(m_nPos,&pFormat,&pFormatText); + lcl_HideAndDeleteControl(m_nPos,pFormat,pFormatText); if ( pFormatSample ) { pFormatSample->Hide(); - delete pFormatSample; - pFormatSample = NULL; + pFormatSample.clear(); } break; case tpBoolDefault: - lcl_HideAndDeleteControl(m_nPos,&pBoolDefault,&pBoolDefaultText); + lcl_HideAndDeleteControl(m_nPos,pBoolDefault,pBoolDefaultText); break; } } -void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 nCol ) +void OFieldDescControl::SetPosSize( VclPtr<Control>& rControl, long nRow, sal_uInt16 nCol ) { // Calculate size @@ -1082,18 +1109,18 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n aPosition.X() = 0; } - (*ppControl)->SetSizePixel( aSize ); - aSize = (*ppControl)->GetSizePixel( ); + rControl->SetSizePixel( aSize ); + aSize = rControl->GetSizePixel( ); const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height(); aPosition.Y() += ((nRow+1)*nControl_Spacing_y) + (nRow*nControlHeight); // Display Control - (*ppControl)->SetPosSizePixel( aPosition, aSize ); - aSize = (*ppControl)->GetSizePixel(); + rControl->SetPosSizePixel( aPosition, aSize ); + aSize = rControl->GetSizePixel(); - (*ppControl)->Show(); + rControl->Show(); } void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) @@ -1458,7 +1485,7 @@ IMPL_LINK(OFieldDescControl, OnControlFocusGot, Control*, pControl ) if (pControl == pFormat) strHelpText = ModuleRes(STR_HELP_FORMAT_BUTTON); - if (!strHelpText.isEmpty() && (pHelp != NULL)) + if (!strHelpText.isEmpty() && (pHelp != nullptr)) pHelp->SetHelpText(strHelpText); m_pActFocusWindow = pControl; @@ -1584,30 +1611,30 @@ void OFieldDescControl::LoseFocus() bool OFieldDescControl::isCopyAllowed() { - bool bAllowed = (m_pActFocusWindow != NULL) && + bool bAllowed = (m_pActFocusWindow != nullptr) && (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || m_pActFocusWindow == m_pAutoIncrementValue) && - !static_cast<Edit*>(m_pActFocusWindow)->GetSelected().isEmpty(); + !static_cast<Edit*>(m_pActFocusWindow.get())->GetSelected().isEmpty(); return bAllowed; } bool OFieldDescControl::isCutAllowed() { - bool bAllowed = (m_pActFocusWindow != NULL) && + bool bAllowed = (m_pActFocusWindow != nullptr) && (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || m_pActFocusWindow == m_pAutoIncrementValue) && - !static_cast<Edit*>(m_pActFocusWindow)->GetSelected().isEmpty(); + !static_cast<Edit*>(m_pActFocusWindow.get())->GetSelected().isEmpty(); return bAllowed; } bool OFieldDescControl::isPasteAllowed() { - bool bAllowed = (m_pActFocusWindow != NULL) && + bool bAllowed = (m_pActFocusWindow != nullptr) && (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || @@ -1623,19 +1650,19 @@ bool OFieldDescControl::isPasteAllowed() void OFieldDescControl::cut() { if(isCutAllowed()) - static_cast<Edit*>(m_pActFocusWindow)->Cut(); + static_cast<Edit*>(m_pActFocusWindow.get())->Cut(); } void OFieldDescControl::copy() { if(isCopyAllowed()) // this only checks if the focus window is valid - static_cast<Edit*>(m_pActFocusWindow)->Copy(); + static_cast<Edit*>(m_pActFocusWindow.get())->Copy(); } void OFieldDescControl::paste() { if(m_pActFocusWindow) // this only checks if the focus window is valid - static_cast<Edit*>(m_pActFocusWindow)->Paste(); + static_cast<Edit*>(m_pActFocusWindow.get())->Paste(); } bool OFieldDescControl::isTextFormat(const OFieldDescription* _pFieldDescr, sal_uInt32& _nFormatKey) const diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index d48e915e3ca2..6f86962649c1 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -82,8 +82,8 @@ void OTableGrantControl::dispose() m_nDeactivateEvent = 0; } - delete m_pCheckCell; - delete m_pEdit; + m_pCheckCell.clear(); + m_pEdit.clear(); m_xTables = NULL; ::svt::EditBrowseBox::dispose(); diff --git a/dbaccess/source/ui/control/VertSplitView.cxx b/dbaccess/source/ui/control/VertSplitView.cxx index d0e5bbcf2645..3201f5e28f7a 100644 --- a/dbaccess/source/ui/control/VertSplitView.cxx +++ b/dbaccess/source/ui/control/VertSplitView.cxx @@ -44,7 +44,9 @@ OSplitterView::~OSplitterView() void OSplitterView::dispose() { - m_pRight = m_pLeft = NULL; + m_pSplitter.clear(); + m_pLeft.clear(); + m_pRight.clear(); vcl::Window::dispose(); } diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index bd3414098e9c..e30ab1314b3c 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -45,8 +45,8 @@ OConnectionURLEdit::~OConnectionURLEdit() void OConnectionURLEdit::dispose() { - SetSubEdit(VclPtr<Edit>()); - delete m_pForcedPrefix; + SetSubEdit(nullptr); + m_pForcedPrefix.clear(); Edit::dispose(); } @@ -89,7 +89,7 @@ void OConnectionURLEdit::SetText(const OUString& _rStr, const Selection& /*_rNew { // create new sub controls, if necessary if (!GetSubEdit()) - SetSubEdit(VclPtr<Edit>(new Edit(this, 0))); + SetSubEdit(new Edit(this, 0)); if ( !m_pForcedPrefix ) { m_pForcedPrefix = new FixedText(this, WB_VCENTER); diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index bf4aa1f66df8..9d2c870a6aad 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -121,6 +121,7 @@ void OSqlEdit::dispose() n->removePropertiesChangeListener(m_listener.get()); } m_ColorConfig.RemoveListener(this); + m_pView.clear(); MultiLineEditSyntaxHighlight::dispose(); } diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index c3ba08fd0ee1..ed6408696e1d 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -91,6 +91,22 @@ OCollectionView::OCollectionView( vcl::Window * pParent m_pPB_OK->SetClickHdl( LINK( this, OCollectionView, Save_Click ) ); } +OCollectionView::~OCollectionView() +{ + dispose(); +} + +void OCollectionView::dispose() +{ + m_pFTCurrentPath.clear(); + m_pNewFolder.clear(); + m_pUp.clear(); + m_pView.clear(); + m_pName.clear(); + m_pPB_OK.clear(); + ModalDialog::dispose(); +} + IMPL_LINK_NOARG(OCollectionView, Save_Click) { OUString sName = m_pName->GetText(); diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index d0d0043b0cac..c50eef04c453 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -91,7 +91,6 @@ namespace dbaui : OGenericAdministrationPage(pParent, _rId, _rUIXMLDescription, _rCoreAttrs) , m_bUserGrabFocus(false) , m_pCollection(NULL) - , m_bDelete(false) { get(m_pFT_Connection, "browseurllabel"); get(m_pConnectionURL, "browseurl"); @@ -115,13 +114,10 @@ namespace dbaui void OConnectionHelper::dispose() { - if(m_bDelete) - { - delete m_pFT_Connection; - delete m_pConnectionURL; - delete m_pPB_Connection; - delete m_pPB_CreateDB; - } + m_pFT_Connection.clear(); + m_pConnectionURL.clear(); + m_pPB_Connection.clear(); + m_pPB_CreateDB.clear(); OGenericAdministrationPage::dispose(); } diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx index 5d9ae8beb4e3..9fd69e7459c4 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx @@ -43,10 +43,10 @@ namespace dbaui OConnectionHelper( vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs); virtual ~OConnectionHelper(); virtual void dispose() SAL_OVERRIDE; - FixedText *m_pFT_Connection; - OConnectionURLEdit *m_pConnectionURL; - PushButton *m_pPB_Connection; - PushButton *m_pPB_CreateDB; + VclPtr<FixedText> m_pFT_Connection; + VclPtr<OConnectionURLEdit> m_pConnectionURL; + VclPtr<PushButton> m_pPB_Connection; + VclPtr<PushButton> m_pPB_CreateDB; OUString m_eType; // the type can't be changed in this class, so we hold it as member. public: @@ -96,7 +96,6 @@ namespace dbaui OUString impl_getURL( bool _bPrefix ) const; void impl_setURL( const OUString& _rURL, bool _bPrefix ); void implUpdateURLDependentStates() const; - bool m_bDelete; }; } // namespace dbaui diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index a8884ac397f1..1a2a7be36d28 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -109,6 +109,25 @@ namespace dbaui m_pTestJavaDriver->SetClickHdl(LINK(this,OConnectionTabPage,OnTestJavaClickHdl)); } + OConnectionTabPage::~OConnectionTabPage() + { + dispose(); + } + + void OConnectionTabPage::dispose() + { + m_pFL2.clear(); + m_pUserNameLabel.clear(); + m_pUserName.clear(); + m_pPasswordRequired.clear(); + m_pFL3.clear(); + m_pJavaDriverLabel.clear(); + m_pJavaDriver.clear(); + m_pTestJavaDriver.clear(); + m_pTestConnection.clear(); + OConnectionHelper::dispose(); + } + void OConnectionTabPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) { // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx index 9713621dfd25..53befc084d2d 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx @@ -36,25 +36,27 @@ namespace dbaui { protected: // user authentification - FixedText* m_pFL2; - FixedText* m_pUserNameLabel; - Edit* m_pUserName; - CheckBox* m_pPasswordRequired; + VclPtr<FixedText> m_pFL2; + VclPtr<FixedText> m_pUserNameLabel; + VclPtr<Edit> m_pUserName; + VclPtr<CheckBox> m_pPasswordRequired; // jdbc driver - FixedText* m_pFL3; - FixedText* m_pJavaDriverLabel; - Edit* m_pJavaDriver; - PushButton* m_pTestJavaDriver; + VclPtr<FixedText> m_pFL3; + VclPtr<FixedText> m_pJavaDriverLabel; + VclPtr<Edit> m_pJavaDriver; + VclPtr<PushButton> m_pTestJavaDriver; // connection test - PushButton* m_pTestConnection; + VclPtr<PushButton> m_pTestConnection; // called when the test connection button was clicked - DECL_LINK(OnTestJavaClickHdl,PushButton*); - DECL_LINK(OnEditModified,Edit*); + DECL_LINK(OnTestJavaClickHdl, PushButton*); + DECL_LINK(OnEditModified, Edit*); public: + virtual ~OConnectionTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet ); virtual bool FillItemSet (SfxItemSet* _rCoreAttrs) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index ce72b8d20405..0d9dd54eeb9e 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -119,6 +119,18 @@ namespace dbaui SetRoadmapStateValue(false); } + OConnectionTabPageSetup::~OConnectionTabPageSetup() + { + dispose(); + } + + void OConnectionTabPageSetup::dispose() + { + m_pHelpText.clear(); + m_pHeaderText.clear(); + OConnectionHelper::dispose(); + } + void OConnectionTabPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) { m_eType = m_pAdminDialog->getDatasourceType(_rSet); diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx index b417c7882125..633dcb79b73c 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx @@ -39,13 +39,15 @@ namespace dbaui bool m_bUserGrabFocus : 1; protected: - FixedText *m_pHelpText; - FixedText *m_pHeaderText; + VclPtr<FixedText> m_pHelpText; + VclPtr<FixedText> m_pHeaderText; // called when the test connection button was clicked DECL_LINK(OnEditModified,Edit*); public: + virtual ~OConnectionTabPageSetup(); + virtual void dispose() SAL_OVERRIDE; static OGenericAdministrationPage* CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); static OGenericAdministrationPage* CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); static OGenericAdministrationPage* CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 850a91ad4e52..57356b64e58a 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -81,7 +81,7 @@ using namespace ::com::sun::star; void OTextConnectionPageSetup::dispose() { - DELETEZ(m_pTextConnectionHelper); + m_pTextConnectionHelper.clear(); OConnectionTabPageSetup::dispose(); } @@ -156,6 +156,25 @@ using namespace ::com::sun::star; SetRoadmapStateValue(false); } + OLDAPConnectionPageSetup::~OLDAPConnectionPageSetup() + { + dispose(); + } + + void OLDAPConnectionPageSetup::dispose() + { + m_pFTHelpText.clear(); + m_pFTHostServer.clear(); + m_pETHostServer.clear(); + m_pFTBaseDN.clear(); + m_pETBaseDN.clear(); + m_pFTPortNumber.clear(); + m_pNFPortNumber.clear(); + m_pFTDefaultPortNumber.clear(); + m_pCBUseSSL.clear(); + OGenericAdministrationPage::dispose(); + } + bool OLDAPConnectionPageSetup::FillItemSet( SfxItemSet* _rSet ) { bool bChangedSomething = false; @@ -240,6 +259,19 @@ using namespace ::com::sun::star; m_pNATIVEDatabase->SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected)); } + OMySQLIntroPageSetup::~OMySQLIntroPageSetup() + { + dispose(); + } + + void OMySQLIntroPageSetup::dispose() + { + m_pODBCDatabase.clear(); + m_pJDBCDatabase.clear(); + m_pNATIVEDatabase.clear(); + OGenericAdministrationPage::dispose(); + } + IMPL_LINK(OMySQLIntroPageSetup, OnSetupModeSelected, RadioButton*, /*_pBox*/) { maClickHdl.Call( this ); @@ -308,6 +340,7 @@ using namespace ::com::sun::star; void MySQLNativeSetupPage::dispose() { m_aMySQLSettings.disposeAndClear(); + m_pHelpText.clear(); OGenericAdministrationPage::dispose(); } @@ -398,6 +431,28 @@ using namespace ::com::sun::star; SetRoadmapStateValue(false); } + OGeneralSpecialJDBCConnectionPageSetup::~OGeneralSpecialJDBCConnectionPageSetup() + { + dispose(); + } + + void OGeneralSpecialJDBCConnectionPageSetup::dispose() + { + m_pHeaderText.clear(); + m_pFTHelpText.clear(); + m_pFTDatabasename.clear(); + m_pETDatabasename.clear(); + m_pFTHostname.clear(); + m_pETHostname.clear(); + m_pFTPortNumber.clear(); + m_pFTDefaultPortNumber.clear(); + m_pNFPortNumber.clear(); + m_pFTDriverClass.clear(); + m_pETDriverClass.clear(); + m_pPBTestJavaDriver.clear(); + OGenericAdministrationPage::dispose(); + } + OGenericAdministrationPage* OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ) { return ( new OGeneralSpecialJDBCConnectionPageSetup( pParent, @@ -540,6 +595,19 @@ using namespace ::com::sun::star; m_pPBTestJavaDriver->SetClickHdl(LINK(this,OJDBCConnectionPageSetup,OnTestJavaClickHdl)); } + OJDBCConnectionPageSetup::~OJDBCConnectionPageSetup() + { + dispose(); + } + + void OJDBCConnectionPageSetup::dispose() + { + m_pFTDriverClass.clear(); + m_pETDriverClass.clear(); + m_pPBTestJavaDriver.clear(); + OConnectionTabPageSetup::dispose(); + } + void OJDBCConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) { _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pETDriverClass)); @@ -645,6 +713,17 @@ using namespace ::com::sun::star; m_pPasswordrequired->SetToggleHdl(getControlModifiedLink()); } + OSpreadSheetConnectionPageSetup::~OSpreadSheetConnectionPageSetup() + { + dispose(); + } + + void OSpreadSheetConnectionPageSetup::dispose() + { + m_pPasswordrequired.clear(); + OConnectionTabPageSetup::dispose(); + } + void OSpreadSheetConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlList*/) { } @@ -689,6 +768,21 @@ using namespace ::com::sun::star; LayoutHelper::fitSizeRightAligned( *m_pPBTestConnection ); } + OAuthentificationPageSetup::~OAuthentificationPageSetup() + { + dispose(); + } + + void OAuthentificationPageSetup::dispose() + { + m_pFTHelpText.clear(); + m_pFTUserName.clear(); + m_pETUserName.clear(); + m_pCBPasswordRequired.clear(); + m_pPBTestConnection.clear(); + OGenericAdministrationPage::dispose(); + } + void OAuthentificationPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) { _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTHelpText)); @@ -754,6 +848,24 @@ using namespace ::com::sun::star; m_pRBRegisterDataSource->SetState(true); } + OFinalDBPageSetup::~OFinalDBPageSetup() + { + dispose(); + } + + void OFinalDBPageSetup::dispose() + { + m_pFTFinalHeader.clear(); + m_pFTFinalHelpText.clear(); + m_pRBRegisterDataSource.clear(); + m_pRBDontregisterDataSource.clear(); + m_pFTAdditionalSettings.clear(); + m_pCBOpenAfterwards.clear(); + m_pCBStartTableWizard.clear(); + m_pFTFinalText.clear(); + OGenericAdministrationPage::dispose(); + } + bool OFinalDBPageSetup::IsDatabaseDocumentToBeRegistered() { return m_pRBRegisterDataSource->IsChecked() && m_pRBRegisterDataSource->IsEnabled(); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx index 3b3ed06b8bd5..23416fc53fb6 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -42,9 +42,11 @@ namespace dbaui virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; static OGenericAdministrationPage* CreateSpreadSheetTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); OSpreadSheetConnectionPageSetup(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); + virtual ~OSpreadSheetConnectionPageSetup(); + virtual void dispose() SAL_OVERRIDE; protected: - CheckBox *m_pPasswordrequired; + VclPtr<CheckBox> m_pPasswordrequired; protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; @@ -57,15 +59,14 @@ namespace dbaui class OTextConnectionPageSetup : public OConnectionTabPageSetup { public: + VclPtr<OTextConnectionHelper> m_pTextConnectionHelper; + virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; - static OGenericAdministrationPage* CreateTextTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); + static OGenericAdministrationPage* CreateTextTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); OTextConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); - OTextConnectionHelper* m_pTextConnectionHelper; - private: - - protected: virtual ~OTextConnectionPageSetup(); virtual void dispose() SAL_OVERRIDE; + protected: virtual bool prepareLeave() SAL_OVERRIDE; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; @@ -83,6 +84,8 @@ namespace dbaui virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; static OGenericAdministrationPage* CreateLDAPTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); OLDAPConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); + virtual ~OLDAPConnectionPageSetup(); + virtual void dispose() SAL_OVERRIDE; virtual Link getControlModifiedLink() SAL_OVERRIDE { return LINK(this, OLDAPConnectionPageSetup, OnEditModified); } protected: @@ -92,22 +95,22 @@ namespace dbaui DECL_LINK(OnEditModified,Edit*); private: - FixedText* m_pFTHelpText; - FixedText* m_pFTHostServer; - Edit* m_pETHostServer; - FixedText* m_pFTBaseDN; - Edit* m_pETBaseDN; - FixedText* m_pFTPortNumber; - NumericField* m_pNFPortNumber; - FixedText* m_pFTDefaultPortNumber; - CheckBox* m_pCBUseSSL; + VclPtr<FixedText> m_pFTHelpText; + VclPtr<FixedText> m_pFTHostServer; + VclPtr<Edit> m_pETHostServer; + VclPtr<FixedText> m_pFTBaseDN; + VclPtr<Edit> m_pETBaseDN; + VclPtr<FixedText> m_pFTPortNumber; + VclPtr<NumericField> m_pNFPortNumber; + VclPtr<FixedText> m_pFTDefaultPortNumber; + VclPtr<CheckBox> m_pCBUseSSL; }; // MySQLNativeSetupPage class MySQLNativeSetupPage : public OGenericAdministrationPage { private: - FixedText *m_pHelpText; + VclPtr<FixedText> m_pHelpText; VclPtr<MySQLNativeSettings> m_aMySQLSettings; public: @@ -141,6 +144,8 @@ namespace dbaui , sal_uInt16 _nHelpTextResId , sal_uInt16 _nHeaderTextResId , sal_uInt16 _nDriverClassId ); + virtual ~OGeneralSpecialJDBCConnectionPageSetup(); + virtual void dispose() SAL_OVERRIDE; static OGenericAdministrationPage* CreateMySQLJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); static OGenericAdministrationPage* CreateOracleJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); @@ -153,19 +158,19 @@ namespace dbaui DECL_LINK(OnTestJavaClickHdl,PushButton*); DECL_LINK(OnEditModified,Edit*); - FixedText* m_pHeaderText; - FixedText* m_pFTHelpText; - FixedText* m_pFTDatabasename; - Edit* m_pETDatabasename; - FixedText* m_pFTHostname; - Edit* m_pETHostname; - FixedText* m_pFTPortNumber; - FixedText* m_pFTDefaultPortNumber; - NumericField* m_pNFPortNumber; - - FixedText* m_pFTDriverClass; - Edit* m_pETDriverClass; - PushButton* m_pPBTestJavaDriver; + VclPtr<FixedText> m_pHeaderText; + VclPtr<FixedText> m_pFTHelpText; + VclPtr<FixedText> m_pFTDatabasename; + VclPtr<Edit> m_pETDatabasename; + VclPtr<FixedText> m_pFTHostname; + VclPtr<Edit> m_pETHostname; + VclPtr<FixedText> m_pFTPortNumber; + VclPtr<FixedText> m_pFTDefaultPortNumber; + VclPtr<NumericField> m_pNFPortNumber; + + VclPtr<FixedText> m_pFTDriverClass; + VclPtr<Edit> m_pETDriverClass; + VclPtr<PushButton> m_pPBTestJavaDriver; OUString m_sDefaultJdbcDriverName; sal_uInt16 m_nPortId; @@ -176,6 +181,8 @@ namespace dbaui { public: OJDBCConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); + virtual ~OJDBCConnectionPageSetup(); + virtual void dispose() SAL_OVERRIDE; static OGenericAdministrationPage* CreateJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); protected: @@ -188,9 +195,9 @@ namespace dbaui DECL_LINK(OnTestJavaClickHdl,PushButton*); DECL_LINK(OnEditModified,Edit*); - FixedText* m_pFTDriverClass; - Edit* m_pETDriverClass; - PushButton* m_pPBTestJavaDriver; + VclPtr<FixedText> m_pFTDriverClass; + VclPtr<Edit> m_pETDriverClass; + VclPtr<PushButton> m_pPBTestJavaDriver; }; // OJDBCConnectionPageSetup @@ -205,6 +212,8 @@ namespace dbaui }; OMySQLIntroPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); + virtual ~OMySQLIntroPageSetup(); + virtual void dispose() SAL_OVERRIDE; static OMySQLIntroPageSetup* CreateMySQLIntroTabPage( vcl::Window* _pParent, const SfxItemSet& _rAttrSet ); ConnectionType getMySQLMode(); @@ -220,9 +229,9 @@ namespace dbaui virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; private: - RadioButton *m_pODBCDatabase; - RadioButton *m_pJDBCDatabase; - RadioButton *m_pNATIVEDatabase; + VclPtr<RadioButton> m_pODBCDatabase; + VclPtr<RadioButton> m_pJDBCDatabase; + VclPtr<RadioButton> m_pNATIVEDatabase; DECL_LINK(OnSetupModeSelected, RadioButton*); @@ -235,13 +244,15 @@ namespace dbaui virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; static OGenericAdministrationPage* CreateAuthentificationTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); OAuthentificationPageSetup(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); + virtual ~OAuthentificationPageSetup(); + virtual void dispose() SAL_OVERRIDE; protected: - FixedText* m_pFTHelpText; - FixedText* m_pFTUserName; - Edit* m_pETUserName; - CheckBox* m_pCBPasswordRequired; - PushButton* m_pPBTestConnection; + VclPtr<FixedText> m_pFTHelpText; + VclPtr<FixedText> m_pFTUserName; + VclPtr<Edit> m_pETUserName; + VclPtr<CheckBox> m_pCBPasswordRequired; + VclPtr<PushButton> m_pPBTestConnection; protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; @@ -256,16 +267,18 @@ namespace dbaui virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; static OGenericAdministrationPage* CreateFinalDBTabPageSetup( vcl::Window* pParent, const SfxItemSet& _rAttrSet); - FixedText* m_pFTFinalHeader; - FixedText* m_pFTFinalHelpText; - RadioButton* m_pRBRegisterDataSource; - RadioButton* m_pRBDontregisterDataSource; - FixedText* m_pFTAdditionalSettings; - CheckBox* m_pCBOpenAfterwards; - CheckBox* m_pCBStartTableWizard; - FixedText* m_pFTFinalText; + VclPtr<FixedText> m_pFTFinalHeader; + VclPtr<FixedText> m_pFTFinalHelpText; + VclPtr<RadioButton> m_pRBRegisterDataSource; + VclPtr<RadioButton> m_pRBDontregisterDataSource; + VclPtr<FixedText> m_pFTAdditionalSettings; + VclPtr<CheckBox> m_pCBOpenAfterwards; + VclPtr<CheckBox> m_pCBStartTableWizard; + VclPtr<FixedText> m_pFTFinalText; OFinalDBPageSetup(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); + virtual ~OFinalDBPageSetup(); + virtual void dispose() SAL_OVERRIDE; bool IsDatabaseDocumentToBeRegistered(); bool IsDatabaseDocumentToBeOpened(); bool IsTableWizardToBeStarted(); diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx index 4b46778afb92..890a7acc33cd 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx @@ -35,6 +35,7 @@ #include <svl/itemset.hxx> #include <com/sun/star/frame/XModel.hpp> #include <svl/poolitem.hxx> +#include <vcl/vclptr.hxx> namespace vcl { class Window; } namespace dbaui @@ -68,7 +69,7 @@ namespace dbaui MapInt2String m_aDirectPropTranslator; /// translating property id's into names (direct properties of a data source) MapInt2String m_aIndirectPropTranslator; /// translating property id's into names (indirect properties of a data source) - vcl::Window* m_pParent; + VclPtr<vcl::Window> m_pParent; IItemSetHelper* m_pItemSetHelper; public: diff --git a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx index cfdab7758b35..716c895161a9 100644 --- a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx +++ b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx @@ -28,6 +28,19 @@ QueryPropertiesDialog::QueryPropertiesDialog( m_pLB_Limit->SetValue( nLimit ); } +QueryPropertiesDialog::~QueryPropertiesDialog() +{ + dispose(); +} + +void QueryPropertiesDialog::dispose() +{ + m_pRB_Distinct.clear(); + m_pRB_NonDistinct.clear(); + m_pLB_Limit.clear(); + ModalDialog::dispose(); +} + } ///dbaui namespace /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx index f0626ae3f698..9a27bd7270a9 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.cxx +++ b/dbaccess/source/ui/dlg/RelationDlg.cxx @@ -88,6 +88,26 @@ ORelationDialog::ORelationDialog( OJoinTableView* pParent, m_xTableControl->NotifyCellChange(); } +ORelationDialog::~ORelationDialog() +{ + dispose(); +} + +void ORelationDialog::dispose() +{ + m_pRB_NoCascUpd.clear(); + m_pRB_CascUpd.clear(); + m_pRB_CascUpdNull.clear(); + m_pRB_CascUpdDefault.clear(); + m_pRB_NoCascDel.clear(); + m_pRB_CascDel.clear(); + m_pRB_CascDelNull.clear(); + m_pRB_CascDelDefault.clear(); + m_pPB_OK.clear(); + ModalDialog::dispose(); +} + + void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionData) { ORelationTableConnectionData* pConnData = static_cast<ORelationTableConnectionData*>(_pConnectionData.get()); diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index c10751766928..cc2079dcfac3 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -114,7 +114,7 @@ namespace dbaui struct SectionDescriptor { short nFlag; - vcl::Window* pFirstControl; + VclPtr<vcl::Window> pFirstControl; } aSections[] = { { TC_EXTENSION, m_pExtensionHeader }, { TC_SEPARATORS, m_pFormatHeader }, @@ -151,6 +151,35 @@ namespace dbaui Show(); } + OTextConnectionHelper::~OTextConnectionHelper() + { + dispose(); + } + + void OTextConnectionHelper::dispose() + { + m_pExtensionHeader.clear(); + m_pAccessTextFiles.clear(); + m_pAccessCSVFiles.clear(); + m_pAccessOtherFiles.clear(); + m_pOwnExtension.clear(); + m_pExtensionExample.clear(); + m_pFormatHeader.clear(); + m_pFieldSeparatorLabel.clear(); + m_pFieldSeparator.clear(); + m_pTextSeparatorLabel.clear(); + m_pTextSeparator.clear(); + m_pDecimalSeparatorLabel.clear(); + m_pDecimalSeparator.clear(); + m_pThousandsSeparatorLabel.clear(); + m_pThousandsSeparator.clear(); + m_pRowHeader.clear(); + m_pCharSetHeader.clear(); + m_pCharSetLabel.clear(); + m_pCharSet.clear(); + TabPage::dispose(); + } + IMPL_LINK(OTextConnectionHelper, OnControlModified, Control*, /*EMPTYARG*/) { callModifiedHdl(); diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx index 03dde73cc6dd..56610e6e615b 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx @@ -48,27 +48,29 @@ namespace dbaui public: OTextConnectionHelper( vcl::Window* pParent, const short _nAvailableSections ); + virtual ~OTextConnectionHelper(); + virtual void dispose() SAL_OVERRIDE; private: - FixedText *m_pExtensionHeader; - RadioButton *m_pAccessTextFiles; - RadioButton *m_pAccessCSVFiles; - RadioButton *m_pAccessOtherFiles; - Edit *m_pOwnExtension; - FixedText *m_pExtensionExample; - FixedText *m_pFormatHeader; - FixedText *m_pFieldSeparatorLabel; - ComboBox *m_pFieldSeparator; - FixedText *m_pTextSeparatorLabel; - ComboBox *m_pTextSeparator; - FixedText *m_pDecimalSeparatorLabel; - ComboBox *m_pDecimalSeparator; - FixedText *m_pThousandsSeparatorLabel; - ComboBox *m_pThousandsSeparator; - CheckBox *m_pRowHeader; - FixedText *m_pCharSetHeader; - FixedText *m_pCharSetLabel; - CharSetListBox *m_pCharSet; + VclPtr<FixedText> m_pExtensionHeader; + VclPtr<RadioButton> m_pAccessTextFiles; + VclPtr<RadioButton> m_pAccessCSVFiles; + VclPtr<RadioButton> m_pAccessOtherFiles; + VclPtr<Edit> m_pOwnExtension; + VclPtr<FixedText> m_pExtensionExample; + VclPtr<FixedText> m_pFormatHeader; + VclPtr<FixedText> m_pFieldSeparatorLabel; + VclPtr<ComboBox> m_pFieldSeparator; + VclPtr<FixedText> m_pTextSeparatorLabel; + VclPtr<ComboBox> m_pTextSeparator; + VclPtr<FixedText> m_pDecimalSeparatorLabel; + VclPtr<ComboBox> m_pDecimalSeparator; + VclPtr<FixedText> m_pThousandsSeparatorLabel; + VclPtr<ComboBox> m_pThousandsSeparator; + VclPtr<CheckBox> m_pRowHeader; + VclPtr<FixedText> m_pCharSetHeader; + VclPtr<FixedText> m_pCharSetLabel; + VclPtr<CharSetListBox> m_pCharSet; OUString m_aFieldSeparatorList; OUString m_aTextSeparatorList; OUString m_aTextNone; diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index 219440b0d496..23621cc7931c 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -51,17 +51,27 @@ using namespace comphelper; class OPasswordDialog : public ModalDialog { - VclFrame* m_pUser; - Edit* m_pEDOldPassword; - Edit* m_pEDPassword; - Edit* m_pEDPasswordRepeat; - OKButton* m_pOKBtn; + VclPtr<VclFrame> m_pUser; + VclPtr<Edit> m_pEDOldPassword; + VclPtr<Edit> m_pEDPassword; + VclPtr<Edit> m_pEDPasswordRepeat; + VclPtr<OKButton> m_pOKBtn; DECL_LINK( OKHdl_Impl, void * ); DECL_LINK( ModifiedHdl, Edit * ); public: OPasswordDialog( vcl::Window* pParent,const OUString& _sUserName); + virtual ~OPasswordDialog() { dispose(); } + virtual void dispose() SAL_OVERRIDE + { + m_pUser.clear(); + m_pEDOldPassword.clear(); + m_pEDPassword.clear(); + m_pEDPasswordRepeat.clear(); + m_pOKBtn.clear(); + ModalDialog::dispose(); + } OUString GetOldPassword() const { return m_pEDOldPassword->GetText(); } OUString GetNewPassword() const { return m_pEDPassword->GetText(); } @@ -138,6 +148,10 @@ void OUserAdmin::dispose() { m_xConnection = NULL; m_TableCtrl.disposeAndClear(); + m_pUSER.clear(); + m_pNEWUSER.clear(); + m_pCHANGEPWD.clear(); + m_pDELETEUSER.clear(); OGenericAdministrationPage::dispose(); } diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx index 76922bb421c4..5bed22342ef9 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.hxx +++ b/dbaccess/source/ui/dlg/UserAdmin.hxx @@ -41,10 +41,10 @@ namespace dbaui class OUserAdmin : public OGenericAdministrationPage { protected: - ListBox *m_pUSER; - PushButton *m_pNEWUSER; - PushButton *m_pCHANGEPWD; - PushButton *m_pDELETEUSER; + VclPtr<ListBox> m_pUSER; + VclPtr<PushButton> m_pNEWUSER; + VclPtr<PushButton> m_pCHANGEPWD; + VclPtr<PushButton> m_pDELETEUSER; VclPtr<OTableGrantControl> m_TableCtrl; // show the grant rights of one user ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index 9b6f331202ac..08e7be864ad4 100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -168,6 +168,28 @@ namespace dbaui #endif } + MySQLNativeSettings::~MySQLNativeSettings() + { + dispose(); + } + + void MySQLNativeSettings::dispose() + { + m_pDatabaseNameLabel.clear(); + m_pDatabaseName.clear(); + m_pHostPortRadio.clear(); + m_pSocketRadio.clear(); + m_pNamedPipeRadio.clear(); + m_pHostNameLabel.clear(); + m_pHostName.clear(); + m_pPortLabel.clear(); + m_pPort.clear(); + m_pDefaultPort.clear(); + m_pSocket.clear(); + m_pNamedPipe.clear(); + TabPage::dispose(); + } + void MySQLNativeSettings::fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ) { _rControlList.push_back( new OSaveValueWrapper< Edit >( m_pDatabaseName ) ); diff --git a/dbaccess/source/ui/dlg/admincontrols.hxx b/dbaccess/source/ui/dlg/admincontrols.hxx index e1daa864e730..544ef8b89a24 100644 --- a/dbaccess/source/ui/dlg/admincontrols.hxx +++ b/dbaccess/source/ui/dlg/admincontrols.hxx @@ -35,25 +35,26 @@ namespace dbaui class MySQLNativeSettings : public TabPage { private: - FixedText *m_pDatabaseNameLabel; - Edit *m_pDatabaseName; - RadioButton *m_pHostPortRadio; - RadioButton *m_pSocketRadio; - RadioButton *m_pNamedPipeRadio; - FixedText *m_pHostNameLabel; - Edit *m_pHostName; - FixedText *m_pPortLabel; - NumericField *m_pPort; - FixedText *m_pDefaultPort; - Edit *m_pSocket; - Edit *m_pNamedPipe; + VclPtr<FixedText> m_pDatabaseNameLabel; + VclPtr<Edit> m_pDatabaseName; + VclPtr<RadioButton> m_pHostPortRadio; + VclPtr<RadioButton> m_pSocketRadio; + VclPtr<RadioButton> m_pNamedPipeRadio; + VclPtr<FixedText> m_pHostNameLabel; + VclPtr<Edit> m_pHostName; + VclPtr<FixedText> m_pPortLabel; + VclPtr<NumericField> m_pPort; + VclPtr<FixedText> m_pDefaultPort; + VclPtr<Edit> m_pSocket; + VclPtr<Edit> m_pNamedPipe; ::svt::ControlDependencyManager m_aControlDependencies; public: MySQLNativeSettings( vcl::Window& _rParent, const Link& _rControlModificationLink ); - + virtual ~MySQLNativeSettings(); + virtual void dispose() SAL_OVERRIDE; void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ); void fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ); diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index 77f4278104a3..1d6438c7884d 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -231,7 +231,7 @@ namespace dbaui is modified. The implementation just calls callModifiedHdl. */ DECL_LINK(OnControlModified, void*); - DECL_LINK(OnTestConnectionClickHdl,PushButton*); + DECL_LINK(OnTestConnectionClickHdl, PushButton*); /// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method> virtual Link getControlModifiedLink() { return LINK(this, OGenericAdministrationPage, OnControlModified); } diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 707645b93ac1..27d83e58522c 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -368,6 +368,12 @@ OAddTableDlg::~OAddTableDlg() void OAddTableDlg::dispose() { m_rContext.onWindowClosing( this ); + m_pCaseTables.clear(); + m_pCaseQueries.clear(); + m_pTableList.clear(); + m_pQueryList.clear(); + m_pAddButton.clear(); + m_pCloseButton.clear(); ModelessDialog::dispose(); } diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index d9d36cdfc36c..859decf8f89b 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -48,7 +48,7 @@ namespace dbaui // SpecialSettingsPage struct BooleanSettingDesc { - CheckBox** ppControl; // the dialog's control which displays this setting + VclPtr<CheckBox>& ppControl; // the dialog's control which displays this setting OString sControlId; // the widget name of the control in the .ui sal_uInt16 nItemId; // the ID of the item (in an SfxItemSet) which corresponds to this setting bool bInvertedDisplay; // true if and only if the checkbox is checked when the item is sal_False, and vice versa @@ -95,14 +95,14 @@ namespace dbaui sal_uInt16 nItemId = setting->nItemId; if ( rFeatures.has( nItemId ) ) { - get((*setting->ppControl), setting->sControlId); - (*setting->ppControl)->SetClickHdl( getControlModifiedLink() ); - (*setting->ppControl)->Show(); + get(setting->ppControl, setting->sControlId); + setting->ppControl->SetClickHdl( getControlModifiedLink() ); + setting->ppControl->Show(); // check whether this must be a tristate check box const SfxPoolItem& rItem = _rCoreAttrs.Get( nItemId ); if ( rItem.ISA( OptionalBoolItem ) ) - (*setting->ppControl)->EnableTriState( true ); + setting->ppControl->EnableTriState( true ); } } @@ -140,6 +140,26 @@ namespace dbaui void SpecialSettingsPage::dispose() { m_aControlDependencies.clear(); + m_pIsSQL92Check.clear(); + m_pAppendTableAlias.clear(); + m_pAsBeforeCorrelationName.clear(); + m_pEnableOuterJoin.clear(); + m_pIgnoreDriverPrivileges.clear(); + m_pParameterSubstitution.clear(); + m_pSuppressVersionColumn.clear(); + m_pCatalog.clear(); + m_pSchema.clear(); + m_pIndexAppendix.clear(); + m_pDosLineEnds.clear(); + m_pCheckRequiredFields.clear(); + m_pIgnoreCurrency.clear(); + m_pEscapeDateTime.clear(); + m_pPrimaryKeySupport.clear(); + m_pRespectDriverResultSetType.clear(); + m_pBooleanComparisonModeLabel.clear(); + m_pBooleanComparisonMode.clear(); + m_pMaxRowScanLabel.clear(); + m_pMaxRowScan.clear(); OGenericAdministrationPage::dispose(); } @@ -149,28 +169,28 @@ namespace dbaui // for easier maintenance, write the table in this form, then copy it to m_aBooleanSettings BooleanSettingDesc aSettings[] = { - { &m_pIsSQL92Check, "usesql92", DSID_SQL92CHECK, false }, - { &m_pAppendTableAlias, "append", DSID_APPEND_TABLE_ALIAS, false }, - { &m_pAsBeforeCorrelationName, "useas", DSID_AS_BEFORE_CORRNAME, false }, - { &m_pEnableOuterJoin, "useoj", DSID_ENABLEOUTERJOIN, false }, - { &m_pIgnoreDriverPrivileges, "ignoreprivs", DSID_IGNOREDRIVER_PRIV, false }, - { &m_pParameterSubstitution, "replaceparams", DSID_PARAMETERNAMESUBST, false }, - { &m_pSuppressVersionColumn, "displayver", DSID_SUPPRESSVERSIONCL, true }, - { &m_pCatalog, "usecatalogname", DSID_CATALOG, false }, - { &m_pSchema, "useschemaname", DSID_SCHEMA, false }, - { &m_pIndexAppendix, "createindex", DSID_INDEXAPPENDIX, false }, - { &m_pDosLineEnds, "eol", DSID_DOSLINEENDS, false }, - { &m_pCheckRequiredFields, "inputchecks", DSID_CHECK_REQUIRED_FIELDS, false }, - { &m_pIgnoreCurrency, "ignorecurrency", DSID_IGNORECURRENCY, false }, - { &m_pEscapeDateTime, "useodbcliterals", DSID_ESCAPE_DATETIME, false }, - { &m_pPrimaryKeySupport, "primarykeys", DSID_PRIMARY_KEY_SUPPORT, false }, - { &m_pRespectDriverResultSetType, "resulttype", DSID_RESPECTRESULTSETTYPE, false }, - { NULL, "", 0, false } + { m_pIsSQL92Check, "usesql92", DSID_SQL92CHECK, false }, + { m_pAppendTableAlias, "append", DSID_APPEND_TABLE_ALIAS, false }, + { m_pAsBeforeCorrelationName, "useas", DSID_AS_BEFORE_CORRNAME, false }, + { m_pEnableOuterJoin, "useoj", DSID_ENABLEOUTERJOIN, false }, + { m_pIgnoreDriverPrivileges, "ignoreprivs", DSID_IGNOREDRIVER_PRIV, false }, + { m_pParameterSubstitution, "replaceparams", DSID_PARAMETERNAMESUBST, false }, + { m_pSuppressVersionColumn, "displayver", DSID_SUPPRESSVERSIONCL, true }, + { m_pCatalog, "usecatalogname", DSID_CATALOG, false }, + { m_pSchema, "useschemaname", DSID_SCHEMA, false }, + { m_pIndexAppendix, "createindex", DSID_INDEXAPPENDIX, false }, + { m_pDosLineEnds, "eol", DSID_DOSLINEENDS, false }, + { m_pCheckRequiredFields, "ignorecurrency", DSID_CHECK_REQUIRED_FIELDS, false }, + { m_pIgnoreCurrency, "inputchecks", DSID_IGNORECURRENCY, false }, + { m_pEscapeDateTime, "useodbcliterals", DSID_ESCAPE_DATETIME, false }, + { m_pPrimaryKeySupport, "primarykeys", DSID_PRIMARY_KEY_SUPPORT, false }, + { m_pRespectDriverResultSetType, "resulttype", DSID_RESPECTRESULTSETTYPE, false }, + { NULL, "", 0, false } }; - for ( const BooleanSettingDesc* pCopy = aSettings; pCopy->nItemId != 0; ++pCopy ) + for ( const BooleanSettingDesc& pCopy : aSettings ) { - m_aBooleanSettings.push_back( *pCopy ); + m_aBooleanSettings.push_back( pCopy ); } } @@ -193,9 +213,9 @@ namespace dbaui ++setting ) { - if ( *setting->ppControl ) + if ( setting->ppControl ) { - _rControlList.push_back( new OSaveValueWrapper< CheckBox >( *setting->ppControl ) ); + _rControlList.push_back( new OSaveValueWrapper< CheckBox >( setting->ppControl ) ); } } @@ -223,7 +243,7 @@ namespace dbaui ++setting ) { - if ( !*setting->ppControl ) + if ( !setting->ppControl ) continue; ::boost::optional< bool > aValue(false); @@ -243,14 +263,14 @@ namespace dbaui if ( !aValue ) { - (*setting->ppControl)->SetState( TRISTATE_INDET ); + setting->ppControl->SetState( TRISTATE_INDET ); } else { bool bValue = *aValue; if ( setting->bInvertedDisplay ) bValue = !bValue; - (*setting->ppControl)->Check( bValue ); + setting->ppControl->Check( bValue ); } } @@ -280,9 +300,9 @@ namespace dbaui ++setting ) { - if ( !*setting->ppControl ) + if ( !setting->ppControl ) continue; - fillBool( *_rSet, *setting->ppControl, setting->nItemId, bChangedSomething, setting->bInvertedDisplay ); + fillBool( *_rSet, setting->ppControl, setting->nItemId, bChangedSomething, setting->bInvertedDisplay ); } // the non-boolean items @@ -329,6 +349,12 @@ namespace dbaui void GeneratedValuesPage::dispose() { m_aControlDependencies.clear(); + m_pAutoFrame.clear(); + m_pAutoRetrievingEnabled.clear(); + m_pAutoIncrementLabel.clear(); + m_pAutoIncrement.clear(); + m_pAutoRetrievingLabel.clear(); + m_pAutoRetrieving.clear(); OGenericAdministrationPage::dispose(); } diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index 40f1643cd036..7c08e920a687 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -40,28 +40,28 @@ namespace dbaui class SpecialSettingsPage : public OGenericAdministrationPage { protected: - CheckBox* m_pIsSQL92Check; - CheckBox* m_pAppendTableAlias; - CheckBox* m_pAsBeforeCorrelationName; - CheckBox* m_pEnableOuterJoin; - CheckBox* m_pIgnoreDriverPrivileges; - CheckBox* m_pParameterSubstitution; - CheckBox* m_pSuppressVersionColumn; - CheckBox* m_pCatalog; - CheckBox* m_pSchema; - CheckBox* m_pIndexAppendix; - CheckBox* m_pDosLineEnds; - CheckBox* m_pCheckRequiredFields; - CheckBox* m_pIgnoreCurrency; - CheckBox* m_pEscapeDateTime; - CheckBox* m_pPrimaryKeySupport; - CheckBox* m_pRespectDriverResultSetType; - - FixedText* m_pBooleanComparisonModeLabel; - ListBox* m_pBooleanComparisonMode; - - FixedText* m_pMaxRowScanLabel; - NumericField* m_pMaxRowScan; + VclPtr<CheckBox> m_pIsSQL92Check; + VclPtr<CheckBox> m_pAppendTableAlias; + VclPtr<CheckBox> m_pAsBeforeCorrelationName; + VclPtr<CheckBox> m_pEnableOuterJoin; + VclPtr<CheckBox> m_pIgnoreDriverPrivileges; + VclPtr<CheckBox> m_pParameterSubstitution; + VclPtr<CheckBox> m_pSuppressVersionColumn; + VclPtr<CheckBox> m_pCatalog; + VclPtr<CheckBox> m_pSchema; + VclPtr<CheckBox> m_pIndexAppendix; + VclPtr<CheckBox> m_pDosLineEnds; + VclPtr<CheckBox> m_pCheckRequiredFields; + VclPtr<CheckBox> m_pIgnoreCurrency; + VclPtr<CheckBox> m_pEscapeDateTime; + VclPtr<CheckBox> m_pPrimaryKeySupport; + VclPtr<CheckBox> m_pRespectDriverResultSetType; + + VclPtr<FixedText> m_pBooleanComparisonModeLabel; + VclPtr<ListBox> m_pBooleanComparisonMode; + + VclPtr<FixedText> m_pMaxRowScanLabel; + VclPtr<NumericField> m_pMaxRowScan; ::svt::ControlDependencyManager m_aControlDependencies; @@ -98,12 +98,12 @@ namespace dbaui { protected: - VclFrame* m_pAutoFrame; - CheckBox* m_pAutoRetrievingEnabled; - FixedText* m_pAutoIncrementLabel; - Edit* m_pAutoIncrement; - FixedText* m_pAutoRetrievingLabel; - Edit* m_pAutoRetrieving; + VclPtr<VclFrame> m_pAutoFrame; + VclPtr<CheckBox> m_pAutoRetrievingEnabled; + VclPtr<FixedText> m_pAutoIncrementLabel; + VclPtr<Edit> m_pAutoIncrement; + VclPtr<FixedText> m_pAutoRetrievingLabel; + VclPtr<Edit> m_pAutoRetrieving; ::svt::ControlDependencyManager m_aControlDependencies; diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 1493734256b1..223f5a167cb4 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -76,6 +76,25 @@ ODbaseIndexDialog::ODbaseIndexDialog(vcl::Window * pParent, const OUString& aDat SetCtrls(); } +ODbaseIndexDialog::~ODbaseIndexDialog() +{ + dispose(); +} + +void ODbaseIndexDialog::dispose() +{ + m_pPB_OK.clear(); + m_pCB_Tables.clear(); + m_pIndexes.clear(); + m_pLB_TableIndexes.clear(); + m_pLB_FreeIndexes.clear(); + m_pAdd.clear(); + m_pRemove.clear(); + m_pAddAll.clear(); + m_pRemoveAll.clear(); + ModalDialog::dispose(); +} + bool ODbaseIndexDialog::GetTable(const OUString& _rName, TableInfoList::iterator& _rPosition) { for ( _rPosition = m_aTableInfoList.begin(); diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx index 58aae3b04091..46aac76028af 100644 --- a/dbaccess/source/ui/dlg/dbfindex.hxx +++ b/dbaccess/source/ui/dlg/dbfindex.hxx @@ -73,16 +73,16 @@ typedef ::std::list< OTableInfo > TableInfoList; class ODbaseIndexDialog : public ModalDialog { protected: - OKButton* m_pPB_OK; - ComboBox* m_pCB_Tables; - VclContainer* m_pIndexes; - ListBox* m_pLB_TableIndexes; - ListBox* m_pLB_FreeIndexes; + VclPtr<OKButton> m_pPB_OK; + VclPtr<ComboBox> m_pCB_Tables; + VclPtr<VclContainer> m_pIndexes; + VclPtr<ListBox> m_pLB_TableIndexes; + VclPtr<ListBox> m_pLB_FreeIndexes; - PushButton* m_pAdd; - PushButton* m_pRemove; - PushButton* m_pAddAll; - PushButton* m_pRemoveAll; + VclPtr<PushButton> m_pAdd; + VclPtr<PushButton> m_pRemove; + VclPtr<PushButton> m_pAddAll; + VclPtr<PushButton> m_pRemoveAll; DECL_LINK( TableSelectHdl, ComboBox* ); DECL_LINK( AddClickHdl, PushButton* ); @@ -113,6 +113,8 @@ protected: public: ODbaseIndexDialog( vcl::Window * pParent, const OUString& aDataSrcName ); + virtual ~ODbaseIndexDialog(); + virtual void dispose() SAL_OVERRIDE; }; } // namespace dbaui diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 0852c7550522..b255353d5592 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -270,6 +270,9 @@ ODbTypeWizDialogSetup::~ODbTypeWizDialogSetup() void ODbTypeWizDialogSetup::dispose() { delete m_pOutSet; + m_pGeneralPage.clear(); + m_pMySQLIntroPage.clear(); + m_pFinalPage.clear(); svt::RoadmapWizard::dispose(); } @@ -426,7 +429,7 @@ Reference< XDriver > ODbTypeWizDialogSetup::getDriver() ::dbaccess::DATASOURCE_TYPE LocDatabaseType = _DatabaseType; if ((LocDatabaseType == ::dbaccess::DST_MYSQL_JDBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_ODBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_NATIVE)) { - if (m_pMySQLIntroPage != NULL) + if (m_pMySQLIntroPage != nullptr) { switch( m_pMySQLIntroPage->getMySQLMode() ) { @@ -445,7 +448,7 @@ Reference< XDriver > ODbTypeWizDialogSetup::getDriver() OUString ODbTypeWizDialogSetup::getDatasourceType(const SfxItemSet& _rSet) const { OUString sRet = dbaui::ODbDataSourceAdministrationHelper::getDatasourceType(_rSet); - if (m_pMySQLIntroPage != NULL && m_pMySQLIntroPage->IsVisible() ) + if (m_pMySQLIntroPage != nullptr && m_pMySQLIntroPage->IsVisible() ) { switch( m_pMySQLIntroPage->getMySQLMode() ) { @@ -740,7 +743,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument() if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPageWizard::eOpenExisting ) return true; - if ( m_pFinalPage != NULL ) + if ( m_pFinalPage != nullptr ) return m_pFinalPage->IsDatabaseDocumentToBeOpened(); return true; @@ -751,7 +754,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument() if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPageWizard::eOpenExisting ) return false; - if ( m_pFinalPage != NULL ) + if ( m_pFinalPage != nullptr ) return m_pFinalPage->IsTableWizardToBeStarted(); return false; diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index a4e5d5c7b221..21d386dab769 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -102,21 +102,15 @@ namespace dbaui void OCommonBehaviourTabPage::dispose() { - if(m_bDelete) - { - DELETEZ(m_pOptionsLabel); - DELETEZ(m_pOptions); - - DELETEZ(m_pCharsetLabel); - DELETEZ(m_pCharset); - - DELETEZ(m_pAutoIncrementLabel); - DELETEZ(m_pAutoIncrement); - - DELETEZ(m_pAutoRetrievingEnabled); - DELETEZ(m_pAutoRetrievingLabel); - DELETEZ(m_pAutoRetrieving); - } + m_pOptionsLabel.clear(); + m_pOptions.clear(); + m_pCharsetLabel.clear(); + m_pCharset.clear(); + m_pAutoIncrementLabel.clear(); + m_pAutoIncrement.clear(); + m_pAutoRetrievingEnabled.clear(); + m_pAutoRetrievingLabel.clear(); + m_pAutoRetrieving.clear(); OGenericAdministrationPage::dispose(); } @@ -199,6 +193,19 @@ namespace dbaui m_pShowDeleted->SetClickHdl(LINK(this, ODbaseDetailsPage, OnButtonClicked)); } + ODbaseDetailsPage::~ODbaseDetailsPage() + { + dispose(); + } + + void ODbaseDetailsPage::dispose() + { + m_pShowDeleted.clear(); + m_pFT_Message.clear(); + m_pIndexes.clear(); + OCommonBehaviourTabPage::dispose(); + } + SfxTabPage* ODriversSettings::CreateDbase( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) { return ( new ODbaseDetailsPage( pParent, *_rAttrSet ) ); @@ -274,6 +281,17 @@ namespace dbaui m_pUseCatalog->SetToggleHdl(getControlModifiedLink()); } + OOdbcDetailsPage::~OOdbcDetailsPage() + { + dispose(); + } + + void OOdbcDetailsPage::dispose() + { + m_pUseCatalog.clear(); + OCommonBehaviourTabPage::dispose(); + } + SfxTabPage* ODriversSettings::CreateODBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) { return ( new OOdbcDetailsPage( pParent, *_rAttrSet ) ); @@ -312,6 +330,22 @@ namespace dbaui m_pUseCatalog->SetToggleHdl(getControlModifiedLink()); } + OUserDriverDetailsPage::~OUserDriverDetailsPage() + { + dispose(); + } + + void OUserDriverDetailsPage::dispose() + { + m_pFTHostname.clear(); + m_pEDHostname.clear(); + m_pPortNumber.clear(); + m_pNFPortNumber.clear(); + m_pUseCatalog.clear(); + OCommonBehaviourTabPage::dispose(); + } + + SfxTabPage* ODriversSettings::CreateUser( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) { return ( new OUserDriverDetailsPage( pParent, *_rAttrSet ) ); @@ -418,6 +452,23 @@ namespace dbaui m_pEDSocket->SetModifyHdl(getControlModifiedLink()); } + OGeneralSpecialJDBCDetailsPage::~OGeneralSpecialJDBCDetailsPage() + { + dispose(); + } + + void OGeneralSpecialJDBCDetailsPage::dispose() + { + m_pEDHostname.clear(); + m_pNFPortNumber.clear(); + m_pFTSocket.clear(); + m_pEDSocket.clear(); + m_pFTDriverClass.clear(); + m_pEDDriverClass.clear(); + m_pTestJavaDriver.clear(); + OCommonBehaviourTabPage::dispose(); + } + bool OGeneralSpecialJDBCDetailsPage::FillItemSet( SfxItemSet* _rSet ) { bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet); @@ -528,6 +579,11 @@ namespace dbaui void MySQLNativePage::dispose() { m_aMySQLSettings.disposeAndClear(); + m_pSeparator1.clear(); + m_pSeparator2.clear(); + m_pUserNameLabel.clear(); + m_pUserName.clear(); + m_pPasswordRequired.clear(); OCommonBehaviourTabPage::dispose(); } @@ -621,6 +677,20 @@ namespace dbaui m_pCBUseSSL->SetClickHdl(LINK(this, OLDAPDetailsPage,OnCheckBoxClick)); } + OLDAPDetailsPage::~OLDAPDetailsPage() + { + dispose(); + } + + void OLDAPDetailsPage::dispose() + { + m_pETBaseDN.clear(); + m_pCBUseSSL.clear(); + m_pNFPortNumber.clear(); + m_pNFRowCount.clear(); + OCommonBehaviourTabPage::dispose(); + } + SfxTabPage* ODriversSettings::CreateLDAP( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) { return ( new OLDAPDetailsPage( pParent, *_rAttrSet ) ); @@ -692,7 +762,7 @@ namespace dbaui void OTextDetailsPage::dispose() { - DELETEZ(m_pTextConnectionHelper); + m_pTextConnectionHelper.clear(); OCommonBehaviourTabPage::dispose(); } diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index de17ed7f83e8..eab91149949c 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -50,17 +50,17 @@ namespace dbaui { protected: - FixedText* m_pOptionsLabel; - Edit* m_pOptions; + VclPtr<FixedText> m_pOptionsLabel; + VclPtr<Edit> m_pOptions; - FixedText* m_pCharsetLabel; - CharSetListBox* m_pCharset; + VclPtr<FixedText> m_pCharsetLabel; + VclPtr<CharSetListBox> m_pCharset; - CheckBox* m_pAutoRetrievingEnabled; - FixedText* m_pAutoIncrementLabel; - Edit* m_pAutoIncrement; - FixedText* m_pAutoRetrievingLabel; - Edit* m_pAutoRetrieving; + VclPtr<CheckBox> m_pAutoRetrievingEnabled; + VclPtr<FixedText> m_pAutoIncrementLabel; + VclPtr<Edit> m_pAutoIncrement; + VclPtr<FixedText> m_pAutoRetrievingLabel; + VclPtr<Edit> m_pAutoRetrieving; sal_uInt32 m_nControlFlags; @@ -93,10 +93,12 @@ namespace dbaui virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; ODbaseDetailsPage(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); + virtual ~ODbaseDetailsPage(); + virtual void dispose() SAL_OVERRIDE; private: - CheckBox* m_pShowDeleted; - FixedText* m_pFT_Message; - PushButton* m_pIndexes; + VclPtr<CheckBox> m_pShowDeleted; + VclPtr<FixedText> m_pFT_Message; + VclPtr<PushButton> m_pIndexes; OUString m_sDsn; @@ -121,10 +123,12 @@ namespace dbaui virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; OOdbcDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); + virtual ~OOdbcDetailsPage(); + virtual void dispose() SAL_OVERRIDE; protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; private: - CheckBox* m_pUseCatalog; + VclPtr<CheckBox> m_pUseCatalog; }; // OUserDriverDetailsPage @@ -134,16 +138,18 @@ namespace dbaui virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; OUserDriverDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); + virtual ~OUserDriverDetailsPage(); + virtual void dispose() SAL_OVERRIDE; protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; private: - FixedText* m_pFTHostname; - Edit* m_pEDHostname; - FixedText* m_pPortNumber; - NumericField* m_pNFPortNumber; - CheckBox* m_pUseCatalog; + VclPtr<FixedText> m_pFTHostname; + VclPtr<Edit> m_pEDHostname; + VclPtr<FixedText> m_pPortNumber; + VclPtr<NumericField> m_pNFPortNumber; + VclPtr<CheckBox> m_pUseCatalog; }; // OMySQLODBCDetailsPage @@ -162,6 +168,8 @@ namespace dbaui , sal_uInt16 _nPortId , bool bShowSocket = true ); + virtual ~OGeneralSpecialJDBCDetailsPage(); + virtual void dispose() SAL_OVERRIDE; protected: @@ -171,14 +179,14 @@ namespace dbaui DECL_LINK(OnTestJavaClickHdl,PushButton*); DECL_LINK(OnEditModified,Edit*); - Edit* m_pEDHostname; - NumericField* m_pNFPortNumber; - FixedText* m_pFTSocket; - Edit* m_pEDSocket; + VclPtr<Edit> m_pEDHostname; + VclPtr<NumericField> m_pNFPortNumber; + VclPtr<FixedText> m_pFTSocket; + VclPtr<Edit> m_pEDSocket; - FixedText* m_pFTDriverClass; - Edit* m_pEDDriverClass; - PushButton* m_pTestJavaDriver; + VclPtr<FixedText> m_pFTDriverClass; + VclPtr<Edit> m_pEDDriverClass; + VclPtr<PushButton> m_pTestJavaDriver; OUString m_sDefaultJdbcDriverName; sal_uInt16 m_nPortId; @@ -195,13 +203,13 @@ namespace dbaui virtual void dispose() SAL_OVERRIDE; private: - FixedText *m_pSeparator1; + VclPtr<FixedText> m_pSeparator1; VclPtr<MySQLNativeSettings> m_aMySQLSettings; - FixedText *m_pSeparator2; - FixedText *m_pUserNameLabel; - Edit *m_pUserName; - CheckBox *m_pPasswordRequired; + VclPtr<FixedText> m_pSeparator2; + VclPtr<FixedText> m_pUserNameLabel; + VclPtr<Edit> m_pUserName; + VclPtr<CheckBox> m_pPasswordRequired; protected: virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; @@ -217,13 +225,15 @@ namespace dbaui virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; OLDAPDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); + virtual ~OLDAPDetailsPage(); + virtual void dispose() SAL_OVERRIDE; protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; private: - Edit* m_pETBaseDN; - CheckBox* m_pCBUseSSL; - NumericField* m_pNFPortNumber; - NumericField* m_pNFRowCount; + VclPtr<Edit> m_pETBaseDN; + VclPtr<CheckBox> m_pCBUseSSL; + VclPtr<NumericField> m_pNFPortNumber; + VclPtr<NumericField> m_pNFRowCount; sal_Int32 m_iSSLPort; sal_Int32 m_iNormalPort; @@ -244,7 +254,7 @@ namespace dbaui virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; OTextDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); - OTextConnectionHelper* m_pTextConnectionHelper; + VclPtr<OTextConnectionHelper> m_pTextConnectionHelper; protected: virtual ~OTextDetailsPage(); diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index a4995a2af317..1f001bd83d6f 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -85,6 +85,13 @@ namespace dbaui ::osl::MutexGuard aGuard(m_aMutex); stopAllComponentListening(); } + m_pSQL.clear(); + m_pExecute.clear(); + m_pSQLHistory.clear(); + m_pStatus.clear(); + m_pShowOutput.clear(); + m_pOutput.clear(); + m_pClose.clear(); ModalDialog::dispose(); } diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index 7ca8febaeec8..6daba84892ba 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -48,14 +48,14 @@ namespace dbaui class OSaveAsDlgImpl { public: - FixedText* m_pDescription; - FixedText* m_pCatalogLbl; - OSQLNameComboBox* m_pCatalog; - FixedText* m_pSchemaLbl; - OSQLNameComboBox* m_pSchema; - FixedText* m_pLabel; - OSQLNameEdit* m_pTitle; - OKButton* m_pPB_OK; + VclPtr<FixedText> m_pDescription; + VclPtr<FixedText> m_pCatalogLbl; + VclPtr<OSQLNameComboBox> m_pCatalog; + VclPtr<FixedText> m_pSchemaLbl; + VclPtr<OSQLNameComboBox> m_pSchema; + VclPtr<FixedText> m_pLabel; + VclPtr<OSQLNameEdit> m_pTitle; + VclPtr<OKButton> m_pPB_OK; OUString m_aQryLabel; OUString m_sTblLabel; OUString m_aName; diff --git a/dbaccess/source/ui/dlg/dlgsize.cxx b/dbaccess/source/ui/dlg/dlgsize.cxx index 11750ab0917a..b3e337527479 100644 --- a/dbaccess/source/ui/dlg/dlgsize.cxx +++ b/dbaccess/source/ui/dlg/dlgsize.cxx @@ -51,6 +51,19 @@ DlgSize::DlgSize( vcl::Window* pParent, sal_Int32 nVal, bool bRow, sal_Int32 _nA LINK(this,DlgSize,CbClickHdl).Call(m_pCB_STANDARD); } +DlgSize::~DlgSize() +{ + dispose(); +} + +void DlgSize::dispose() +{ + m_pMF_VALUE.clear(); + m_pCB_STANDARD.clear(); + ModalDialog::dispose(); +} + + void DlgSize::SetValue( sal_Int32 nVal ) { m_pMF_VALUE->SetValue(nVal, FUNIT_CM ); diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index 5151b78d335a..739504d6d8a3 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -70,6 +70,20 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(vcl::Window* _pParent, const St m_pDatasource->SetDoubleClickHdl(LINK(this,ODatasourceSelectDialog,ListDblClickHdl)); } +ODatasourceSelectDialog::~ODatasourceSelectDialog() +{ + dispose(); +} + +void ODatasourceSelectDialog::dispose() +{ + m_pDatasource.clear(); + m_pOk.clear(); + m_pCancel.clear(); + ModalDialog::dispose(); +} + + IMPL_LINK( ODatasourceSelectDialog, ListDblClickHdl, ListBox *, pListBox ) { if (pListBox->GetSelectEntryCount()) diff --git a/dbaccess/source/ui/dlg/dsselect.hxx b/dbaccess/source/ui/dlg/dsselect.hxx index 16f06de3e40d..2cb4cb6537e6 100644 --- a/dbaccess/source/ui/dlg/dsselect.hxx +++ b/dbaccess/source/ui/dlg/dsselect.hxx @@ -41,19 +41,20 @@ namespace dbaui class ODatasourceSelectDialog : public ModalDialog { protected: - ListBox* m_pDatasource; - OKButton* m_pOk; - CancelButton* m_pCancel; + VclPtr<ListBox> m_pDatasource; + VclPtr<OKButton> m_pOk; + VclPtr<CancelButton> m_pCancel; SfxItemSet* m_pOutputSet; #ifdef HAVE_ODBC_ADMINISTRATION - PushButton* m_pManageDatasources; + VclPtr<PushButton> m_pManageDatasources; ::std::unique_ptr< OOdbcManagement > m_pODBCManagement; #endif public: ODatasourceSelectDialog( vcl::Window* _pParent, const StringBag& _rDatasources, SfxItemSet* _pOutputSet = NULL ); - + virtual ~ODatasourceSelectDialog(); + virtual void dispose() SAL_OVERRIDE; OUString GetSelected() const { return m_pDatasource->GetSelectEntry();} void Select( const OUString& _rEntry ) { m_pDatasource->SelectEntry(_rEntry); } diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index a11b42f956dd..323b30200582 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -74,6 +74,18 @@ namespace dbaui m_pDatasourceType->SetSelectHdl(LINK(this, OGeneralPage, OnDatasourceTypeSelected)); } + OGeneralPage::~OGeneralPage() + { + dispose(); + } + + void OGeneralPage::dispose() + { + m_pSpecialMessage.clear(); + m_pDatasourceType.clear(); + OGenericAdministrationPage::dispose(); + } + namespace { struct DisplayedType @@ -533,6 +545,24 @@ namespace dbaui m_pPB_OpenDatabase->SetClickHdl( LINK( this, OGeneralPageWizard, OnOpenDocument ) ); } + OGeneralPageWizard::~OGeneralPageWizard() + { + dispose(); + } + + void OGeneralPageWizard::dispose() + { + m_pRB_CreateDatabase.clear(); + m_pRB_OpenExistingDatabase.clear(); + m_pRB_ConnectDatabase.clear(); + m_pFT_EmbeddedDBLabel.clear(); + m_pEmbeddedDBType.clear(); + m_pFT_DocListLabel.clear(); + m_pLB_DocumentList.clear(); + m_pPB_OpenDatabase.clear(); + OGeneralPage::dispose(); + } + OGeneralPageWizard::CreationMode OGeneralPageWizard::GetDatabaseCreationMode() const { if ( m_pRB_CreateDatabase->IsChecked() ) diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 083d3f0cda25..6c5d3294f749 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -40,7 +40,7 @@ namespace dbaui m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered .... private: - FixedText* m_pSpecialMessage; + VclPtr<FixedText> m_pSpecialMessage; enum SPECIAL_MESSAGE { @@ -56,7 +56,7 @@ namespace dbaui void insertDatasourceTypeEntryData( const OUString& _sType, const OUString& sDisplayName ); protected: - ListBox* m_pDatasourceType; + VclPtr<ListBox> m_pDatasourceType; ::dbaccess::ODsnTypeCollection* m_pCollection; /// the DSN type collection instance @@ -65,6 +65,9 @@ namespace dbaui m_aURLPrefixes; public: + virtual ~OGeneralPage(); + virtual void dispose() SAL_OVERRIDE; + /// set a handler which gets called every time the user selects a new type void SetTypeSelectHandler( const Link& _rHandler ) { m_aTypeSelectHandler = _rHandler; } @@ -115,7 +118,8 @@ namespace dbaui { public: OGeneralPageWizard( vcl::Window* pParent, const SfxItemSet& _rItems ); - + virtual ~OGeneralPageWizard(); + virtual void dispose() SAL_OVERRIDE; public: enum CreationMode { @@ -132,16 +136,16 @@ namespace dbaui private: // dialog controls - RadioButton* m_pRB_CreateDatabase; - RadioButton* m_pRB_OpenExistingDatabase; - RadioButton* m_pRB_ConnectDatabase; + VclPtr<RadioButton> m_pRB_CreateDatabase; + VclPtr<RadioButton> m_pRB_OpenExistingDatabase; + VclPtr<RadioButton> m_pRB_ConnectDatabase; - FixedText* m_pFT_EmbeddedDBLabel; - ListBox* m_pEmbeddedDBType; + VclPtr<FixedText> m_pFT_EmbeddedDBLabel; + VclPtr<ListBox> m_pEmbeddedDBType; - FixedText* m_pFT_DocListLabel; - OpenDocumentListBox* m_pLB_DocumentList; - OpenDocumentButton* m_pPB_OpenDatabase; + VclPtr<FixedText> m_pFT_DocListLabel; + VclPtr<OpenDocumentListBox> m_pLB_DocumentList; + VclPtr<OpenDocumentButton> m_pPB_OpenDatabase; // state DocumentDescriptor m_aBrowsedDocument; diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index 7377ac692a2e..c534142793ce 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -318,6 +318,15 @@ namespace dbaui { setToolBox(NULL); delete m_pIndexes; + m_pActions.clear(); + m_pIndexList.clear(); + m_pIndexDetails.clear(); + m_pDescriptionLabel.clear(); + m_pDescription.clear(); + m_pUnique.clear(); + m_pFieldsLabel.clear(); + m_pFields.clear(); + m_pClose.clear(); ModalDialog::dispose(); } diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index 49a326f7b08d..a6aa0ab1b925 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -115,8 +115,8 @@ namespace dbaui void IndexFieldsControl::dispose() { - delete m_pSortingCell; - delete m_pFieldNameCell; + m_pSortingCell.clear(); + m_pFieldNameCell.clear(); ::svt::EditBrowseBox::dispose(); } diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 809c11f5b536..6e5c5aab9303 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -120,6 +120,11 @@ namespace dbaui { if (m_aResetVisitFlag.IsActive()) m_aResetVisitFlag.Stop(); + m_pAllParams.clear(); + m_pParam.clear(); + m_pTravelNext.clear(); + m_pOKBtn.clear(); + m_pCancelBtn.clear(); ModalDialog::dispose(); } diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 5648b84beecb..9f5ef85afd6c 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -190,6 +190,27 @@ DlgFilterCrit::DlgFilterCrit(vcl::Window * pParent, m_pET_WHEREVALUE1->GrabFocus(); } +DlgFilterCrit::~DlgFilterCrit() +{ + dispose(); +} + +void DlgFilterCrit::dispose() +{ + m_pLB_WHEREFIELD1.clear(); + m_pLB_WHERECOMP1.clear(); + m_pET_WHEREVALUE1.clear(); + m_pLB_WHERECOND2.clear(); + m_pLB_WHEREFIELD2.clear(); + m_pLB_WHERECOMP2.clear(); + m_pET_WHEREVALUE2.clear(); + m_pLB_WHERECOND3.clear(); + m_pLB_WHEREFIELD3.clear(); + m_pLB_WHERECOMP3.clear(); + m_pET_WHEREVALUE3.clear(); + ModalDialog::dispose(); +} + #define LbText(x) ((x).GetSelectEntry()) #define LbPos(x) ((x).GetSelectEntryPos()) diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index 9a77bf8be5dc..5d7314f7dec6 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -125,6 +125,24 @@ DlgOrderCrit::DlgOrderCrit(vcl::Window * pParent, m_pLB_ORDERFIELD2->SetSelectHdl(LINK(this,DlgOrderCrit,FieldListSelectHdl)); } +DlgOrderCrit::~DlgOrderCrit() +{ + dispose(); +} + +void DlgOrderCrit::dispose() +{ + m_pLB_ORDERFIELD1.clear(); + m_pLB_ORDERVALUE1.clear(); + m_pLB_ORDERFIELD2.clear(); + m_pLB_ORDERVALUE2.clear(); + m_pLB_ORDERFIELD3.clear(); + m_pLB_ORDERVALUE3.clear(); + for (auto a : m_aColumnList) a.clear(); + for (auto a : m_aValueList) a.clear(); + ModalDialog::dispose(); +} + IMPL_LINK_INLINE_START( DlgOrderCrit, FieldListSelectHdl, ListBox *, /*pListBox*/ ) { EnableLines(); diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 5bbd80b23bca..f4cbea70981b 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -292,8 +292,8 @@ namespace class OExceptionChainDialog : public ModalDialog { - SvTreeListBox* m_pExceptionList; - VclMultiLineEdit* m_pExceptionText; + VclPtr<SvTreeListBox> m_pExceptionList; + VclPtr<VclMultiLineEdit> m_pExceptionText; OUString m_sStatusLabel; OUString m_sErrorCodeLabel; @@ -302,6 +302,13 @@ class OExceptionChainDialog : public ModalDialog public: OExceptionChainDialog( vcl::Window* pParent, const ExceptionDisplayChain& _rExceptions ); + virtual ~OExceptionChainDialog() { dispose(); } + virtual void dispose() SAL_OVERRIDE + { + m_pExceptionList.clear(); + m_pExceptionText.clear(); + ModalDialog::dispose(); + } protected: DECL_LINK(OnExceptionSelected, void*); diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 9b27593e09b4..7e452f143fa6 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -110,6 +110,9 @@ namespace dbaui ::comphelper::disposeComponent(m_xCurrentConnection); } catch (RuntimeException&) { } + m_pTables.clear(); + m_pTablesList.clear(); + m_pTablesDlg.clear(); OGenericAdministrationPage::dispose(); } diff --git a/dbaccess/source/ui/dlg/tablespage.hxx b/dbaccess/source/ui/dlg/tablespage.hxx index c8b50ddbda15..8a92d17a30e8 100644 --- a/dbaccess/source/ui/dlg/tablespage.hxx +++ b/dbaccess/source/ui/dlg/tablespage.hxx @@ -36,8 +36,8 @@ namespace dbaui :public OGenericAdministrationPage { private: - VclContainer* m_pTables; - OTableTreeListBox* m_pTablesList; + VclPtr<VclContainer> m_pTables; + VclPtr<OTableTreeListBox> m_pTablesList; OUString m_sCatalogSeparator; bool m_bCatalogAtStart : 1; @@ -46,7 +46,7 @@ namespace dbaui m_xCurrentConnection; /// valid as long as the page is active ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > m_xCollator; - OTableSubscriptionDialog* m_pTablesDlg; + VclPtr<OTableSubscriptionDialog> m_pTablesDlg; public: virtual bool FillItemSet(SfxItemSet* _rCoreAttrs) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/textconnectionsettings.cxx b/dbaccess/source/ui/dlg/textconnectionsettings.cxx index a0eb3330917e..3a5583a3d046 100644 --- a/dbaccess/source/ui/dlg/textconnectionsettings.cxx +++ b/dbaccess/source/ui/dlg/textconnectionsettings.cxx @@ -39,6 +39,17 @@ namespace dbaui m_pOK->SetClickHdl( LINK( this, TextConnectionSettingsDialog, OnOK ) ); } + TextConnectionSettingsDialog::~TextConnectionSettingsDialog() + { + dispose(); + } + + void TextConnectionSettingsDialog::dispose() + { + m_pOK.clear(); + ModalDialog::dispose(); + } + void TextConnectionSettingsDialog::bindItemStorages( SfxItemSet& _rSet, PropertyValues& _rValues ) { _rValues[ PROPERTY_ID_HEADER_LINE ].reset( new SetItemPropertyStorage( _rSet, DSID_TEXTFILEHEADER ) ); diff --git a/dbaccess/source/ui/inc/CollectionView.hxx b/dbaccess/source/ui/inc/CollectionView.hxx index 27abf7422d9f..f407b70bc918 100644 --- a/dbaccess/source/ui/inc/CollectionView.hxx +++ b/dbaccess/source/ui/inc/CollectionView.hxx @@ -34,12 +34,12 @@ namespace dbaui */ class OCollectionView : public ModalDialog { - FixedText* m_pFTCurrentPath; - PushButton* m_pNewFolder; - PushButton* m_pUp; - SvtFileView* m_pView; - Edit* m_pName; - PushButton* m_pPB_OK; + VclPtr<FixedText> m_pFTCurrentPath; + VclPtr<PushButton> m_pNewFolder; + VclPtr<PushButton> m_pUp; + VclPtr<SvtFileView> m_pView; + VclPtr<Edit> m_pName; + VclPtr<PushButton> m_pPB_OK; ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent> m_xContent; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; bool m_bCreateForm; @@ -56,7 +56,8 @@ namespace dbaui ,const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent ,const OUString& _sDefaultName ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext); - + virtual ~OCollectionView(); + virtual void dispose() SAL_OVERRIDE; ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent> getSelectedFolder() const { return m_xContent;} OUString getName() const; }; diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx index 6ae780d4705a..dfa2695e364a 100644 --- a/dbaccess/source/ui/inc/ConnectionLine.hxx +++ b/dbaccess/source/ui/inc/ConnectionLine.hxx @@ -22,6 +22,7 @@ #include <tools/gen.hxx> #include "ConnectionLineData.hxx" #include <functional> +#include <vcl/vclptr.hxx> class OutputDevice; namespace dbaui @@ -38,7 +39,7 @@ namespace dbaui class OTableConnection; class OConnectionLine { - OTableConnection* m_pTabConn; + VclPtr<OTableConnection> m_pTabConn; OConnectionLineDataRef m_pData; Point m_aSourceConnPos, diff --git a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx index ce3451097408..4cbb22ce3c91 100644 --- a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx +++ b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp> #include <cppuhelper/implbase2.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> +#include <vcl/vclptr.hxx> namespace dbaui { @@ -35,7 +36,7 @@ namespace dbaui class OConnectionLineAccess : public VCLXAccessibleComponent , public OConnectionLineAccess_BASE { - const OTableConnection* m_pLine; // the window which I should give accessibility to + VclPtr<const OTableConnection> m_pLine; // the window which I should give accessibility to protected: /** this function is called upon disposing the component */ diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index 9eb035fc9fda..6de1b7f4b8bc 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -65,40 +65,40 @@ namespace dbaui class OFieldDescControl : public TabPage { private: - OTableDesignHelpBar* pHelp; - vcl::Window* pLastFocusWindow; - vcl::Window* m_pActFocusWindow; - - FixedText* pDefaultText; - FixedText* pRequiredText; - FixedText* pAutoIncrementText; - FixedText* pTextLenText; - FixedText* pNumTypeText; - FixedText* pLengthText; - FixedText* pScaleText; - FixedText* pFormatText; - FixedText* pBoolDefaultText; - FixedText* m_pColumnNameText; - FixedText* m_pTypeText; - FixedText* m_pAutoIncrementValueText; - - OPropListBoxCtrl* pRequired; - OPropListBoxCtrl* pNumType; - OPropListBoxCtrl* pAutoIncrement; - OPropEditCtrl* pDefault; - OPropNumericEditCtrl* pTextLen; - OPropNumericEditCtrl* pLength; - OPropNumericEditCtrl* pScale; - OPropEditCtrl* pFormatSample; - OPropListBoxCtrl* pBoolDefault; - OPropColumnEditCtrl* m_pColumnName; - OPropListBoxCtrl* m_pType; - OPropEditCtrl* m_pAutoIncrementValue; - - PushButton* pFormat; - - ScrollBar* m_pVertScroll; - ScrollBar* m_pHorzScroll; + VclPtr<OTableDesignHelpBar> pHelp; + VclPtr<vcl::Window> pLastFocusWindow; + VclPtr<vcl::Window> m_pActFocusWindow; + + VclPtr<FixedText> pDefaultText; + VclPtr<FixedText> pRequiredText; + VclPtr<FixedText> pAutoIncrementText; + VclPtr<FixedText> pTextLenText; + VclPtr<FixedText> pNumTypeText; + VclPtr<FixedText> pLengthText; + VclPtr<FixedText> pScaleText; + VclPtr<FixedText> pFormatText; + VclPtr<FixedText> pBoolDefaultText; + VclPtr<FixedText> m_pColumnNameText; + VclPtr<FixedText> m_pTypeText; + VclPtr<FixedText> m_pAutoIncrementValueText; + + VclPtr<OPropListBoxCtrl> pRequired; + VclPtr<OPropListBoxCtrl> pNumType; + VclPtr<OPropListBoxCtrl> pAutoIncrement; + VclPtr<OPropEditCtrl> pDefault; + VclPtr<OPropNumericEditCtrl> pTextLen; + VclPtr<OPropNumericEditCtrl> pLength; + VclPtr<OPropNumericEditCtrl> pScale; + VclPtr<OPropEditCtrl> pFormatSample; + VclPtr<OPropListBoxCtrl> pBoolDefault; + VclPtr<OPropColumnEditCtrl> m_pColumnName; + VclPtr<OPropListBoxCtrl> m_pType; + VclPtr<OPropEditCtrl> m_pAutoIncrementValue; + + VclPtr<PushButton> pFormat; + + VclPtr<ScrollBar> m_pVertScroll; + VclPtr<ScrollBar> m_pHorzScroll; TOTypeInfoSP m_pPreviousType; short m_nPos; @@ -126,7 +126,7 @@ namespace dbaui void UpdateFormatSample(OFieldDescription* pFieldDescr); void ArrangeAggregates(); - void SetPosSize( Control** ppControl, long nRow, sal_uInt16 nCol ); + void SetPosSize( VclPtr<Control>& rControl, long nRow, sal_uInt16 nCol ); void ScrollAggregate(Control* pText, Control* pInput, Control* pButton, long nDeltaX, long nDeltaY); void ScrollAllAggregates(); diff --git a/dbaccess/source/ui/inc/JAccess.hxx b/dbaccess/source/ui/inc/JAccess.hxx index d9642901a1e3..59c1c1f91b2a 100644 --- a/dbaccess/source/ui/inc/JAccess.hxx +++ b/dbaccess/source/ui/inc/JAccess.hxx @@ -21,6 +21,7 @@ #include <toolkit/awt/vclxaccessiblecomponent.hxx> #include <cppuhelper/implbase1.hxx> +#include <vcl/vclptr.hxx> namespace dbaui { @@ -32,7 +33,7 @@ namespace dbaui */ class OJoinDesignViewAccess : public VCLXAccessibleComponent, public OJoinDesignViewAccess_BASE { - OJoinTableView* m_pTableView; // the window which I should give accessibility to + VclPtr<OJoinTableView> m_pTableView; // the window which I should give accessibility to protected: /** isEditable returns the current editable state diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx index bfbfc560544b..4fd57a929b86 100644 --- a/dbaccess/source/ui/inc/JoinController.hxx +++ b/dbaccess/source/ui/inc/JoinController.hxx @@ -51,7 +51,7 @@ namespace dbaui Fraction m_aZoom; ::dbtools::SQLExceptionInfo m_aExceptionInfo; - OAddTableDlg* m_pAddTableDialog; + VclPtr<OAddTableDlg> m_pAddTableDialog; ::std::unique_ptr< AddTableDialogContext > m_pDialogContext; Point m_aMinimumTableViewSize; diff --git a/dbaccess/source/ui/inc/JoinDesignView.hxx b/dbaccess/source/ui/inc/JoinDesignView.hxx index 13de042e489a..da50da1e20ac 100644 --- a/dbaccess/source/ui/inc/JoinDesignView.hxx +++ b/dbaccess/source/ui/inc/JoinDesignView.hxx @@ -33,8 +33,8 @@ namespace dbaui class OJoinDesignView : public ODataView { protected: - OScrollWindowHelper* m_pScrollWindow; // contains only the scrollbars - OJoinTableView* m_pTableView; // presents the upper window + VclPtr<OScrollWindowHelper> m_pScrollWindow; // contains only the scrollbars + VclPtr<OJoinTableView> m_pTableView; // presents the upper window OJoinController& m_rController; public: diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index bec75b6103df..466d77c484e7 100644 --- a/dbaccess/source/ui/inc/JoinTableView.hxx +++ b/dbaccess/source/ui/inc/JoinTableView.hxx @@ -52,10 +52,10 @@ namespace dbaui class OJoinTableView; class OScrollWindowHelper : public vcl::Window { - VclPtr<ScrollBar> m_aHScrollBar; - VclPtr<ScrollBar> m_aVScrollBar; - vcl::Window* m_pCornerWindow; - OJoinTableView* m_pTableView; + VclPtr<ScrollBar> m_aHScrollBar; + VclPtr<ScrollBar> m_aVScrollBar; + VclPtr<vcl::Window> m_pCornerWindow; + VclPtr<OJoinTableView> m_pTableView; protected: virtual void Resize() SAL_OVERRIDE; @@ -82,11 +82,11 @@ namespace dbaui friend class OJoinMoveTabWinUndoAct; public: - typedef std::map<OUString, OTableWindow*> OTableWindowMap; + typedef std::map<OUString, VclPtr<OTableWindow> > OTableWindowMap; private: OTableWindowMap m_aTableMap; - ::std::vector<OTableConnection*> m_vTableConnection; + ::std::vector<VclPtr<OTableConnection> > m_vTableConnection; Idle m_aDragScrollIdle; Rectangle m_aDragRect; @@ -97,9 +97,9 @@ namespace dbaui Size m_aOutputSize; - OTableWindow* m_pDragWin; - OTableWindow* m_pSizingWin; - OTableConnection* m_pSelectedConn; + VclPtr<OTableWindow> m_pDragWin; + VclPtr<OTableWindow> m_pSizingWin; + VclPtr<OTableConnection> m_pSelectedConn; bool m_bTrackingInitiallyMoved; @@ -107,8 +107,8 @@ namespace dbaui DECL_LINK(OnDragScrollTimer, void*); protected: - OTableWindow* m_pLastFocusTabWin; - OJoinDesignView* m_pView; + VclPtr<OTableWindow> m_pLastFocusTabWin; + VclPtr<OJoinDesignView> m_pView; OJoinDesignViewAccess* m_pAccessible; public: @@ -183,7 +183,7 @@ namespace dbaui /** gives a read only access to the connection vector */ - const ::std::vector<OTableConnection*>& getTableConnections() const { return m_vTableConnection; } + const ::std::vector<VclPtr<OTableConnection> >& getTableConnections() const { return m_vTableConnection; } bool ExistsAConn(const OTableWindow* pFromWin) const; @@ -192,7 +192,7 @@ namespace dbaui @param _pFromWin the table for which connections should be found @return an iterator which can be used to travel all connections of the table */ - ::std::vector<OTableConnection*>::const_iterator getTableConnections(const OTableWindow* _pFromWin) const; + ::std::vector<VclPtr<OTableConnection> >::const_iterator getTableConnections(const OTableWindow* _pFromWin) const; /** how many connection belongs to single table diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx index 347989376717..04d2724f94f1 100644 --- a/dbaccess/source/ui/inc/QueryDesignView.hxx +++ b/dbaccess/source/ui/inc/QueryDesignView.hxx @@ -69,7 +69,7 @@ namespace dbaui ::com::sun::star::lang::Locale m_aLocale; OUString m_sDecimalSep; - OSelectionBrowseBox* m_pSelectionBox; // presents the lower window + VclPtr<OSelectionBrowseBox> m_pSelectionBox; // presents the lower window ChildFocusState m_eChildFocus; bool m_bInSplitHandler; diff --git a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx index bb7b9bcac2a7..a083b4cca893 100644 --- a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx +++ b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx @@ -29,16 +29,17 @@ public: QueryPropertiesDialog( vcl::Window* pParent, const bool bDistinct, const sal_Int64 nLimit ); - + virtual ~QueryPropertiesDialog(); + virtual void dispose() SAL_OVERRIDE; bool getDistinct() const; sal_Int64 getLimit() const; private: - RadioButton* m_pRB_Distinct; - RadioButton* m_pRB_NonDistinct; + VclPtr<RadioButton> m_pRB_Distinct; + VclPtr<RadioButton> m_pRB_NonDistinct; - LimitBox* m_pLB_Limit; + VclPtr<LimitBox> m_pLB_Limit; }; diff --git a/dbaccess/source/ui/inc/QueryTextView.hxx b/dbaccess/source/ui/inc/QueryTextView.hxx index 78fbc7d6d158..c467993a6c68 100644 --- a/dbaccess/source/ui/inc/QueryTextView.hxx +++ b/dbaccess/source/ui/inc/QueryTextView.hxx @@ -28,7 +28,7 @@ namespace dbaui class OQueryTextView : public vcl::Window { friend class OQueryViewSwitch; - OSqlEdit* m_pEdit; + VclPtr<OSqlEdit> m_pEdit; public: OQueryTextView( OQueryContainerWindow* pParent ); virtual ~OQueryTextView(); diff --git a/dbaccess/source/ui/inc/QueryViewSwitch.hxx b/dbaccess/source/ui/inc/QueryViewSwitch.hxx index e6f936a57617..ccf45802c394 100644 --- a/dbaccess/source/ui/inc/QueryViewSwitch.hxx +++ b/dbaccess/source/ui/inc/QueryViewSwitch.hxx @@ -34,8 +34,8 @@ namespace dbaui class OQueryContainerWindow; class OQueryViewSwitch { - OQueryDesignView* m_pDesignView; - OQueryTextView* m_pTextView; + VclPtr<OQueryDesignView> m_pDesignView; + VclPtr<OQueryTextView> m_pTextView; bool m_bAddTableDialogWasVisible; // true if so public: OQueryViewSwitch(OQueryContainerWindow* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ); diff --git a/dbaccess/source/ui/inc/RelationControl.hxx b/dbaccess/source/ui/inc/RelationControl.hxx index a04c08d5f9ca..12973d55b9f5 100644 --- a/dbaccess/source/ui/inc/RelationControl.hxx +++ b/dbaccess/source/ui/inc/RelationControl.hxx @@ -32,10 +32,10 @@ namespace dbaui class OTableListBoxControl { - ListBox* m_pLeftTable; - ListBox* m_pRightTable; + VclPtr<ListBox> m_pLeftTable; + VclPtr<ListBox> m_pRightTable; - ORelationControl* m_pRC_Tables; + VclPtr<ORelationControl> m_pRC_Tables; const OJoinTableView::OTableWindowMap* m_pTableMap; IRelationControlInterface* m_pParentDialog; OUString m_strCurrentLeft; diff --git a/dbaccess/source/ui/inc/RelationDlg.hxx b/dbaccess/source/ui/inc/RelationDlg.hxx index fc4f17a08467..3435632c08f8 100644 --- a/dbaccess/source/ui/inc/RelationDlg.hxx +++ b/dbaccess/source/ui/inc/RelationDlg.hxx @@ -39,16 +39,16 @@ namespace dbaui boost::scoped_ptr<OTableListBoxControl> m_xTableControl; OJoinTableView::OTableWindowMap* m_pTableMap; - RadioButton* m_pRB_NoCascUpd; - RadioButton* m_pRB_CascUpd; - RadioButton* m_pRB_CascUpdNull; - RadioButton* m_pRB_CascUpdDefault; - RadioButton* m_pRB_NoCascDel; - RadioButton* m_pRB_CascDel; - RadioButton* m_pRB_CascDelNull; - RadioButton* m_pRB_CascDelDefault; + VclPtr<RadioButton> m_pRB_NoCascUpd; + VclPtr<RadioButton> m_pRB_CascUpd; + VclPtr<RadioButton> m_pRB_CascUpdNull; + VclPtr<RadioButton> m_pRB_CascUpdDefault; + VclPtr<RadioButton> m_pRB_NoCascDel; + VclPtr<RadioButton> m_pRB_CascDel; + VclPtr<RadioButton> m_pRB_CascDelNull; + VclPtr<RadioButton> m_pRB_CascDelDefault; - OKButton* m_pPB_OK; + VclPtr<OKButton> m_pPB_OK; TTableConnectionData::value_type m_pConnData; TTableConnectionData::value_type m_pOrigConnData; @@ -60,6 +60,8 @@ namespace dbaui ORelationDialog(OJoinTableView* pParent, const TTableConnectionData::value_type& pConnectionData, bool bAllowTableSelect = false ); + virtual ~ORelationDialog(); + virtual void dispose() SAL_OVERRIDE; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection() SAL_OVERRIDE { return m_xConnection; } diff --git a/dbaccess/source/ui/inc/RelationTableView.hxx b/dbaccess/source/ui/inc/RelationTableView.hxx index eb251863ffdd..1ae96254e24e 100644 --- a/dbaccess/source/ui/inc/RelationTableView.hxx +++ b/dbaccess/source/ui/inc/RelationTableView.hxx @@ -32,7 +32,7 @@ namespace dbaui public OJoinTableView, public ::comphelper::OContainerListener { - OTableConnection* m_pExistingConnection; ///< is set when a connection was draged on an existing connection + VclPtr<OTableConnection> m_pExistingConnection; ///< is set when a connection was draged on an existing connection TTableConnectionData::value_type m_pCurrentlyTabConnData; ///< set when we creating a connection with more than one keycolumn ::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener; bool m_bInRemove; diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx index ae4ff745dedd..a027fa033e5a 100644 --- a/dbaccess/source/ui/inc/TableConnection.hxx +++ b/dbaccess/source/ui/inc/TableConnection.hxx @@ -41,7 +41,7 @@ namespace dbaui ::std::vector<OConnectionLine*> m_vConnLine; TTableConnectionData::value_type m_pData; - OJoinTableView* m_pParent; + VclPtr<OJoinTableView> m_pParent; bool m_bSelected; diff --git a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx index f4ef497c6c0d..bcc79095dec8 100644 --- a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx +++ b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx @@ -33,7 +33,7 @@ namespace dbaui { private: OUString m_sHelpText; - MultiLineEdit* m_pTextWin; + VclPtr<MultiLineEdit> m_pTextWin; protected: virtual void Resize() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/TableDesignView.hxx b/dbaccess/source/ui/inc/TableDesignView.hxx index cc3349ada1bf..7a1016f6753f 100644 --- a/dbaccess/source/ui/inc/TableDesignView.hxx +++ b/dbaccess/source/ui/inc/TableDesignView.hxx @@ -33,8 +33,8 @@ namespace dbaui class OTableBorderWindow : public vcl::Window { VclPtr<Splitter> m_aHorzSplitter; - OTableFieldDescWin* m_pFieldDescWin; - OTableEditorCtrl* m_pEditorCtrl; + VclPtr<OTableFieldDescWin> m_pFieldDescWin; + VclPtr<OTableEditorCtrl> m_pEditorCtrl; void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); void ArrangeChildren( long nSplitPos ,Rectangle& rRect); @@ -63,7 +63,7 @@ namespace dbaui }; private: ::com::sun::star::lang::Locale m_aLocale; - OTableBorderWindow* m_pWin; + VclPtr<OTableBorderWindow> m_pWin; OTableController& m_rController; ChildFocusState m_eChildFocus; diff --git a/dbaccess/source/ui/inc/TableFieldDescription.hxx b/dbaccess/source/ui/inc/TableFieldDescription.hxx index 9a6992bd732c..d8e5f3d524d2 100644 --- a/dbaccess/source/ui/inc/TableFieldDescription.hxx +++ b/dbaccess/source/ui/inc/TableFieldDescription.hxx @@ -25,6 +25,7 @@ #include <rtl/ustring.hxx> #include <com/sun/star/beans/PropertyValue.hpp> #include <rtl/ref.hxx> +#include <vcl/vclptr.hxx> #include <salhelper/simplereferenceobject.hxx> @@ -49,7 +50,7 @@ namespace dbaui OUString m_aFieldAlias; ///< column alias OUString m_aFunctionName;///< contains the function name (only if m_eFunctionType != FKT_NONE) - vcl::Window* m_pTabWindow; + VclPtr<vcl::Window> m_pTabWindow; sal_Int32 m_eDataType; sal_Int32 m_eFunctionType; diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx index a0e2e95631b6..5f80e75fcbf3 100644 --- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx +++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx @@ -53,8 +53,8 @@ class OTableGrantControl : public ::svt::EditBrowseBox mutable TTablePrivilegeMap m_aPrivMap; OUString m_sUserName; - ::svt::CheckBoxControl* m_pCheckCell; - Edit* m_pEdit; + VclPtr<::svt::CheckBoxControl> m_pCheckCell; + VclPtr<Edit> m_pEdit; long m_nDataPos; ImplSVEvent * m_nDeactivateEvent; diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx index 67cb66b8f451..459184fa83fb 100644 --- a/dbaccess/source/ui/inc/TableWindow.hxx +++ b/dbaccess/source/ui/inc/TableWindow.hxx @@ -56,7 +56,7 @@ namespace dbaui // and the table itself (needed for me as I want to lock it as long as the window is alive) VclPtr<FixedImage> m_aTypeImage; VclPtr<OTableWindowTitle> m_aTitle; - OTableWindowListBox* m_pListBox; + VclPtr<OTableWindowListBox> m_pListBox; OTableWindowAccess* m_pAccessible; private: diff --git a/dbaccess/source/ui/inc/TableWindowAccess.hxx b/dbaccess/source/ui/inc/TableWindowAccess.hxx index c37f481e073b..161193ca8252 100644 --- a/dbaccess/source/ui/inc/TableWindowAccess.hxx +++ b/dbaccess/source/ui/inc/TableWindowAccess.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp> #include <cppuhelper/implbase2.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> +#include <vcl/vclptr.hxx> namespace dbaui { @@ -35,7 +36,7 @@ namespace dbaui class OTableWindowAccess : public VCLXAccessibleComponent , public OTableWindowAccess_BASE { - OTableWindow* m_pTable; // the window which I should give accessibility to + VclPtr<OTableWindow> m_pTable; // the window which I should give accessibility to ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getParentChild(sal_Int32 _nIndex); protected: diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx index 8e5769883bdf..dfd8f4b39e21 100644 --- a/dbaccess/source/ui/inc/TableWindowListBox.hxx +++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx @@ -30,7 +30,7 @@ namespace dbaui struct OJoinExchangeData { public: - OTableWindowListBox* pListBox; // the ListBox inside the same (you can get the TabWin and the WinName out of it) + VclPtr<OTableWindowListBox> pListBox; // the ListBox inside the same (you can get the TabWin and the WinName out of it) SvTreeListEntry* pEntry; // the entry, which was dragged or to which was dropped on OJoinExchangeData(OTableWindowListBox* pBox); @@ -56,7 +56,7 @@ namespace dbaui Timer m_aScrollTimer; Point m_aMousePos; - OTableWindow* m_pTabWin; + VclPtr<OTableWindow> m_pTabWin; ImplSVEvent * m_nDropEvent; ImplSVEvent * m_nUiEvent; OJoinDropData m_aDropInfo; diff --git a/dbaccess/source/ui/inc/TableWindowTitle.hxx b/dbaccess/source/ui/inc/TableWindowTitle.hxx index 5a08b3986b6d..3d009e3c603e 100644 --- a/dbaccess/source/ui/inc/TableWindowTitle.hxx +++ b/dbaccess/source/ui/inc/TableWindowTitle.hxx @@ -26,7 +26,7 @@ namespace dbaui class OTableWindow; class OTableWindowTitle : public FixedText { - OTableWindow* m_pTabWin; + VclPtr<OTableWindow> m_pTabWin; protected: virtual void Command(const CommandEvent& rEvt) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx index 6e0cc172a7b7..35b81ad01ea4 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -196,7 +196,7 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetUpdate > m_xTargetResultSetUpdate; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > m_xTargetRowUpdate; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xTargetResultSetMetaData; - vcl::Window* m_pParent; + VclPtr<vcl::Window> m_pParent; bool m_bAlreadyAsked; bool insertNewRow(); diff --git a/dbaccess/source/ui/inc/VertSplitView.hxx b/dbaccess/source/ui/inc/VertSplitView.hxx index 22393b9c2d84..ac7bde548eed 100644 --- a/dbaccess/source/ui/inc/VertSplitView.hxx +++ b/dbaccess/source/ui/inc/VertSplitView.hxx @@ -27,9 +27,9 @@ namespace dbaui { class OSplitterView : public vcl::Window { - Splitter* m_pSplitter; - vcl::Window* m_pLeft; - vcl::Window* m_pRight; + VclPtr<Splitter> m_pSplitter; + VclPtr<vcl::Window> m_pLeft; + VclPtr<vcl::Window> m_pRight; bool m_bVertical; void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); diff --git a/dbaccess/source/ui/inc/WCPage.hxx b/dbaccess/source/ui/inc/WCPage.hxx index 7fe938c37914..008a9376ce01 100644 --- a/dbaccess/source/ui/inc/WCPage.hxx +++ b/dbaccess/source/ui/inc/WCPage.hxx @@ -34,19 +34,19 @@ namespace dbaui class OCopyTable : public OWizardPage { protected: - Edit* m_pEdTableName; - RadioButton* m_pRB_DefData; - RadioButton* m_pRB_Def; - RadioButton* m_pRB_View; - RadioButton* m_pRB_AppendData; - CheckBox* m_pCB_UseHeaderLine; - CheckBox* m_pCB_PrimaryColumn; - FixedText* m_pFT_KeyName; - Edit* m_pEdKeyName; + VclPtr<Edit> m_pEdTableName; + VclPtr<RadioButton> m_pRB_DefData; + VclPtr<RadioButton> m_pRB_Def; + VclPtr<RadioButton> m_pRB_View; + VclPtr<RadioButton> m_pRB_AppendData; + VclPtr<CheckBox> m_pCB_UseHeaderLine; + VclPtr<CheckBox> m_pCB_PrimaryColumn; + VclPtr<FixedText> m_pFT_KeyName; + VclPtr<Edit> m_pEdKeyName; sal_Int16 m_nOldOperation; - OWizColumnSelect* m_pPage2; - OWizNormalExtend* m_pPage3; + VclPtr<OWizColumnSelect> m_pPage2; + VclPtr<OWizNormalExtend> m_pPage3; bool m_bPKeyAllowed; bool m_bUseHeaderAllowed; @@ -65,6 +65,8 @@ namespace dbaui virtual OUString GetTitle() const SAL_OVERRIDE ; OCopyTable( vcl::Window * pParent ); + virtual ~OCopyTable(); + virtual void dispose() SAL_OVERRIDE; bool IsOptionDefData() const { return m_pRB_DefData->IsChecked(); } bool IsOptionDef() const { return m_pRB_Def->IsChecked(); } diff --git a/dbaccess/source/ui/inc/WColumnSelect.hxx b/dbaccess/source/ui/inc/WColumnSelect.hxx index a271aaacc152..9b08f6b97f0d 100644 --- a/dbaccess/source/ui/inc/WColumnSelect.hxx +++ b/dbaccess/source/ui/inc/WColumnSelect.hxx @@ -35,12 +35,12 @@ namespace dbaui class OWizColumnSelect : public OWizardPage { - ListBox* m_pOrgColumnNames; // left side - PushButton* m_pColumn_RH; - PushButton* m_pColumns_RH; - PushButton* m_pColumn_LH; - PushButton* m_pColumns_LH; - ListBox* m_pNewColumnNames; // right side + VclPtr<ListBox> m_pOrgColumnNames; // left side + VclPtr<PushButton> m_pColumn_RH; + VclPtr<PushButton> m_pColumns_RH; + VclPtr<PushButton> m_pColumn_LH; + VclPtr<PushButton> m_pColumns_LH; + VclPtr<ListBox> m_pNewColumnNames; // right side DECL_LINK( ButtonClickHdl, Button * ); DECL_LINK( ListDoubleClickHdl, ListBox * ); diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx index f60093dc601f..479947d4f254 100644 --- a/dbaccess/source/ui/inc/WCopyTable.hxx +++ b/dbaccess/source/ui/inc/WCopyTable.hxx @@ -238,11 +238,11 @@ namespace dbaui ODatabaseExport::TColumns m_vSourceColumns; ODatabaseExport::TColumnVector m_vSourceVec; - HelpButton* m_pbHelp; - CancelButton* m_pbCancel; - PushButton* m_pbPrev; - PushButton* m_pbNext; - PushButton* m_pbFinish; + VclPtr<HelpButton> m_pbHelp; + VclPtr<CancelButton> m_pbCancel; + VclPtr<PushButton> m_pbPrev; + VclPtr<PushButton> m_pbNext; + VclPtr<PushButton> m_pbFinish; OTypeInfoMap m_aTypeInfo; ::std::vector<OTypeInfoMap::iterator> m_aTypeInfoIndex; diff --git a/dbaccess/source/ui/inc/WNameMatch.hxx b/dbaccess/source/ui/inc/WNameMatch.hxx index e4a05eed9223..61f71b56ce47 100644 --- a/dbaccess/source/ui/inc/WNameMatch.hxx +++ b/dbaccess/source/ui/inc/WNameMatch.hxx @@ -50,16 +50,16 @@ namespace dbaui // Name matching for data appending class OWizNameMatching : public OWizardPage { - FixedText *m_pTABLE_LEFT; - FixedText *m_pTABLE_RIGHT; - OColumnTreeBox *m_pCTRL_LEFT; // left side - OColumnTreeBox *m_pCTRL_RIGHT; // right side - PushButton *m_pColumn_up; - PushButton *m_pColumn_down; - PushButton *m_pColumn_up_right; - PushButton *m_pColumn_down_right; - PushButton *m_pAll; - PushButton *m_pNone; + VclPtr<FixedText> m_pTABLE_LEFT; + VclPtr<FixedText> m_pTABLE_RIGHT; + VclPtr<OColumnTreeBox> m_pCTRL_LEFT; // left side + VclPtr<OColumnTreeBox> m_pCTRL_RIGHT; // right side + VclPtr<PushButton> m_pColumn_up; + VclPtr<PushButton> m_pColumn_down; + VclPtr<PushButton> m_pColumn_up_right; + VclPtr<PushButton> m_pColumn_down_right; + VclPtr<PushButton> m_pAll; + VclPtr<PushButton> m_pNone; OUString m_sSourceText; OUString m_sDestText; Image m_aImgUp; @@ -78,7 +78,8 @@ namespace dbaui virtual OUString GetTitle() const SAL_OVERRIDE ; OWizNameMatching(vcl::Window* pParent); - + virtual ~OWizNameMatching(); + virtual void dispose() SAL_OVERRIDE; }; } #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WNAMEMATCH_HXX diff --git a/dbaccess/source/ui/inc/WTabPage.hxx b/dbaccess/source/ui/inc/WTabPage.hxx index 9a30d7c311fb..6a5d3ab48eb1 100644 --- a/dbaccess/source/ui/inc/WTabPage.hxx +++ b/dbaccess/source/ui/inc/WTabPage.hxx @@ -29,12 +29,14 @@ namespace dbaui class OWizardPage : public TabPage { protected: - OCopyTableWizard* m_pParent; + VclPtr<OCopyTableWizard> m_pParent; bool m_bFirstTime; // Page wird das erste mal gerufen ; should be set in the reset methode OWizardPage( vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription ); public: + virtual ~OWizardPage(); + virtual void dispose() SAL_OVERRIDE; virtual void Reset ( ) = 0; virtual bool LeavePage() = 0; virtual OUString GetTitle() const = 0; diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx index 046a484034ef..c2f7d8e3f53d 100644 --- a/dbaccess/source/ui/inc/WTypeSelect.hxx +++ b/dbaccess/source/ui/inc/WTypeSelect.hxx @@ -37,7 +37,7 @@ namespace dbaui class OWizTypeSelectControl : public OFieldDescControl { protected: - vcl::Window* m_pParentTabPage; + VclPtr<vcl::Window> m_pParentTabPage; virtual void ActivateAggregate( EControlType eType ) SAL_OVERRIDE; virtual void DeactivateAggregate( EControlType eType ) SAL_OVERRIDE; @@ -52,6 +52,8 @@ namespace dbaui public: OWizTypeSelectControl(vcl::Window* pParent, vcl::Window* pParentTabPage, OTableDesignHelpBar* pHelpBar=NULL); + virtual ~OWizTypeSelectControl(); + virtual void dispose() SAL_OVERRIDE; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() SAL_OVERRIDE; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() SAL_OVERRIDE; @@ -68,13 +70,15 @@ namespace dbaui bool _bSet = false); protected: virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; - vcl::Window* m_pParentTabPage; + VclPtr<vcl::Window> m_pParentTabPage; public: OWizTypeSelectList( vcl::Window* pParent, WinBits nStyle = WB_BORDER ) : MultiListBox(pParent,nStyle) , m_bPKey(false) , m_pParentTabPage(NULL) {} + virtual ~OWizTypeSelectList(); + virtual void dispose() SAL_OVERRIDE; void SetPKey(bool bPKey) { m_bPKey = bPKey; } void SetParentTabPage(vcl::Window* pParentTabPage) { m_pParentTabPage = pParentTabPage; } }; @@ -90,13 +94,13 @@ namespace dbaui DECL_LINK( ColumnSelectHdl, MultiListBox* ); DECL_LINK( ButtonClickHdl, Button * ); protected: - OWizTypeSelectList *m_pColumnNames; - FixedText *m_pColumns; - OWizTypeSelectControl *m_pTypeControl; - FixedText *m_pAutoType; - FixedText *m_pAutoFt; - NumericField *m_pAutoEt; - PushButton *m_pAutoPb; + VclPtr<OWizTypeSelectList> m_pColumnNames; + VclPtr<FixedText> m_pColumns; + VclPtr<OWizTypeSelectControl> m_pTypeControl; + VclPtr<FixedText> m_pAutoType; + VclPtr<FixedText> m_pAutoFt; + VclPtr<NumericField> m_pAutoEt; + VclPtr<PushButton> m_pAutoPb; Image m_imgPKey; SvStream* m_pParserStream; // stream to read the tokens from or NULL diff --git a/dbaccess/source/ui/inc/adtabdlg.hxx b/dbaccess/source/ui/inc/adtabdlg.hxx index 77b2400831cf..815f8c4d566a 100644 --- a/dbaccess/source/ui/inc/adtabdlg.hxx +++ b/dbaccess/source/ui/inc/adtabdlg.hxx @@ -58,15 +58,15 @@ namespace dbaui class OAddTableDlg : public ModelessDialog { - RadioButton* m_pCaseTables; - RadioButton* m_pCaseQueries; + VclPtr<RadioButton> m_pCaseTables; + VclPtr<RadioButton> m_pCaseQueries; - OTableTreeListBox* m_pTableList; - SvTreeListBox* m_pQueryList; + VclPtr<OTableTreeListBox> m_pTableList; + VclPtr<SvTreeListBox> m_pQueryList; boost::scoped_ptr< TableObjectListFacade > m_xCurrentList; - PushButton* m_pAddButton; - PushButton* m_pCloseButton; + VclPtr<PushButton> m_pAddButton; + VclPtr<PushButton> m_pCloseButton; IAddTableDialogContext& m_rContext; diff --git a/dbaccess/source/ui/inc/brwview.hxx b/dbaccess/source/ui/inc/brwview.hxx index 7768ae345bfb..e68ff09847c4 100644 --- a/dbaccess/source/ui/inc/brwview.hxx +++ b/dbaccess/source/ui/inc/brwview.hxx @@ -46,10 +46,10 @@ namespace dbaui protected: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > m_xGrid; // our grid's UNO representation ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > m_xMe; // our own UNO representation - DBTreeView* m_pTreeView; - Splitter* m_pSplitter; - mutable SbaGridControl* m_pVclControl; // our grid's VCL representation - vcl::Window* m_pStatus; + VclPtr<DBTreeView> m_pTreeView; + VclPtr<Splitter> m_pSplitter; + mutable VclPtr<SbaGridControl> m_pVclControl; // our grid's VCL representation + VclPtr<vcl::Window> m_pStatus; DECL_LINK( SplitHdl, void* ); // attribute access @@ -94,7 +94,7 @@ namespace dbaui class BrowserViewStatusDisplay { protected: - UnoDataBrowserView* m_pView; + VclPtr<UnoDataBrowserView> m_pView; public: BrowserViewStatusDisplay( UnoDataBrowserView* _pView, const OUString& _rStatus ); diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx index 0ec359e13978..4dff5e14ca9f 100644 --- a/dbaccess/source/ui/inc/curledit.hxx +++ b/dbaccess/source/ui/inc/curledit.hxx @@ -36,7 +36,7 @@ class OConnectionURLEdit : public Edit { ::dbaccess::ODsnTypeCollection* m_pTypeCollection; - FixedText* m_pForcedPrefix; + VclPtr<FixedText> m_pForcedPrefix; OUString m_sSaveValueNoPrefix; bool m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not diff --git a/dbaccess/source/ui/inc/datasourceconnector.hxx b/dbaccess/source/ui/inc/datasourceconnector.hxx index f5d64a0f48cd..c5459ecbe15b 100644 --- a/dbaccess/source/ui/inc/datasourceconnector.hxx +++ b/dbaccess/source/ui/inc/datasourceconnector.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> +#include <vcl/vclptr.hxx> namespace dbtools { @@ -38,10 +39,10 @@ namespace dbaui class ODatasourceConnector { protected: - vcl::Window* m_pErrorMessageParent; + VclPtr<vcl::Window> m_pErrorMessageParent; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > - m_xContext; - OUString m_sContextInformation; + m_xContext; + OUString m_sContextInformation; public: ODatasourceConnector( diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx index 3529dae34699..ce39f6f02282 100644 --- a/dbaccess/source/ui/inc/dbwizsetup.hxx +++ b/dbaccess/source/ui/inc/dbwizsetup.hxx @@ -85,9 +85,9 @@ private: OUString m_sRM_FinalText; INetURLObject m_aDocURL; OUString m_sWorkPath; - OGeneralPageWizard* m_pGeneralPage; - OMySQLIntroPageSetup* m_pMySQLIntroPage; - OFinalDBPageSetup* m_pFinalPage; + VclPtr<OGeneralPageWizard> m_pGeneralPage; + VclPtr<OMySQLIntroPageSetup> m_pMySQLIntroPage; + VclPtr<OFinalDBPageSetup> m_pFinalPage; ::dbaccess::ODsnTypeCollection* m_pCollection; /// the DSN type collection instance diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index c0858a729dea..49a060fbf23b 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -46,13 +46,13 @@ namespace dbaui OModuleClient m_aModuleClient; ::osl::Mutex m_aMutex; - MultiLineEditSyntaxHighlight* m_pSQL; - PushButton* m_pExecute; - ListBox* m_pSQLHistory; - VclMultiLineEdit* m_pStatus; - CheckBox* m_pShowOutput; - VclMultiLineEdit* m_pOutput; - PushButton* m_pClose; + VclPtr<MultiLineEditSyntaxHighlight> m_pSQL; + VclPtr<PushButton> m_pExecute; + VclPtr<ListBox> m_pSQLHistory; + VclPtr<VclMultiLineEdit> m_pStatus; + VclPtr<CheckBox> m_pShowOutput; + VclPtr<VclMultiLineEdit> m_pOutput; + VclPtr<PushButton> m_pClose; typedef ::std::deque< OUString > StringQueue; StringQueue m_aStatementHistory; // previous statements diff --git a/dbaccess/source/ui/inc/dlgsize.hxx b/dbaccess/source/ui/inc/dlgsize.hxx index e145cf7675ad..1d51ed11a534 100644 --- a/dbaccess/source/ui/inc/dlgsize.hxx +++ b/dbaccess/source/ui/inc/dlgsize.hxx @@ -39,11 +39,13 @@ namespace dbaui protected: DECL_LINK( CbClickHdl, Button * ); - MetricField* m_pMF_VALUE; - CheckBox* m_pCB_STANDARD; + VclPtr<MetricField> m_pMF_VALUE; + VclPtr<CheckBox> m_pCB_STANDARD; public: DlgSize( vcl::Window * pParent, sal_Int32 nVal, bool bRow, sal_Int32 _nAlternativeStandard = -1 ); + virtual ~DlgSize(); + virtual void dispose() SAL_OVERRIDE; sal_Int32 GetValue(); }; } // namespace dbaui diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx index 75f8661dd4a6..bd595e012263 100644 --- a/dbaccess/source/ui/inc/indexdialog.hxx +++ b/dbaccess/source/ui/inc/indexdialog.hxx @@ -85,15 +85,15 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; SvtViewOptions m_aGeometrySettings; - ToolBox *m_pActions; - DbaIndexList *m_pIndexList; - FixedText *m_pIndexDetails; - FixedText *m_pDescriptionLabel; - FixedText *m_pDescription; - CheckBox *m_pUnique; - FixedText *m_pFieldsLabel; - IndexFieldsControl *m_pFields; - PushButton *m_pClose; + VclPtr<ToolBox> m_pActions; + VclPtr<DbaIndexList> m_pIndexList; + VclPtr<FixedText> m_pIndexDetails; + VclPtr<FixedText> m_pDescriptionLabel; + VclPtr<FixedText> m_pDescription; + VclPtr<CheckBox> m_pUnique; + VclPtr<FixedText> m_pFieldsLabel; + VclPtr<IndexFieldsControl> m_pFields; + VclPtr<PushButton> m_pClose; OIndexCollection* m_pIndexes; SvTreeListEntry* m_pPreviousSelection; diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx index df9a8f5715f0..3f262156d129 100644 --- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx +++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx @@ -40,8 +40,8 @@ namespace dbaui Link m_aModifyHdl; - ::svt::ListBoxControl* m_pSortingCell; - ::svt::ListBoxControl* m_pFieldNameCell; + VclPtr<::svt::ListBoxControl> m_pSortingCell; + VclPtr<::svt::ListBoxControl> m_pFieldNameCell; OUString m_sAscendingText; OUString m_sDescendingText; diff --git a/dbaccess/source/ui/inc/linkeddocuments.hxx b/dbaccess/source/ui/inc/linkeddocuments.hxx index 7c597b24624e..a13383b71955 100644 --- a/dbaccess/source/ui/inc/linkeddocuments.hxx +++ b/dbaccess/source/ui/inc/linkeddocuments.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp> #include <comphelper/namedvaluecollection.hxx> +#include <vcl/vclptr.hxx> namespace vcl { class Window; } namespace dbaui @@ -49,7 +50,7 @@ namespace dbaui m_xConnection; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI > m_xDocumentUI; - vcl::Window* m_pDialogParent; + VclPtr<vcl::Window> m_pDialogParent; OUString m_sCurrentlyEditing; OUString m_sDataSourceName; diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx index 7e27a3df57cd..11db9808841f 100644 --- a/dbaccess/source/ui/inc/paramdialog.hxx +++ b/dbaccess/source/ui/inc/paramdialog.hxx @@ -52,11 +52,11 @@ namespace dbaui { protected: // the controls - ListBox* m_pAllParams; - Edit* m_pParam; - PushButton* m_pTravelNext; - OKButton* m_pOKBtn; - CancelButton* m_pCancelBtn; + VclPtr<ListBox> m_pAllParams; + VclPtr<Edit> m_pParam; + VclPtr<PushButton> m_pTravelNext; + VclPtr<OKButton> m_pOKBtn; + VclPtr<CancelButton> m_pCancelBtn; sal_Int32 m_nCurrentlySelected; diff --git a/dbaccess/source/ui/inc/querycontainerwindow.hxx b/dbaccess/source/ui/inc/querycontainerwindow.hxx index ba2447c854d6..5c1e151aedbe 100644 --- a/dbaccess/source/ui/inc/querycontainerwindow.hxx +++ b/dbaccess/source/ui/inc/querycontainerwindow.hxx @@ -42,8 +42,8 @@ namespace dbaui class OQueryContainerWindow : public ODataView { OQueryViewSwitch* m_pViewSwitch; - OBeamer* m_pBeamer; - Splitter* m_pSplitter; + VclPtr<OBeamer> m_pBeamer; + VclPtr<Splitter> m_pSplitter; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xBeamer; DECL_LINK( SplitHdl, void* ); diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx index e5286f42045d..06cc9510080f 100644 --- a/dbaccess/source/ui/inc/queryfilter.hxx +++ b/dbaccess/source/ui/inc/queryfilter.hxx @@ -67,19 +67,19 @@ namespace dbaui ,public ::svxform::OParseContextClient { private: - ListBox* m_pLB_WHEREFIELD1; - ListBox* m_pLB_WHERECOMP1; - Edit* m_pET_WHEREVALUE1; + VclPtr<ListBox> m_pLB_WHEREFIELD1; + VclPtr<ListBox> m_pLB_WHERECOMP1; + VclPtr<Edit> m_pET_WHEREVALUE1; - ListBox* m_pLB_WHERECOND2; - ListBox* m_pLB_WHEREFIELD2; - ListBox* m_pLB_WHERECOMP2; - Edit* m_pET_WHEREVALUE2; + VclPtr<ListBox> m_pLB_WHERECOND2; + VclPtr<ListBox> m_pLB_WHEREFIELD2; + VclPtr<ListBox> m_pLB_WHERECOMP2; + VclPtr<Edit> m_pET_WHEREVALUE2; - ListBox* m_pLB_WHERECOND3; - ListBox* m_pLB_WHEREFIELD3; - ListBox* m_pLB_WHERECOMP3; - Edit* m_pET_WHEREVALUE3; + VclPtr<ListBox> m_pLB_WHERECOND3; + VclPtr<ListBox> m_pLB_WHEREFIELD3; + VclPtr<ListBox> m_pLB_WHERECOMP3; + VclPtr<Edit> m_pET_WHEREVALUE3; OUString m_aSTR_COMPARE_OPERATORS; @@ -112,6 +112,8 @@ namespace dbaui const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer>& _rxComposer, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxCols ); + virtual ~DlgFilterCrit(); + virtual void dispose() SAL_OVERRIDE; void BuildWherePart(); diff --git a/dbaccess/source/ui/inc/queryorder.hxx b/dbaccess/source/ui/inc/queryorder.hxx index 706e70176fb9..46da94464b53 100644 --- a/dbaccess/source/ui/inc/queryorder.hxx +++ b/dbaccess/source/ui/inc/queryorder.hxx @@ -59,12 +59,12 @@ namespace dbaui class DlgOrderCrit : public ModalDialog { protected: - ListBox* m_pLB_ORDERFIELD1; - ListBox* m_pLB_ORDERVALUE1; - ListBox* m_pLB_ORDERFIELD2; - ListBox* m_pLB_ORDERVALUE2; - ListBox* m_pLB_ORDERFIELD3; - ListBox* m_pLB_ORDERVALUE3; + VclPtr<ListBox> m_pLB_ORDERFIELD1; + VclPtr<ListBox> m_pLB_ORDERVALUE1; + VclPtr<ListBox> m_pLB_ORDERFIELD2; + VclPtr<ListBox> m_pLB_ORDERVALUE2; + VclPtr<ListBox> m_pLB_ORDERFIELD3; + VclPtr<ListBox> m_pLB_ORDERVALUE3; OUString aSTR_NOENTRY; OUString m_sOrgOrder; @@ -72,8 +72,8 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; - ListBox* m_aColumnList[DOG_ROWS]; - ListBox* m_aValueList[DOG_ROWS]; + VclPtr<ListBox> m_aColumnList[DOG_ROWS]; + VclPtr<ListBox> m_aValueList[DOG_ROWS]; DECL_LINK( FieldListSelectHdl, ListBox * ); void EnableLines(); @@ -83,6 +83,8 @@ namespace dbaui const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer>& _rxComposer, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxCols); + virtual ~DlgOrderCrit(); + virtual void dispose() SAL_OVERRIDE; void BuildOrderPart(); diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index 87b936b9b786..2e5ac221ee65 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -43,7 +43,7 @@ namespace dbaui Timer m_timerUndoActionCreation; Link m_lnkTextModifyHdl; OUString m_strOrigText; // is restored on undo - OQueryTextView* m_pView; + VclPtr<OQueryTextView> m_pView; bool m_bAccelAction; // is set on cut, copy, paste bool m_bStopTimer; svtools::ColorConfig m_ColorConfig; diff --git a/dbaccess/source/ui/inc/textconnectionsettings.hxx b/dbaccess/source/ui/inc/textconnectionsettings.hxx index 528382def297..fdd5a9489121 100644 --- a/dbaccess/source/ui/inc/textconnectionsettings.hxx +++ b/dbaccess/source/ui/inc/textconnectionsettings.hxx @@ -38,6 +38,8 @@ namespace dbaui { public: TextConnectionSettingsDialog( vcl::Window* _pParent, SfxItemSet& _rItems ); + virtual ~TextConnectionSettingsDialog(); + virtual void dispose() SAL_OVERRIDE; /** initializes a set of PropertyStorage instaces, which are bound to the text-connection relevant items in our item sets @@ -48,7 +50,7 @@ namespace dbaui private: ::std::unique_ptr< OTextConnectionHelper > m_pTextConnectionHelper; - OKButton *m_pOK; + VclPtr<OKButton> m_pOK; SfxItemSet& m_rItems; private: diff --git a/dbaccess/source/ui/inc/undosqledit.hxx b/dbaccess/source/ui/inc/undosqledit.hxx index e9307c66c599..66a2f48795c3 100644 --- a/dbaccess/source/ui/inc/undosqledit.hxx +++ b/dbaccess/source/ui/inc/undosqledit.hxx @@ -21,6 +21,7 @@ #include "GeneralUndo.hxx" #include "dbu_control.hrc" +#include <vcl/vclptr.hxx> namespace dbaui { @@ -29,7 +30,7 @@ namespace dbaui class OSqlEditUndoAct : public OCommentUndoAction { protected: - OSqlEdit* m_pOwner; + VclPtr<OSqlEdit> m_pOwner; OUString m_strNextText; virtual void Undo() SAL_OVERRIDE { ToggleText(); } diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index cd15a2f5a200..637d1aa6ba06 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -100,11 +100,11 @@ namespace dbaui OUString m_sQueryCommand; // the command of the query currently loaded (if any) //OUString m_sToBeLoaded; // contains the element name which should be loaded if any - DBTreeView* m_pTreeView; - Splitter* m_pSplitter; - SvTreeList* m_pTreeModel; // contains the datasources of the registry - SvTreeListEntry* m_pCurrentlyDisplayed; - ImplSVEvent * m_nAsyncDrop; + VclPtr<DBTreeView> m_pTreeView; + VclPtr<Splitter> m_pSplitter; + SvTreeList* m_pTreeModel; // contains the datasources of the registry + SvTreeListEntry* m_pCurrentlyDisplayed; + ImplSVEvent * m_nAsyncDrop; sal_Int16 m_nBorder; // sal_True when border should be shown diff --git a/dbaccess/source/ui/misc/ToolBoxHelper.cxx b/dbaccess/source/ui/misc/ToolBoxHelper.cxx index ac5e461bd951..52f658e12aea 100644 --- a/dbaccess/source/ui/misc/ToolBoxHelper.cxx +++ b/dbaccess/source/ui/misc/ToolBoxHelper.cxx @@ -92,7 +92,7 @@ namespace dbaui } void OToolBoxHelper::setToolBox(ToolBox* _pTB) { - bool bFirstTime = (m_pToolBox == NULL); + bool bFirstTime = (m_pToolBox == nullptr); m_pToolBox = _pTB; if ( m_pToolBox ) { diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index db87ee74faa0..4b5aac2950b4 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -19,6 +19,8 @@ #include "WCPage.hxx" #include "WCopyTable.hxx" +#include "WColumnSelect.hxx" +#include "WExtendPages.hxx" #include "defaultobjectnamecheck.hxx" #include <tools/debug.hxx> @@ -101,6 +103,27 @@ OCopyTable::OCopyTable(vcl::Window * pParent) SetText(ModuleRes(STR_COPYTABLE_TITLE_COPY)); } +OCopyTable::~OCopyTable() +{ + dispose(); +} + +void OCopyTable::dispose() +{ + m_pEdTableName.clear(); + m_pRB_DefData.clear(); + m_pRB_Def.clear(); + m_pRB_View.clear(); + m_pRB_AppendData.clear(); + m_pCB_UseHeaderLine.clear(); + m_pCB_PrimaryColumn.clear(); + m_pFT_KeyName.clear(); + m_pEdKeyName.clear(); + m_pPage2.clear(); + m_pPage3.clear(); + OWizardPage::dispose(); +} + IMPL_LINK( OCopyTable, AppendDataClickHdl, Button*, /*pButton*/ ) { diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index dbb53a8313d6..f3d4a2dce93d 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -50,6 +50,17 @@ OWizardPage::OWizardPage(vcl::Window* pParent, const OString& rID, const OUStrin { } +OWizardPage::~OWizardPage() +{ + dispose(); +} + +void OWizardPage::dispose() +{ + m_pParent.clear(); + TabPage::dispose(); +} + // OWizColumnSelect OWizColumnSelect::OWizColumnSelect( vcl::Window* pParent) :OWizardPage( pParent, "ApplyColPage", "dbaccess/ui/applycolpage.ui") @@ -95,6 +106,12 @@ void OWizColumnSelect::dispose() m_pNewColumnNames->RemoveEntry(0); } m_pNewColumnNames->Clear(); + m_pOrgColumnNames.clear(); + m_pColumn_RH.clear(); + m_pColumns_RH.clear(); + m_pColumn_LH.clear(); + m_pColumns_LH.clear(); + m_pNewColumnNames.clear(); OWizardPage::dispose(); } diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index f4394921c68a..887a1d06ba4e 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -710,11 +710,11 @@ void OCopyTableWizard::dispose() m_aTypeInfo.clear(); m_aDestTypeInfoIndex.clear(); - delete m_pbHelp; - delete m_pbCancel; - delete m_pbPrev; - delete m_pbNext; - delete m_pbFinish; + m_pbHelp.clear(); + m_pbCancel.clear(); + m_pbPrev.clear(); + m_pbNext.clear(); + m_pbFinish.clear(); WizardDialog::dispose(); } diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index a837ff2670de..2707ed7ff09f 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -72,6 +72,26 @@ OWizNameMatching::OWizNameMatching( vcl::Window* pParent) m_sDestText += "\n"; } +OWizNameMatching::~OWizNameMatching() +{ + dispose(); +} + +void OWizNameMatching::dispose() +{ + m_pTABLE_LEFT.clear(); + m_pTABLE_RIGHT.clear(); + m_pCTRL_LEFT.clear(); + m_pCTRL_RIGHT.clear(); + m_pColumn_up.clear(); + m_pColumn_down.clear(); + m_pColumn_up_right.clear(); + m_pColumn_down_right.clear(); + m_pAll.clear(); + m_pNone.clear(); + OWizardPage::dispose(); +} + void OWizNameMatching::Reset() { // urspr"unglichen zustand wiederherstellen diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 44c2b6b2eafd..0eb7d8f2ae4d 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -49,6 +49,17 @@ OWizTypeSelectControl::OWizTypeSelectControl(vcl::Window* pParent, vcl::Window* m_pParentTabPage = pParentTabPage; } +OWizTypeSelectControl::~OWizTypeSelectControl() +{ + dispose(); +} + +void OWizTypeSelectControl::dispose() +{ + m_pParentTabPage.clear(); + OFieldDescControl::dispose(); +} + void OWizTypeSelectControl::ActivateAggregate( EControlType eType ) { switch(eType ) @@ -82,7 +93,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) OSL_ENSURE(nRow == -1,"nRow muss -1 sein!"); (void)nRow; - MultiListBox *pListBox = static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pColumnNames; + MultiListBox *pListBox = static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pColumnNames; OFieldDescription* pCurFieldDescr = getCurrentFieldDescData(); @@ -132,13 +143,13 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) pWiz->showError(strMessage); pCurFieldDescr->SetName(sName); DisplayData(pCurFieldDescr); - static_cast<OWizTypeSelect*>(m_pParentTabPage)->setDuplicateName(true); + static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->setDuplicateName(true); return; } OUString sOldName = pCurFieldDescr->GetName(); pCurFieldDescr->SetName(sNewName); - static_cast<OWizTypeSelect*>(m_pParentTabPage)->setDuplicateName(false); + static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->setDuplicateName(false); // now we change the name OCopyTableWizard::TNameMapping::iterator aIter = pWiz->m_mNameMapping.begin(); @@ -167,42 +178,42 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) ::com::sun::star::lang::Locale OWizTypeSelectControl::GetLocale() const { - return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->GetLocale(); + return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->GetLocale(); } Reference< XNumberFormatter > OWizTypeSelectControl::GetFormatter() const { - return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->GetFormatter(); + return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->GetFormatter(); } TOTypeInfoSP OWizTypeSelectControl::getTypeInfo(sal_Int32 _nPos) { - return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->getDestTypeInfo(_nPos); + return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->getDestTypeInfo(_nPos); } const OTypeInfoMap* OWizTypeSelectControl::getTypeInfo() const { - return &static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->getDestTypeInfo(); + return &static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->getDestTypeInfo(); } ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> OWizTypeSelectControl::getMetaData() { - return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->m_xDestConnection->getMetaData(); + return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->m_xDestConnection->getMetaData(); } ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> OWizTypeSelectControl::getConnection() { - return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->m_xDestConnection; + return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->m_xDestConnection; } bool OWizTypeSelectControl::isAutoIncrementValueEnabled() const { - return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_bAutoIncrementEnabled; + return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_bAutoIncrementEnabled; } OUString OWizTypeSelectControl::getAutoIncrementValue() const { - return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_sAutoIncrementValue; + return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_sAutoIncrementValue; } #define IMG_PRIMARY_KEY 1 @@ -255,7 +266,13 @@ OWizTypeSelect::~OWizTypeSelect() void OWizTypeSelect::dispose() { - delete m_pTypeControl; + m_pTypeControl.clear(); + m_pColumnNames.clear(); + m_pColumns.clear(); + m_pAutoType.clear(); + m_pAutoFt.clear(); + m_pAutoEt.clear(); + m_pAutoPb.clear(); OWizardPage::dispose(); } @@ -345,6 +362,17 @@ IMPL_LINK( OWizTypeSelect, ButtonClickHdl, Button *, /*pButton*/ ) return 0; } +OWizTypeSelectList::~OWizTypeSelectList() +{ + dispose(); +} + +void OWizTypeSelectList::dispose() +{ + m_pParentTabPage.clear(); + MultiListBox::dispose(); +} + bool OWizTypeSelectList::IsPrimaryKeyAllowed() const { sal_uInt16 nCount = GetSelectEntryCount(); @@ -365,7 +393,7 @@ void OWizTypeSelectList::setPrimaryKey(OFieldDescription* _pFieldDescr, sal_uInt RemoveEntry(_nPos); _pFieldDescr->SetPrimaryKey(_bSet); if( _bSet ) - InsertEntry(sColumnName, static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_imgPKey,_nPos); + InsertEntry(sColumnName, static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_imgPKey,_nPos); else if( _pFieldDescr->getTypeInfo()->bNullable ) { _pFieldDescr->SetControlDefault(Any()); diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index 3f55ef279a78..77408cdaf51a 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -18,6 +18,7 @@ */ #include <dbaccess/dbaundomanager.hxx> +#include <dbaccess/dataview.hxx> #include "singledoccontroller.hxx" #include "browserids.hxx" #include "dbu_misc.hrc" diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx index 2b6b3a42db34..af7ef4ec89a0 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx @@ -82,10 +82,10 @@ namespace dbaui { // search the position of our table window in the table window map nIndex = m_pLine->GetParent()->GetTabWinMap().size(); - const ::std::vector<OTableConnection*>& rVec = m_pLine->GetParent()->getTableConnections(); - ::std::vector<OTableConnection*>::const_iterator aIter = rVec.begin(); - ::std::vector<OTableConnection*>::const_iterator aEnd = rVec.end(); - for (; aIter != aEnd && (*aIter) != m_pLine; ++nIndex,++aIter) + const auto& rVec = m_pLine->GetParent()->getTableConnections(); + auto aIter = rVec.begin(); + auto aEnd = rVec.end(); + for (; aIter != aEnd && (*aIter).get() != m_pLine; ++nIndex,++aIter) ; nIndex = ( aIter != aEnd ) ? nIndex : -1; } @@ -186,6 +186,7 @@ namespace dbaui { // clear vector clearLineData(); + m_pParent.clear(); vcl::Window::dispose(); } bool OConnectionLineAccess::isEditable() const diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 9e192e66b3ab..9aab0ceccfbf 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -225,7 +225,7 @@ FeatureState OJoinController::GetState(sal_uInt16 _nId) const case ID_BROWSER_ADDTABLE: aReturn.bEnabled = ( getView() != NULL ) && const_cast< OJoinController* >( this )->getJoinView()->getTableView()->IsAddAllowed(); - aReturn.bChecked = aReturn.bEnabled && m_pAddTableDialog != NULL && m_pAddTableDialog->IsVisible() ; + aReturn.bChecked = aReturn.bEnabled && m_pAddTableDialog != nullptr && m_pAddTableDialog->IsVisible() ; if ( aReturn.bEnabled ) aReturn.sTitle = OAddTableDlg::getDialogTitleForContext( impl_getDialogContext() ); break; diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx index 58399a08f0e8..de5b30488a57 100644 --- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx +++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx @@ -66,10 +66,8 @@ OJoinDesignView::~OJoinDesignView() void OJoinDesignView::dispose() { - boost::scoped_ptr<vcl::Window> aT3(m_pScrollWindow); - m_pScrollWindow = NULL; - boost::scoped_ptr<vcl::Window> aT2(m_pTableView); - m_pTableView = NULL; + m_pScrollWindow.clear(); + m_pTableView.clear(); ODataView::dispose(); } diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index be2b0e0bde1e..ad15132b72ef 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -94,11 +94,10 @@ OScrollWindowHelper::~OScrollWindowHelper() void OScrollWindowHelper::dispose() { - boost::scoped_ptr<vcl::Window> aTemp(m_pCornerWindow); - m_pCornerWindow = NULL; - m_pTableView = NULL; m_aHScrollBar.disposeAndClear(); m_aVScrollBar.disposeAndClear(); + m_pCornerWindow.clear(); + m_pTableView.clear(); vcl::Window::dispose(); } @@ -194,6 +193,11 @@ void OJoinTableView::dispose() } // delete lists clearLayoutInformation(); + m_pDragWin.clear(); + m_pSizingWin.clear(); + m_pSelectedConn.clear(); + m_pLastFocusTabWin.clear(); + m_pView.clear(); vcl::Window::dispose(); } @@ -271,7 +275,7 @@ OTableWindow* OJoinTableView::GetTabWindow( const OUString& rName ) { OTableWindowMap::iterator aIter = m_aTableMap.find(rName); - return aIter == m_aTableMap.end() ? NULL : aIter->second; + return aIter == m_aTableMap.end() ? nullptr : aIter->second; } TTableWindowData::value_type OJoinTableView::createTableWindowData(const OUString& _rComposedName @@ -354,7 +358,7 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) bool bRemove = true; TTableWindowData::value_type pData = pTabWin->GetData(); sal_Int32 nCount = m_vTableConnection.size(); - ::std::vector<OTableConnection*>::reverse_iterator aIter = m_vTableConnection.rbegin(); + auto aIter = m_vTableConnection.rbegin(); while(aIter != m_vTableConnection.rend() && bRemove) { OTableConnection* pTabConn = (*aIter); @@ -828,8 +832,8 @@ void OJoinTableView::MouseButtonUp( const MouseEvent& rEvt ) { DeselectConn(GetSelectedConn()); - ::std::vector<OTableConnection*>::iterator aIter = m_vTableConnection.begin(); - ::std::vector<OTableConnection*>::iterator aEnd = m_vTableConnection.end(); + auto aIter = m_vTableConnection.begin(); + auto aEnd = m_vTableConnection.end(); for(;aIter != aEnd;++aIter) { if( (*aIter)->CheckHit(rEvt.GetPosPixel()) ) @@ -941,20 +945,21 @@ void OJoinTableView::Paint( const Rectangle& rRect ) void OJoinTableView::InvalidateConnections() { // draw Joins - ::std::for_each(m_vTableConnection.begin(),m_vTableConnection.end(), - ::std::mem_fun(& OTableConnection::InvalidateConnection)); + for(auto & conn : m_vTableConnection) + conn->InvalidateConnection(); } void OJoinTableView::DrawConnections( const Rectangle& rRect ) { // draw Joins - ::std::for_each(m_vTableConnection.begin(),m_vTableConnection.end(),boost::bind( &OTableConnection::Draw, _1, boost::cref( rRect ))); + for(auto conn : m_vTableConnection) + conn->Draw(rRect); // finally redraw the selected one above all others if (GetSelectedConn()) GetSelectedConn()->Draw( rRect ); } -::std::vector<OTableConnection*>::const_iterator OJoinTableView::getTableConnections(const OTableWindow* _pFromWin) const +::std::vector<VclPtr<OTableConnection> >::const_iterator OJoinTableView::getTableConnections(const OTableWindow* _pFromWin) const { return ::std::find_if( m_vTableConnection.begin(), m_vTableConnection.end(), @@ -980,8 +985,8 @@ void OJoinTableView::ClearAll() HideTabWins(); // and the same with the Connections - ::std::vector<OTableConnection*>::iterator aIter = m_vTableConnection.begin(); - ::std::vector<OTableConnection*>::iterator aEnd = m_vTableConnection.end(); + auto aIter = m_vTableConnection.begin(); + auto aEnd = m_vTableConnection.end(); for(;aIter != aEnd;++aIter) RemoveConnection( *aIter ,true); m_vTableConnection.clear(); @@ -997,7 +1002,7 @@ void OJoinTableView::ClearAll() bool OJoinTableView::ScrollWhileDragging() { - OSL_ENSURE(m_pDragWin != NULL, "OJoinTableView::ScrollWhileDragging must not be called when a window is being dragged !"); + OSL_ENSURE(m_pDragWin != nullptr, "OJoinTableView::ScrollWhileDragging must not be called when a window is being dragged !"); // kill the timer if (m_aDragScrollIdle.IsActive()) @@ -1169,8 +1174,8 @@ void OJoinTableView::Command(const CommandEvent& rEvt) DeselectConn(pSelConnection); const Point& aMousePos = rEvt.GetMousePosPixel(); - ::std::vector<OTableConnection*>::iterator aIter = m_vTableConnection.begin(); - ::std::vector<OTableConnection*>::iterator aEnd = m_vTableConnection.end(); + auto aIter = m_vTableConnection.begin(); + auto aEnd = m_vTableConnection.end(); for(;aIter != aEnd;++aIter) { if( (*aIter)->CheckHit(aMousePos) ) @@ -1199,8 +1204,8 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab { bool bFoundStart = _rpFirstAfter ? sal_False : sal_True; - ::std::vector<OTableConnection*>::const_iterator aIter = m_vTableConnection.begin(); - ::std::vector<OTableConnection*>::const_iterator aEnd = m_vTableConnection.end(); + auto aIter = m_vTableConnection.begin(); + auto aEnd = m_vTableConnection.end(); for(;aIter != aEnd;++aIter) { OTableConnection* pData = *aIter; @@ -1332,12 +1337,12 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt) { // no active tab win -> travel the connections // find the currently selected conn within the conn list sal_Int32 i(0); - for ( ::std::vector<OTableConnection*>::iterator connectionIter = m_vTableConnection.begin(); + for ( auto connectionIter = m_vTableConnection.begin(); connectionIter != m_vTableConnection.end(); ++connectionIter, ++i ) { - if ( (*connectionIter) == GetSelectedConn() ) + if ( (*connectionIter).get() == GetSelectedConn() ) break; } if (i == sal_Int32(m_vTableConnection.size() - 1) && bForward) @@ -1531,11 +1536,6 @@ void OJoinTableView::clearLayoutInformation() m_aTableMap.clear(); - ::std::vector<OTableConnection*>::const_iterator aIter2 = m_vTableConnection.begin(); - ::std::vector<OTableConnection*>::const_iterator aEnd2 = m_vTableConnection.end(); - for(;aIter2 != aEnd2;++aIter2) - delete *aIter2; - m_vTableConnection.clear(); } diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx index e12ad2990e59..607552ff2389 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.cxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx @@ -144,7 +144,7 @@ void OQueryTableWindow::OnEntryDoubleClicked(SvTreeListEntry* pEntry) bool OQueryTableWindow::ExistsField(const OUString& strFieldName, OTableFieldDescRef& rInfo) { - OSL_ENSURE(m_pListBox != NULL, "OQueryTableWindow::ExistsField : doesn't have ::com::sun::star::form::ListBox !"); + OSL_ENSURE(m_pListBox != nullptr, "OQueryTableWindow::ExistsField : doesn't have ::com::sun::star::form::ListBox !"); OSL_ENSURE(rInfo.is(),"OQueryTableWindow::ExistsField: invalid argument for OTableFieldDescRef!"); Reference< XConnection> xConnection = getTableView()->getDesignView()->getController().getConnection(); bool bExists = false; diff --git a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx index 61c7507d63f8..a009832b5624 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx @@ -30,7 +30,7 @@ namespace dbaui class OQueryDesignFieldUndoAct : public OCommentUndoAction { protected: - OSelectionBrowseBox* pOwner; + VclPtr<OSelectionBrowseBox> pOwner; sal_uInt16 m_nColumnPostion; virtual void Undo() SAL_OVERRIDE = 0; diff --git a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx index d74ce27e9fc7..9166a2e782c4 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx @@ -20,6 +20,7 @@ #define INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QUERYDESIGNUNDOACTION_HXX #include "GeneralUndo.hxx" +#include <vcl/vclptr.hxx> namespace dbaui { @@ -28,7 +29,7 @@ namespace dbaui class OQueryDesignUndoAction : public OCommentUndoAction { protected: - OJoinTableView* m_pOwner; // in this container it all happens + VclPtr<OJoinTableView> m_pOwner; // in this container it all happens public: OQueryDesignUndoAction(OJoinTableView* pOwner, sal_uInt16 nCommentID) : OCommentUndoAction(nCommentID), m_pOwner(pOwner) { } diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index e3c3ea24c014..378afe667f74 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -508,12 +508,12 @@ namespace pEntryConn->SetVisited(true); // first search for the "to" window - const ::std::vector<OTableConnection*>& rConnections = pEntryConn->GetParent()->getTableConnections(); - ::std::vector<OTableConnection*>::const_iterator aIter = rConnections.begin(); - ::std::vector<OTableConnection*>::const_iterator aEnd = rConnections.end(); + const auto& rConnections = pEntryConn->GetParent()->getTableConnections(); + auto aIter = rConnections.begin(); + auto aEnd = rConnections.end(); for(;aIter != aEnd;++aIter) { - OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>(*aIter); + OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>((*aIter).get()); if(!pNext->IsVisited() && (pNext->GetSourceWin() == pEntryTabTo || pNext->GetDestWin() == pEntryTabTo)) { OQueryTableWindow* pEntryTab = pNext->GetSourceWin() == pEntryTabTo ? static_cast<OQueryTableWindow*>(pNext->GetDestWin()) : static_cast<OQueryTableWindow*>(pNext->GetSourceWin()); @@ -531,7 +531,7 @@ namespace aIter = rConnections.begin(); for(;aIter != aEnd;++aIter) { - OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>(*aIter); + OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>((*aIter).get()); if(!pNext->IsVisited() && (pNext->GetSourceWin() == pEntryTabFrom || pNext->GetDestWin() == pEntryTabFrom)) { OQueryTableWindow* pEntryTab = pNext->GetSourceWin() == pEntryTabFrom ? static_cast<OQueryTableWindow*>(pNext->GetDestWin()) : static_cast<OQueryTableWindow*>(pNext->GetSourceWin()); @@ -665,7 +665,7 @@ namespace bool bFound = false; for(;!bFound && tableIter != tableEnd ;++tableIter) { - OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(tableIter->second); + OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(tableIter->second.get()); bFound = pTabWin->ExistsField( rFieldName, aInfo ); if ( bFound ) @@ -984,13 +984,13 @@ namespace void GenerateInnerJoinCriterias(const Reference< XConnection>& _xConnection, OUString& _rJoinCrit, - const ::std::vector<OTableConnection*>* _pConnList) + const ::std::vector<VclPtr<OTableConnection> >& _rConnList) { - ::std::vector<OTableConnection*>::const_iterator aIter = _pConnList->begin(); - ::std::vector<OTableConnection*>::const_iterator aEnd = _pConnList->end(); + auto aIter = _rConnList.begin(); + auto aEnd = _rConnList.end(); for(;aIter != aEnd;++aIter) { - const OQueryTableConnection* pEntryConn = static_cast<const OQueryTableConnection*>(*aIter); + const OQueryTableConnection* pEntryConn = static_cast<const OQueryTableConnection*>((*aIter).get()); OQueryTableConnectionData* pEntryConnData = static_cast<OQueryTableConnectionData*>(pEntryConn->GetData().get()); if ( pEntryConnData->GetJoinType() == INNER_JOIN && !pEntryConnData->isNatural() ) { @@ -1017,7 +1017,7 @@ namespace } OUString GenerateFromClause( const Reference< XConnection>& _xConnection, const OQueryTableView::OTableWindowMap* pTabList, - const ::std::vector<OTableConnection*>* pConnList + const ::std::vector<VclPtr<OTableConnection> >& rConnList ) { @@ -1026,14 +1026,14 @@ namespace tableNames_t aTableNames; // generate outer join clause in from - if(!pConnList->empty()) + if(!rConnList.empty()) { - ::std::vector<OTableConnection*>::const_iterator aIter = pConnList->begin(); - ::std::vector<OTableConnection*>::const_iterator aEnd = pConnList->end(); + auto aIter = rConnList.begin(); + auto aEnd = rConnList.end(); ::std::map<OTableWindow*,sal_Int32> aConnectionCount; for(;aIter != aEnd;++aIter) { - static_cast<OQueryTableConnection*>(*aIter)->SetVisited(false); + static_cast<OQueryTableConnection*>((*aIter).get())->SetVisited(false); ++aConnectionCount[(*aIter)->GetSourceWin()]; ++aConnectionCount[(*aIter)->GetDestWin()]; } @@ -1050,10 +1050,10 @@ namespace ::std::multimap<sal_Int32 , OTableWindow*>::reverse_iterator aREnd = aMulti.rend(); for(;aRIter != aREnd;++aRIter) { - ::std::vector<OTableConnection*>::const_iterator aConIter = aRIter->second->getTableView()->getTableConnections(aRIter->second); + auto aConIter = aRIter->second->getTableView()->getTableConnections(aRIter->second); for(;aConIter != aEnd;++aConIter) { - OQueryTableConnection* pEntryConn = static_cast<OQueryTableConnection*>(*aConIter); + OQueryTableConnection* pEntryConn = static_cast<OQueryTableConnection*>((*aConIter).get()); if(!pEntryConn->IsVisited() && pEntryConn->GetSourceWin() == aRIter->second ) { OUString aJoin; @@ -1096,10 +1096,10 @@ namespace // "FROM tbl1, tbl2 WHERE tbl1.col1=tlb2.col2" // rather than // "FROM tbl1 INNER JOIN tbl2 ON tbl1.col1=tlb2.col2" - aIter = pConnList->begin(); + aIter = rConnList.begin(); for(;aIter != aEnd;++aIter) { - OQueryTableConnection* pEntryConn = static_cast<OQueryTableConnection*>(*aIter); + OQueryTableConnection* pEntryConn = static_cast<OQueryTableConnection*>((*aIter).get()); if(!pEntryConn->IsVisited()) { searchAndAppendName(_xConnection, @@ -1119,7 +1119,7 @@ namespace OQueryTableView::OTableWindowMap::const_iterator aTabEnd = pTabList->end(); for(;aTabIter != aTabEnd;++aTabIter) { - const OQueryTableWindow* pEntryTab = static_cast<const OQueryTableWindow*>(aTabIter->second); + const OQueryTableWindow* pEntryTab = static_cast<const OQueryTableWindow*>(aTabIter->second.get()); if(!pEntryTab->ExistsAConn()) { aTableListStr += BuildTable(_xConnection,pEntryTab); @@ -1540,7 +1540,7 @@ namespace OJoinTableView::OTableWindowMap::iterator aTabEnd = rTabList.end(); for(;aIter != aTabEnd;++aIter) { - OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second); + OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second.get()); if (pTabWin->ExistsField( OUString("*"), aDragLeft )) { aDragLeft->SetAlias(OUString()); @@ -1748,7 +1748,7 @@ namespace OJoinTableView::OTableWindowMap::const_iterator aEnd = _rTabList.end(); for ( ; aIter != aEnd; ++aIter ) { - OQueryTableWindow* pTabWin = static_cast< OQueryTableWindow* >( aIter->second ); + OQueryTableWindow* pTabWin = static_cast< OQueryTableWindow* >( aIter->second.get() ); if ( pTabWin && pTabWin->ExistsField( _rColumName, _rInfo ) ) return pTabWin; } @@ -2104,7 +2104,7 @@ namespace OJoinTableView::OTableWindowMap::iterator aEnd = _pTabList->end(); for(;aIter != aEnd && eOk == eErrorCode ;++aIter) { - OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second); + OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second.get()); OTableFieldDescRef aInfo = new OTableFieldDesc(); if (pTabWin->ExistsField( sAsterisk, aInfo )) { @@ -2201,7 +2201,7 @@ namespace const OJoinTableView::OTableWindowMap::const_iterator aEnd = pTabList->end(); for(;aIter != aEnd;++aIter) { - OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second); + OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second.get()); if (pTabWin->ExistsField( OUString("*"), aInfo )) { aInfo->SetAlias(OUString()); @@ -2524,8 +2524,7 @@ void OQueryDesignView::dispose() { if ( m_pTableView ) ::dbaui::notifySystemWindow(this,m_pTableView,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); - boost::scoped_ptr<vcl::Window> aTemp(m_pSelectionBox); - m_pSelectionBox = NULL; + m_pSelectionBox.clear(); m_aSplitter.disposeAndClear(); OQueryView::dispose(); } @@ -2751,7 +2750,7 @@ void OQueryDesignView::fillValidFields(const OUString& sAliasName, ComboBox* pFi OJoinTableView::OTableWindowMap::iterator aEnd = rTabWins.end(); for(;aIter != aEnd;++aIter) { - OQueryTableWindow* pCurrentWin = static_cast<OQueryTableWindow*>(aIter->second); + OQueryTableWindow* pCurrentWin = static_cast<OQueryTableWindow*>(aIter->second.get()); if (bAllTables || (pCurrentWin->GetAliasName() == sAliasName)) { strCurrentPrefix = pCurrentWin->GetAliasName(); @@ -2851,9 +2850,9 @@ OUString OQueryDesignView::getStatement() // and trigger a error message // ----------------- Build table list ---------------------- - const ::std::vector<OTableConnection*>& rConnList = m_pTableView->getTableConnections(); + const auto& rConnList = m_pTableView->getTableConnections(); Reference< XConnection> xConnection = rController.getConnection(); - OUString aTableListStr(GenerateFromClause(xConnection,&rTabList,&rConnList)); + OUString aTableListStr(GenerateFromClause(xConnection,&rTabList,rConnList)); OSL_ENSURE(!aTableListStr.isEmpty(), "OQueryDesignView::getStatement() : unexpected : have Fields, but no Tables !"); // if fields exist now, these only can be created by inserting from an already existing table; if on the other hand // a table is deleted, also the belonging fields will be deleted -> therefore it CANNOT occur that fields @@ -2865,7 +2864,7 @@ OUString OQueryDesignView::getStatement() return OUString(); OUString aJoinCrit; - GenerateInnerJoinCriterias(xConnection,aJoinCrit,&rConnList); + GenerateInnerJoinCriterias(xConnection,aJoinCrit,rConnList); if(!aJoinCrit.isEmpty()) { OUString aTmp = "( " + aJoinCrit + " )"; diff --git a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx index 49060c1bc08e..b8c9f52ad0c1 100644 --- a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx @@ -31,7 +31,7 @@ namespace dbaui class OJoinMoveTabWinUndoAct : public OQueryDesignUndoAction { Point m_ptNextPosition; - OTableWindow* m_pTabWin; + VclPtr<OTableWindow> m_pTabWin; protected: void TogglePosition(); diff --git a/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx index 4de742deb1d4..bd9381468ca0 100644 --- a/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx @@ -31,7 +31,7 @@ namespace dbaui { Point m_ptNextPosition; Size m_szNextSize; - OTableWindow* m_pTabWin; + VclPtr<OTableWindow> m_pTabWin; protected: inline void ToggleSizePosition(); diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx index 16f8e0e4b7cd..85f3ff283985 100644 --- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx +++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx @@ -19,6 +19,7 @@ #include "QueryTabConnUndoAction.hxx" #include "QTableConnection.hxx" +#include "QTableWindow.hxx" #include <tools/debug.hxx> #include "QueryTableView.hxx" #include "QueryAddTabConnUndoAction.hxx" @@ -32,7 +33,6 @@ OQueryTabConnUndoAction::~OQueryTabConnUndoAction() if (m_bOwnerOfConn) { // I have the connection -> delete m_pOwner->DeselectConn(m_pConnection); - delete m_pConnection; } } @@ -50,13 +50,13 @@ OQueryAddTabConnUndoAction::OQueryAddTabConnUndoAction(OQueryTableView* pOwner) void OQueryAddTabConnUndoAction::Undo() { - static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection); + static_cast<OQueryTableView*>(m_pOwner.get())->DropConnection(m_pConnection); SetOwnership(true); } void OQueryAddTabConnUndoAction::Redo() { - static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection); + static_cast<OQueryTableView*>(m_pOwner.get())->GetConnection(m_pConnection); SetOwnership(false); } @@ -67,13 +67,13 @@ OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner) void OQueryDelTabConnUndoAction::Undo() { - static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection); + static_cast<OQueryTableView*>(m_pOwner.get())->GetConnection(m_pConnection); SetOwnership(false); } void OQueryDelTabConnUndoAction::Redo() { - static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection); + static_cast<OQueryTableView*>(m_pOwner.get())->DropConnection(m_pConnection); SetOwnership(true); } @@ -88,13 +88,13 @@ OQueryTabWinShowUndoAct::~OQueryTabWinShowUndoAct() void OQueryTabWinShowUndoAct::Undo() { - static_cast<OQueryTableView*>(m_pOwner)->HideTabWin(m_pTabWin, this); + static_cast<OQueryTableView*>(m_pOwner.get())->HideTabWin(m_pTabWin, this); SetOwnership(true); } void OQueryTabWinShowUndoAct::Redo() { - static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin(m_pTabWin, this,true); + static_cast<OQueryTableView*>(m_pOwner.get())->ShowTabWin(m_pTabWin, this,true); SetOwnership(false); } @@ -109,13 +109,13 @@ OQueryTabWinDelUndoAct::~OQueryTabWinDelUndoAct() void OQueryTabWinDelUndoAct::Undo() { - static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin( m_pTabWin, this,true ); + static_cast<OQueryTableView*>(m_pOwner.get())->ShowTabWin( m_pTabWin, this,true ); SetOwnership(false); } void OQueryTabWinDelUndoAct::Redo() { - static_cast<OQueryTableView*>(m_pOwner)->HideTabWin( m_pTabWin, this ); + static_cast<OQueryTableView*>(m_pOwner.get())->HideTabWin( m_pTabWin, this ); SetOwnership(true); } diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx index 72b31532213d..6541a4ed5b42 100644 --- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx +++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx @@ -28,7 +28,7 @@ namespace dbaui class OQueryTabConnUndoAction : public OQueryDesignUndoAction { protected: - OQueryTableConnection* m_pConnection; + VclPtr<OQueryTableConnection> m_pConnection; bool m_bOwnerOfConn; // am I the only owner of the connection? (changes with every redo and undo) diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx index f7bee57ce37a..1745890f1145 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx @@ -51,20 +51,18 @@ OQueryTabWinUndoAct::~OQueryTabWinUndoAct() if (m_bOwnerOfObjects) { // I should take care to delete the window if I am the only owner - OSL_ENSURE(m_pTabWin != NULL, "OQueryTabWinUndoAct::~OQueryTabWinUndoAct() : m_pTabWin sollte nicht NULL sein"); + OSL_ENSURE(m_pTabWin != nullptr, "OQueryTabWinUndoAct::~OQueryTabWinUndoAct() : m_pTabWin sollte nicht NULL sein"); OSL_ENSURE(!m_pTabWin->IsVisible(), "OQueryTabWinUndoAct::~OQueryTabWinUndoAct() : *m_pTabWin sollte nicht sichtbar sein"); if ( m_pTabWin ) m_pTabWin->clearListBox(); - delete m_pTabWin; // and of course the corresponding connections - ::std::vector<OTableConnection*>::iterator aIter = m_vTableConnection.begin(); - ::std::vector<OTableConnection*>::iterator aEnd = m_vTableConnection.end(); + auto aIter = m_vTableConnection.begin(); + auto aEnd = m_vTableConnection.end(); for(;aIter != aEnd;++aIter) { m_pOwner->DeselectConn(*aIter); - delete (*aIter); } m_vTableConnection.clear(); } diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx index 22c9921330a6..af22a64063d2 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx @@ -33,8 +33,8 @@ namespace dbaui class OQueryTabWinUndoAct : public OQueryDesignUndoAction { protected: - ::std::vector<OTableConnection*> m_vTableConnection; - OQueryTableWindow* m_pTabWin; + ::std::vector<VclPtr<OTableConnection> > m_vTableConnection; + VclPtr<OQueryTableWindow> m_pTabWin; bool m_bOwnerOfObjects; // am I the only owner of the managed objects? (changes with every redo or undo) @@ -54,7 +54,7 @@ namespace dbaui // access to the managed connections sal_uInt16 ConnCount() { return (sal_uInt16)m_vTableConnection.size(); } - ::std::vector<OTableConnection*>& GetTabConnList() { return m_vTableConnection; } + ::std::vector<VclPtr<OTableConnection> >& GetTabConnList() { return m_vTableConnection; } void InsertConnection( OTableConnection* pConnection ) { m_vTableConnection.push_back(pConnection); } void RemoveConnection( OTableConnection* pConnection ) diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index 573eba4608a4..18d0fd583bb7 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -327,26 +327,26 @@ void OQueryTableView::NotifyTabConnection(const OQueryTableConnection& rNewConn, { // let's first check if I have the connection already OQueryTableConnection* pTabConn = NULL; - const ::std::vector<OTableConnection*>& rConnections = getTableConnections(); - ::std::vector<OTableConnection*>::const_iterator aEnd = rConnections.end(); - ::std::vector<OTableConnection*>::const_iterator aIter = ::std::find( rConnections.begin(), - aEnd, - static_cast<const OTableConnection*>(&rNewConn) - ); + const auto& rConnections = getTableConnections(); + auto aEnd = rConnections.end(); + auto aIter = ::std::find( rConnections.begin(), + aEnd, + VclPtr<OTableConnection>(const_cast<OTableConnection*>(static_cast<const OTableConnection*>(&rNewConn))) + ); if(aIter == aEnd ) { aIter = rConnections.begin(); for(;aIter != aEnd;++aIter) { - if(*static_cast<OQueryTableConnection*>(*aIter) == rNewConn) + if(*static_cast<OQueryTableConnection*>((*aIter).get()) == rNewConn) { - pTabConn = static_cast<OQueryTableConnection*>(*aIter); + pTabConn = static_cast<OQueryTableConnection*>((*aIter).get()); break; } } } else - pTabConn = static_cast<OQueryTableConnection*>(*aIter); + pTabConn = static_cast<OQueryTableConnection*>((*aIter).get()); // no -> insert if (pTabConn == NULL) @@ -525,14 +525,14 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString& { for(aIter = rTabWins.begin();aIter != aEnd;++aIter) { - OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second); + OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second.get()); OSL_ENSURE( pTabWinTmp,"TableWindow is null!" ); if ( pTabWinTmp != pNewTabWin && pTabWinTmp->GetComposedName() == aReferencedTable ) break; } } if ( aIter != aEnd && pNewTabWin != aIter->second ) - addConnections( this, *pNewTabWin, *static_cast<OQueryTableWindow*>(aIter->second), xFKeyColumns ); + addConnections( this, *pNewTabWin, *static_cast<OQueryTableWindow*>(aIter->second.get()), xFKeyColumns ); } break; @@ -543,7 +543,7 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString& OTableWindowMap::const_iterator aEnd = rTabWins.end(); for(;aIter != aEnd;++aIter) { - OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second); + OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second.get()); if ( pTabWinTmp == pNewTabWin ) continue; @@ -656,8 +656,8 @@ void OQueryTableView::createNewConnection() if( openJoinDialog(this,pData,true) ) { OTableWindowMap& rMap = GetTabWinMap(); - OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencingTable()->GetWinName()]); - OQueryTableWindow* pDestWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencedTable()->GetWinName()]); + OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencingTable()->GetWinName()].get()); + OQueryTableWindow* pDestWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencedTable()->GetWinName()].get()); // first we have to look if the this connection already exists OTableConnection* pConn = GetTabConn(pSourceWin,pDestWin,true); bool bNew = true; @@ -704,7 +704,7 @@ OQueryTableWindow* OQueryTableView::FindTable(const OUString& rAliasName) // (it is harmless but does not make sense and indicates that there is probably an error in the caller) OTableWindowMap::const_iterator aIter = GetTabWinMap().find(rAliasName); if(aIter != GetTabWinMap().end()) - return static_cast<OQueryTableWindow*>(aIter->second); + return static_cast<OQueryTableWindow*>(aIter->second.get()); return NULL; } @@ -715,7 +715,7 @@ bool OQueryTableView::FindTableFromField(const OUString& rFieldName, OTableField OTableWindowMap::const_iterator aEnd = GetTabWinMap().end(); for(;aIter != aEnd;++aIter) { - if(static_cast<OQueryTableWindow*>(aIter->second)->ExistsField(rFieldName, rInfo)) + if(static_cast<OQueryTableWindow*>(aIter->second.get())->ExistsField(rFieldName, rInfo)) ++rCnt; } @@ -834,11 +834,11 @@ void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc // collect connections belonging to the window and pass to UndoAction sal_Int16 nCnt = 0; - const ::std::vector<OTableConnection*>& rTabConList = getTableConnections(); - ::std::vector<OTableConnection*>::const_iterator aIter2 = rTabConList.begin(); + const auto& rTabConList = getTableConnections(); + auto aIter2 = rTabConList.begin(); for(;aIter2 != rTabConList.end();)// the end may change { - OQueryTableConnection* pTmpEntry = static_cast<OQueryTableConnection*>(*aIter2); + OQueryTableConnection* pTmpEntry = static_cast<OQueryTableConnection*>((*aIter2).get()); OSL_ENSURE(pTmpEntry,"OQueryTableConnection is null!"); if( pTmpEntry->GetAliasName(JTCS_FROM) == pTabWin->GetAliasName() || pTmpEntry->GetAliasName(JTCS_TO) == pTabWin->GetAliasName() ) @@ -904,12 +904,9 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc // GetEntryPos, and then in turn by the Connection, when its starting point to the window must be determined. // the Connections - ::std::vector<OTableConnection*>& rTableCon = pUndoAction->GetTabConnList(); - ::std::vector<OTableConnection*>::iterator aIter = rTableCon.begin(); - ::std::vector<OTableConnection*>::iterator aEnd = rTableCon.end(); - - for(;aIter != aEnd;++aIter) - addConnection(*aIter); // add all connections from the undo action + auto rTableCon = pUndoAction->GetTabConnList(); + for(auto conn : rTableCon) + addConnection(conn); // add all connections from the undo action rTableCon.clear(); @@ -950,12 +947,9 @@ void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo) bool OQueryTableView::ExistsAVisitedConn(const OQueryTableWindow* pFrom) const { - const ::std::vector<OTableConnection*>& rList = getTableConnections(); - ::std::vector<OTableConnection*>::const_iterator aIter = rList.begin(); - ::std::vector<OTableConnection*>::const_iterator aEnd = rList.end(); - for(;aIter != aEnd;++aIter) + for(auto conn : getTableConnections()) { - OQueryTableConnection* pTemp = static_cast<OQueryTableConnection*>(*aIter); + OQueryTableConnection* pTemp = static_cast<OQueryTableConnection*>(conn.get()); if (pTemp->IsVisited() && (pFrom == static_cast< OQueryTableWindow*>(pTemp->GetSourceWin()) || pFrom == static_cast< OQueryTableWindow*>(pTemp->GetDestWin()))) return true; diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx index 62e282bed659..06f619e34892 100644 --- a/dbaccess/source/ui/querydesign/QueryTextView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx @@ -57,8 +57,7 @@ OQueryTextView::~OQueryTextView() void OQueryTextView::dispose() { - boost::scoped_ptr<vcl::Window> aTemp(m_pEdit); - m_pEdit = NULL; + m_pEdit.clear(); vcl::Window::dispose(); } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 07c0c2d6b43d..87ea89bda2a0 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -158,12 +158,12 @@ OSelectionBrowseBox::~OSelectionBrowseBox() void OSelectionBrowseBox::dispose() { - delete m_pTextCell; - delete m_pVisibleCell; - delete m_pFieldCell; - delete m_pTableCell; - delete m_pOrderCell; - delete m_pFunctionCell; + m_pTextCell.clear(); + m_pVisibleCell.clear(); + m_pFieldCell.clear(); + m_pTableCell.clear(); + m_pOrderCell.clear(); + m_pFunctionCell.clear(); ::svt::EditBrowseBox::dispose(); } @@ -245,11 +245,13 @@ namespace { class OSelectionBrwBoxHeader : public ::svt::EditBrowserHeader { - OSelectionBrowseBox* m_pBrowseBox; + VclPtr<OSelectionBrowseBox> m_pBrowseBox; protected: virtual void Select() SAL_OVERRIDE; public: OSelectionBrwBoxHeader(OSelectionBrowseBox* pParent); + virtual ~OSelectionBrwBoxHeader() { dispose(); } + virtual void dispose() SAL_OVERRIDE { m_pBrowseBox.clear(); ::svt::EditBrowserHeader::dispose(); } }; OSelectionBrwBoxHeader::OSelectionBrwBoxHeader(OSelectionBrowseBox* pParent) : ::svt::EditBrowserHeader(pParent,WB_BUTTONSTYLE|WB_DRAG) @@ -495,7 +497,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon OJoinTableView::OTableWindowMap::iterator aEnd = rTabWinList.end(); for(;aIter != aEnd;++aIter) - m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second)->GetAliasName()); + m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second.get())->GetAliasName()); m_pTableCell->InsertEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)), 0); if (!pEntry->GetAlias().isEmpty()) @@ -990,7 +992,7 @@ bool OSelectionBrowseBox::SaveModified() OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.find(aAliasName); if(aIter != rTabWinList.end()) { - OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second); + OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second.get()); if (pEntryTab) { pEntry->SetTable(pEntryTab->GetTableName()); @@ -2607,7 +2609,7 @@ bool OSelectionBrowseBox::fillEntryTable(OTableFieldDescRef& _pEntry,const OUStr OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.find(_sTableName); if(aIter != rTabWinList.end()) { - OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second); + OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second.get()); if (pEntryTab) { _pEntry->SetTable(pEntryTab->GetTableName()); diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 233ddeb1f2b7..8e9033d6398a 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -56,12 +56,12 @@ namespace dbaui long m_nSeekRow; BrowserMode m_nMode; // remember the BrowseModes - Edit* m_pTextCell; - ::svt::CheckBoxControl* m_pVisibleCell; - ::svt::ComboBoxControl* m_pFieldCell; - ::svt::ListBoxControl* m_pFunctionCell; - ::svt::ListBoxControl* m_pTableCell; - ::svt::ListBoxControl* m_pOrderCell; + VclPtr<Edit> m_pTextCell; + VclPtr<::svt::CheckBoxControl> m_pVisibleCell; + VclPtr<::svt::ComboBoxControl> m_pFieldCell; + VclPtr<::svt::ListBoxControl> m_pFunctionCell; + VclPtr<::svt::ListBoxControl> m_pTableCell; + VclPtr<::svt::ListBoxControl> m_pOrderCell; OTableFieldDescRef m_pEmptyEntry; // default entry in the list may reference more than once diff --git a/dbaccess/source/ui/querydesign/TableConnection.cxx b/dbaccess/source/ui/querydesign/TableConnection.cxx index 6d7864e06db7..457a58481c64 100644 --- a/dbaccess/source/ui/querydesign/TableConnection.cxx +++ b/dbaccess/source/ui/querydesign/TableConnection.cxx @@ -43,7 +43,7 @@ namespace dbaui Show(); } - OTableConnection::OTableConnection( const OTableConnection& _rConn ) : Window(_rConn.m_pParent) + OTableConnection::OTableConnection( const OTableConnection& _rConn ) : Window(_rConn.m_pParent.get()) ,m_pData(_rConn.GetData()->NewInstance()) ,m_pParent(NULL) { diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx index d27e3dadb494..db44c06a982b 100644 --- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx +++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx @@ -23,6 +23,7 @@ #include <tools/debug.hxx> #include <com/sun/star/sdbc/DataType.hpp> #include <comphelper/namedvaluecollection.hxx> +#include <vcl/window.hxx> #include <functional> diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index dbc0264df085..e194989f7096 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -107,9 +107,8 @@ void OTableWindow::dispose() if (m_pListBox) { OSL_ENSURE(m_pListBox->GetEntryCount()==0,"Forgot to call EmptyListbox()!"); - boost::scoped_ptr<vcl::Window> aTemp(m_pListBox); - m_pListBox = NULL; } + m_pListBox.clear(); if ( m_pContainerListener.is() ) m_pContainerListener->dispose(); @@ -280,7 +279,7 @@ bool OTableWindow::Init() if ( !m_pListBox ) { m_pListBox = CreateListBox(); - OSL_ENSURE( m_pListBox != NULL, "OTableWindow::Init() : CreateListBox returned NULL !" ); + OSL_ENSURE( m_pListBox != nullptr, "OTableWindow::Init() : CreateListBox returned NULL !" ); m_pListBox->SetSelectionMode( MULTIPLE_SELECTION ); } diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx index 433e008e6e68..fb91731c5d5a 100644 --- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx @@ -192,7 +192,7 @@ namespace dbaui if( m_pTable ) { OJoinTableView* pView = m_pTable->getTableView(); - ::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable) + nIndex; + auto aIter = pView->getTableConnections(m_pTable) + nIndex; aRet.TargetSet.realloc(1); aRet.TargetSet[0] = getParentChild(aIter - pView->getTableConnections().begin()); aRet.RelationType = AccessibleRelationType::CONTROLLER_FOR; @@ -211,10 +211,10 @@ namespace dbaui if( AccessibleRelationType::CONTROLLER_FOR == aRelationType && m_pTable) { OJoinTableView* pView = m_pTable->getTableView(); - const ::std::vector<OTableConnection*>& rConnectionList = pView->getTableConnections(); + const auto& rConnectionList = pView->getTableConnections(); - ::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable); - ::std::vector<OTableConnection*>::const_iterator aEnd = rConnectionList.end(); + auto aIter = pView->getTableConnections(m_pTable); + auto aEnd = rConnectionList.end(); ::std::vector< Reference<XInterface> > aRelations; aRelations.reserve(5); // just guessing for (; aIter != aEnd ; ++aIter ) diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index 77a354ca58a8..9e71cdc6776b 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -79,7 +79,7 @@ void OTableWindowListBox::dispose() Application::RemoveUserEvent(m_nUiEvent); if( m_aScrollTimer.IsActive() ) m_aScrollTimer.Stop(); - m_pTabWin = NULL; + m_pTabWin.clear(); SvTreeListBox::dispose(); } diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx index 69adb564f4e8..8f7b9b8258a7 100644 --- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx @@ -60,7 +60,7 @@ OTableWindowTitle::~OTableWindowTitle() void OTableWindowTitle::dispose() { - m_pTabWin = NULL; + m_pTabWin.clear(); FixedText::dispose(); } @@ -136,10 +136,8 @@ void OTableWindowTitle::MouseButtonDown( const MouseEvent& rEvt ) OJoinTableView* pView = static_cast<OJoinTableView*>(m_pTabWin->getTableView()); OSL_ENSURE(pView,"No OJoinTableView!"); - const ::std::vector<OTableConnection*>& rConns = pView->getTableConnections(); - ::std::for_each(rConns.begin(), - rConns.end(), - ::std::mem_fun(&OTableConnection::RecalcLines)); + for (auto conn : pView->getTableConnections()) + conn->RecalcLines(); pView->InvalidateConnections(); pView->getDesignView()->getController().setModified(sal_True); diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx index 29bc0e70eebf..71c037c80e80 100644 --- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx +++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx @@ -139,8 +139,7 @@ throw (uno::RuntimeException, std::exception) svt::ToolboxController::dispose(); SolarMutexGuard aSolarMutexGuard; - delete m_pLimitBox; - m_pLimitBox = 0; + m_pLimitBox.clear(); } /// XStatusListener diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx index 1db59a8e6ebf..93401164eca1 100644 --- a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx +++ b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx @@ -13,6 +13,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <svtools/toolboxcontroller.hxx> #include <rtl/ustring.hxx> +#include <vcl/vclptr.hxx> #include "apitools.hxx" @@ -59,7 +60,7 @@ class LimitBoxController: public svt::ToolboxController, using svt::ToolboxController::dispatchCommand; private: - LimitBoxImpl* m_pLimitBox; + VclPtr<LimitBoxImpl> m_pLimitBox; }; } ///dbaui namespace diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 26f91d004fd2..06255d09d584 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -66,7 +66,7 @@ namespace dbaui } if ( m_pBeamer ) ::dbaui::notifySystemWindow(this,m_pBeamer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); - m_pBeamer = NULL; + m_pBeamer.clear(); if ( m_xBeamer.is() ) { Reference< ::com::sun::star::util::XCloseable > xCloseable(m_xBeamer,UNO_QUERY); @@ -75,8 +75,7 @@ namespace dbaui xCloseable->close(sal_False); // false - holds the ownership of this frame } - boost::scoped_ptr<vcl::Window> aTemp(m_pSplitter); - m_pSplitter = NULL; + m_pSplitter.clear(); ODataView::dispose(); } bool OQueryContainerWindow::switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo ) diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index aa1ea5dcc564..b6c6bd651378 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -145,6 +145,11 @@ DlgQryJoin::~DlgQryJoin() void DlgQryJoin::dispose() { delete m_pTableControl; + m_pML_HelpText.clear(); + m_pPB_OK.clear(); + m_pLB_JoinType.clear(); + m_pCBNatural.clear(); + m_pTableView.clear(); ModalDialog::dispose(); } diff --git a/dbaccess/source/ui/querydesign/querydlg.hxx b/dbaccess/source/ui/querydesign/querydlg.hxx index 18c2c1bc6775..ec31515d007e 100644 --- a/dbaccess/source/ui/querydesign/querydlg.hxx +++ b/dbaccess/source/ui/querydesign/querydlg.hxx @@ -39,14 +39,14 @@ namespace dbaui ,public IRelationControlInterface { protected: - FixedText* m_pML_HelpText; - OKButton* m_pPB_OK; - ListBox* m_pLB_JoinType; - CheckBox* m_pCBNatural; + VclPtr<FixedText> m_pML_HelpText; + VclPtr<OKButton> m_pPB_OK; + VclPtr<ListBox> m_pLB_JoinType; + VclPtr<CheckBox> m_pCBNatural; OTableListBoxControl* m_pTableControl; OJoinTableView::OTableWindowMap* m_pTableMap; - OQueryTableView* m_pTableView; + VclPtr<OQueryTableView> m_pTableView; EJoinType eJoinType; TTableConnectionData::value_type m_pConnData; // contains left and right table diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index 8f1ed9ff6dcc..d7820ad68b7a 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -80,6 +80,7 @@ void ORelationTableView::dispose() { if ( m_pContainerListener.is() ) m_pContainerListener->dispose(); + m_pExistingConnection.clear(); OJoinTableView::dispose(); } @@ -170,8 +171,8 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const OTableWindow* pSourceWin = jxdSource.pListBox->GetTabWin(); OTableWindow* pDestWin = jxdDest.pListBox->GetTabWin(); - ::std::vector<OTableConnection*>::const_iterator aIter = getTableConnections().begin(); - ::std::vector<OTableConnection*>::const_iterator aEnd = getTableConnections().end(); + auto aIter = getTableConnections().begin(); + auto aEnd = getTableConnections().end(); for(;aIter != aEnd;++aIter) { OTableConnection* pFirst = *aIter; diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx index 2123aa51f907..b4899e7b25dd 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx @@ -43,8 +43,7 @@ OFieldDescGenWin::~OFieldDescGenWin() void OFieldDescGenWin::dispose() { - boost::scoped_ptr<vcl::Window> aTemp(m_pFieldControl); - m_pFieldControl = NULL; + m_pFieldControl.clear(); TabPage::dispose(); } diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx index ab4e453f7c34..04011c61c340 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx +++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx @@ -32,7 +32,7 @@ namespace dbaui ,public IClipboardTest { - OTableFieldControl *m_pFieldControl; + VclPtr<OTableFieldControl> m_pFieldControl; protected: virtual void Resize() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 1b0f9db0b487..3face44e3790 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -274,10 +274,11 @@ void OTableEditorCtrl::dispose() Application::RemoveUserEvent( nInvalidateTypeEvent ); // Delete the control types - delete pNameCell; - delete pTypeCell; - delete pDescrCell; - delete pHelpTextCell; + pNameCell.clear(); + pTypeCell.clear(); + pDescrCell.clear(); + pHelpTextCell.clear(); + pDescrWin.clear(); OTableRowView::dispose(); } diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx index 07bcfc596a85..03f9b4598c67 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.hxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx @@ -46,11 +46,11 @@ namespace dbaui ::std::vector< ::boost::shared_ptr<OTableRow> > m_aUndoList; ::std::vector< ::boost::shared_ptr<OTableRow> >* m_pRowList; - OSQLNameEdit* pNameCell; - ::svt::ListBoxControl* pTypeCell; - Edit* pHelpTextCell; - Edit* pDescrCell; - OTableFieldDescWin* pDescrWin; // properties of one column + VclPtr<OSQLNameEdit> pNameCell; + VclPtr<::svt::ListBoxControl> pTypeCell; + VclPtr<Edit> pHelpTextCell; + VclPtr<Edit> pDescrCell; + VclPtr<OTableFieldDescWin> pDescrWin; // properties of one column ::boost::shared_ptr<OTableRow> pActRow; @@ -71,7 +71,7 @@ namespace dbaui { private: AutoTimer m_aInvalidateTimer; - OTableEditorCtrl* m_pOwner; + VclPtr<OTableEditorCtrl> m_pOwner; public: ClipboardInvalidator(sal_uLong nTimeout,OTableEditorCtrl*); diff --git a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx index ec756cd53b8a..80594e62fc2a 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx @@ -43,8 +43,7 @@ OTableDesignHelpBar::~OTableDesignHelpBar() void OTableDesignHelpBar::dispose() { - boost::scoped_ptr<vcl::Window> aTemp(m_pTextWin); - m_pTextWin = NULL; + m_pTextWin.clear(); TabPage::dispose(); } diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx index 9cf37d80df9e..065d8dd51b1d 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx @@ -71,15 +71,8 @@ void OTableBorderWindow::dispose() // ::dbaui::notifySystemWindow(this,m_pFieldDescWin,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); m_pEditorCtrl->Hide(); m_pFieldDescWin->Hide(); - - { - boost::scoped_ptr<vcl::Window> aTemp(m_pEditorCtrl); - m_pEditorCtrl = NULL; - } - { - boost::scoped_ptr<vcl::Window> aTemp(m_pFieldDescWin); - m_pFieldDescWin = NULL; - } + m_pEditorCtrl.clear(); + m_pFieldDescWin.clear(); m_aHorzSplitter.disposeAndClear(); vcl::Window::dispose(); } @@ -202,11 +195,7 @@ OTableDesignView::~OTableDesignView() void OTableDesignView::dispose() { m_pWin->Hide(); - - { - boost::scoped_ptr<vcl::Window> aTemp(m_pWin); - m_pWin = NULL; - } + m_pWin.clear(); ODataView::dispose(); } diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx index 3f1ee94f68ce..54ae89660466 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx @@ -76,18 +76,9 @@ void OTableFieldDescWin::dispose() getGenPage()->Hide(); m_pHeader->Hide(); - { - boost::scoped_ptr<vcl::Window> aTemp(m_pGenPage); - m_pGenPage = NULL; - } - { - boost::scoped_ptr<vcl::Window> aTemp(m_pHeader); - m_pHeader = NULL; - } - { - boost::scoped_ptr<vcl::Window> aTemp(m_pHelpBar); - m_pHelpBar = NULL; - } + m_pGenPage.clear(); + m_pHeader.clear(); + m_pHelpBar.clear(); TabPage::dispose(); } diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx index 1b17aa8213d4..a8914fd42cb3 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx @@ -41,9 +41,9 @@ namespace dbaui NONE }; private: - OTableDesignHelpBar* m_pHelpBar; - OFieldDescGenWin* m_pGenPage; - FixedText* m_pHeader; + VclPtr<OTableDesignHelpBar> m_pHelpBar; + VclPtr<OFieldDescGenWin> m_pGenPage; + VclPtr<FixedText> m_pHeader; ChildFocusState m_eChildFocus; IClipboardTest* getActiveChild() const; diff --git a/dbaccess/source/ui/tabledesign/TableUndo.hxx b/dbaccess/source/ui/tabledesign/TableUndo.hxx index d16e55272fbd..7646684e3a09 100644 --- a/dbaccess/source/ui/tabledesign/TableUndo.hxx +++ b/dbaccess/source/ui/tabledesign/TableUndo.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/uno/Any.h> #include "TypeInfo.hxx" +#include <vcl/vclptr.hxx> namespace dbaui { @@ -34,7 +35,7 @@ namespace dbaui class OTableDesignUndoAct : public OCommentUndoAction { protected: - OTableRowView* m_pTabDgnCtrl; + VclPtr<OTableRowView> m_pTabDgnCtrl; virtual void Undo() SAL_OVERRIDE; virtual void Redo() SAL_OVERRIDE; @@ -48,7 +49,7 @@ namespace dbaui class OTableEditorUndoAct : public OTableDesignUndoAct { protected: - OTableEditorCtrl* pTabEdCtrl; + VclPtr<OTableEditorCtrl> pTabEdCtrl; public: TYPEINFO_OVERRIDE(); @@ -136,7 +137,7 @@ namespace dbaui protected: MultiSelection m_aDelKeys, m_aInsKeys; - OTableEditorCtrl* m_pEditorCtrl; + VclPtr<OTableEditorCtrl> m_pEditorCtrl; virtual void Undo() SAL_OVERRIDE; virtual void Redo() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx index 15dcaa292158..6bfbabab11ed 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx @@ -115,7 +115,7 @@ void ODBTypeWizDialogSetup::executedDialog(sal_Int16 _nExecutionResult) { if ( _nExecutionResult == RET_OK ) { - const ODbTypeWizDialogSetup* pDialog = static_cast< ODbTypeWizDialogSetup* >( m_pDialog ); + const ODbTypeWizDialogSetup* pDialog = static_cast< ODbTypeWizDialogSetup* >( m_pDialog.get() ); m_bOpenDatabase = pDialog->IsDatabaseDocumentToBeOpened(); m_bStartTableWizard = pDialog->IsTableWizardToBeStarted(); } diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index 7404f5b4d5d3..373badf7492c 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -169,7 +169,7 @@ namespace dbaui ComposerDialog::executedDialog( _nExecutionResult ); if ( _nExecutionResult && m_pDialog ) - static_cast< DlgFilterCrit* >( m_pDialog )->BuildWherePart(); + static_cast< DlgFilterCrit* >( m_pDialog.get() )->BuildWherePart(); } // RowsetOrderDialog @@ -216,9 +216,9 @@ namespace dbaui return; if ( _nExecutionResult ) - static_cast< DlgOrderCrit* >( m_pDialog )->BuildOrderPart(); + static_cast< DlgOrderCrit* >( m_pDialog.get() )->BuildOrderPart(); else if ( m_xComposer.is() ) - m_xComposer->setOrder( static_cast< DlgOrderCrit* >( m_pDialog )->GetOrignalOrder() ); + m_xComposer->setOrder( static_cast< DlgOrderCrit* >( m_pDialog.get() )->GetOrignalOrder() ); } } // namespace dbaui diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 5a676d190922..b6e307ffaa13 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -548,7 +548,7 @@ void SAL_CALL CopyTableWizard::setTitle( const OUString& _rTitle ) throw (Runtim OCopyTableWizard& CopyTableWizard::impl_getDialog_throw() { - OCopyTableWizard* pWizard = dynamic_cast< OCopyTableWizard* >( m_pDialog ); + OCopyTableWizard* pWizard = dynamic_cast< OCopyTableWizard* >( m_pDialog.get() ); if ( !pWizard ) throw DisposedException( OUString(), *this ); return *pWizard; |