diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-16 15:29:28 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 21:34:32 +0100 |
commit | 97eacd1d5581395de8801e5ba962044132575218 (patch) | |
tree | 05d4996a45cfd479e16f8bfacf33d7b40b5d368b /dbaccess/source | |
parent | 7f7617765cf1f4a16022f47fedb018bf49802a08 (diff) |
vcl: VclPtr conversion in dbaccess
Change-Id: I85fce0403121ffe55204d78445e4809960ec404a
Diffstat (limited to 'dbaccess/source')
165 files changed, 792 insertions, 510 deletions
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx index c4ccd03e6353..41c64799dbe5 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx @@ -95,7 +95,13 @@ namespace dbmm SaveDBDocPage::~SaveDBDocPage() { + dispose(); + } + + void SaveDBDocPage::dispose() + { delete m_pLocationController; + MacroMigrationPage::dispose(); } void SaveDBDocPage::impl_updateLocationDependentItems() diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.hxx b/dbaccess/source/ext/macromigration/macromigrationpages.hxx index fc6ffc934521..a093313e18bb 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.hxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.hxx @@ -73,6 +73,7 @@ namespace dbmm public: SaveDBDocPage(MacroMigrationDialog& _rParentDialog); virtual ~SaveDBDocPage(); + virtual void dispose() SAL_OVERRIDE; static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); public: diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index f01c26bcf9ef..5b8da7e32e74 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -188,34 +188,34 @@ namespace // class OAppDetailPageHelper OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindow& _rBorderWin,PreviewMode _ePreviewMode) : Window(_pParent,WB_DIALOGCONTROL) ,m_rBorderWin(_rBorderWin) - ,m_aFL(this,WB_VERT) - ,m_aTBPreview(this,WB_TABSTOP ) - ,m_aBorder(this,WB_BORDER | WB_READONLY) - ,m_aPreview(&m_aBorder) - ,m_aDocumentInfo(&m_aBorder,WB_LEFT | WB_VSCROLL | WB_READONLY ) + ,m_aFL(new FixedLine(this,WB_VERT)) + ,m_aTBPreview(new ToolBox(this,WB_TABSTOP) ) + ,m_aBorder(new Window(this,WB_BORDER | WB_READONLY)) + ,m_aPreview(new OPreviewWindow(m_aBorder.get())) + ,m_aDocumentInfo(new ::svtools::ODocumentInfoPreview(m_aBorder.get(), WB_LEFT | WB_VSCROLL | WB_READONLY) ) ,m_pTablePreview(NULL) ,m_ePreviewMode(_ePreviewMode) { - m_aBorder.SetBorderStyle(WindowBorderStyle::MONO); + m_aBorder->SetBorderStyle(WindowBorderStyle::MONO); m_aMenu.reset(new PopupMenu( ModuleRes( RID_MENU_APP_PREVIEW ) )); - m_aTBPreview.SetOutStyle(TOOLBOX_STYLE_FLAT); - m_aTBPreview.InsertItem(SID_DB_APP_DISABLE_PREVIEW,m_aMenu->GetItemText(SID_DB_APP_DISABLE_PREVIEW),ToolBoxItemBits::LEFT|ToolBoxItemBits::DROPDOWN|ToolBoxItemBits::AUTOSIZE|ToolBoxItemBits::RADIOCHECK); - m_aTBPreview.SetHelpId(HID_APP_VIEW_PREVIEW_CB); - m_aTBPreview.SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) ); - m_aTBPreview.EnableMenuStrings(); - m_aTBPreview.Enable(true); + m_aTBPreview->SetOutStyle(TOOLBOX_STYLE_FLAT); + m_aTBPreview->InsertItem(SID_DB_APP_DISABLE_PREVIEW,m_aMenu->GetItemText(SID_DB_APP_DISABLE_PREVIEW),ToolBoxItemBits::LEFT|ToolBoxItemBits::DROPDOWN|ToolBoxItemBits::AUTOSIZE|ToolBoxItemBits::RADIOCHECK); + m_aTBPreview->SetHelpId(HID_APP_VIEW_PREVIEW_CB); + m_aTBPreview->SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) ); + m_aTBPreview->EnableMenuStrings(); + m_aTBPreview->Enable(true); - m_aBorder.SetUniqueId(UID_APP_VIEW_PREVIEW_1); + m_aBorder->SetUniqueId(UID_APP_VIEW_PREVIEW_1); - m_aPreview.SetHelpId(HID_APP_VIEW_PREVIEW_1); + m_aPreview->SetHelpId(HID_APP_VIEW_PREVIEW_1); - m_pTablePreview = new OTablePreviewWindow(&m_aBorder,WB_READONLY | WB_DIALOGCONTROL ); + m_pTablePreview = new OTablePreviewWindow(m_aBorder.get(), WB_READONLY | WB_DIALOGCONTROL ); m_pTablePreview->SetHelpId(HID_APP_VIEW_PREVIEW_2); - m_aDocumentInfo.SetHelpId(HID_APP_VIEW_PREVIEW_3); + m_aDocumentInfo->SetHelpId(HID_APP_VIEW_PREVIEW_3); m_xWindow = VCLUnoHelper::GetInterface( m_pTablePreview ); @@ -227,6 +227,11 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo OAppDetailPageHelper::~OAppDetailPageHelper() { + dispose(); +} + +void OAppDetailPageHelper::dispose() +{ try { Reference< ::util::XCloseable> xCloseable(m_xFrame,UNO_QUERY); @@ -250,7 +255,12 @@ OAppDetailPageHelper::~OAppDetailPageHelper() } } - + m_aFL.disposeAndClear(); + m_aTBPreview.disposeAndClear(); + m_aBorder.disposeAndClear(); + m_aPreview.disposeAndClear(); + m_aDocumentInfo.disposeAndClear(); + vcl::Window::dispose(); } int OAppDetailPageHelper::getVisibleControlIndex() const @@ -571,7 +581,7 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon ); pTreeView->notifyHiContrastChanged(); - m_aBorder.SetZOrder(pTreeView, WINDOW_ZORDER_BEHIND); + m_aBorder->SetZOrder(pTreeView, WINDOW_ZORDER_BEHIND); } if ( !m_pLists[E_TABLE]->GetEntryCount() ) { @@ -657,13 +667,13 @@ void OAppDetailPageHelper::setDetailPage(vcl::Window* _pWindow) showPreview(NULL); bool bHasFocus = false; - m_aFL.Show(); + m_aFL->Show(); { bHasFocus = pCurrent != 0 && pCurrent->HasChildPathFocus(); _pWindow->Show(); } - m_aTBPreview.Show(); - m_aBorder.Show(); + m_aTBPreview->Show(); + m_aBorder->Show(); switchPreview(m_ePreviewMode,true); if ( bHasFocus ) @@ -947,17 +957,17 @@ void OAppDetailPageHelper::Resize() pWindow->SetPosSizePixel( Point(0, 0), Size(nHalfOutputWidth - n6PPT, nOutputHeight) ); - m_aFL.SetPosSizePixel( Point(nHalfOutputWidth , 0 ), Size(aFLSize.Width(), nOutputHeight ) ); + m_aFL->SetPosSizePixel( Point(nHalfOutputWidth , 0 ), Size(aFLSize.Width(), nOutputHeight ) ); - Size aTBSize = m_aTBPreview.CalcWindowSizePixel(); - m_aTBPreview.SetPosSizePixel(Point(nOutputWidth - aTBSize.getWidth(), 0 ), + Size aTBSize = m_aTBPreview->CalcWindowSizePixel(); + m_aTBPreview->SetPosSizePixel(Point(nOutputWidth - aTBSize.getWidth(), 0 ), aTBSize ); - m_aBorder.SetPosSizePixel(Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ), + m_aBorder->SetPosSizePixel(Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ), Size(nHalfOutputWidth - aFLSize.Width() - n6PPT, nOutputHeight - 2*n6PPT - aTBSize.getHeight()) ); - m_aPreview.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() ); - m_aDocumentInfo.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() ); - m_pTablePreview->SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() ); + m_aPreview->SetPosSizePixel(Point(0,0),m_aBorder->GetSizePixel() ); + m_aDocumentInfo->SetPosSizePixel(Point(0,0),m_aBorder->GetSizePixel() ); + m_pTablePreview->SetPosSizePixel(Point(0,0),m_aBorder->GetSizePixel() ); } } @@ -993,7 +1003,7 @@ void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,bool _bForce) } m_aMenu->CheckItem(nSelectedAction); - m_aTBPreview.SetItemText(SID_DB_APP_DISABLE_PREVIEW, m_aMenu->GetItemText(nSelectedAction)); + m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, m_aMenu->GetItemText(nSelectedAction)); Resize(); // simulate a selectionChanged event at the controller, to force the preview to be updated @@ -1007,8 +1017,8 @@ void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,bool _bForce) else { m_pTablePreview->Hide(); - m_aPreview.Hide(); - m_aDocumentInfo.Hide(); + m_aPreview->Hide(); + m_aDocumentInfo->Hide(); } } } @@ -1034,8 +1044,8 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent) Any aPreview = xContent->execute(aCommand,xContent->createCommandIdentifier(),Reference< XCommandEnvironment >()); if ( m_ePreviewMode == E_DOCUMENT ) { - m_aDocumentInfo.Hide(); - m_aPreview.Show(); + m_aDocumentInfo->Hide(); + m_aPreview->Show(); Graphic aGraphic; Sequence < sal_Int8 > aBmpSequence; @@ -1047,24 +1057,24 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent) GraphicConverter::Import(aData,aGraphic); } - m_aPreview.setGraphic( aGraphic ); - m_aPreview.Invalidate(); + m_aPreview->setGraphic( aGraphic ); + m_aPreview->Invalidate(); } else { - m_aPreview.Hide(); - m_aDocumentInfo.clear(); - m_aDocumentInfo.Show(); + m_aPreview->Hide(); + m_aDocumentInfo->clear(); + m_aDocumentInfo->Show(); Reference<document::XDocumentProperties> xProp( aPreview, UNO_QUERY); if ( xProp.is() ) - m_aDocumentInfo.fill(xProp,OUString()); + m_aDocumentInfo->fill(xProp,OUString()); } } else { - m_aPreview.Hide(); - m_aDocumentInfo.Hide(); + m_aPreview->Hide(); + m_aDocumentInfo->Hide(); } } catch( const Exception& ) @@ -1081,8 +1091,8 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName, if ( isPreviewEnabled() ) { WaitObject aWaitCursor( this ); - m_aPreview.Hide(); - m_aDocumentInfo.Hide(); + m_aPreview->Hide(); + m_aDocumentInfo->Hide(); m_pTablePreview->Show(); if ( !m_xFrame.is() ) { @@ -1142,17 +1152,17 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName, IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/) { - m_aTBPreview.EndSelection(); + m_aTBPreview->EndSelection(); // tell the toolbox that the item is pressed down - m_aTBPreview.SetItemDown( SID_DB_APP_DISABLE_PREVIEW, true ); + m_aTBPreview->SetItemDown( SID_DB_APP_DISABLE_PREVIEW, true ); // simulate a mouse move (so the "down" state is really painted) - Point aPoint = m_aTBPreview.GetItemRect( SID_DB_APP_DISABLE_PREVIEW ).TopLeft(); + Point aPoint = m_aTBPreview->GetItemRect( SID_DB_APP_DISABLE_PREVIEW ).TopLeft(); MouseEvent aMove( aPoint, 0, MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::SYNTHETIC ); - m_aTBPreview.MouseMove( aMove ); + m_aTBPreview->MouseMove( aMove ); - m_aTBPreview.Update(); + m_aTBPreview->Update(); // execute the menu boost::scoped_ptr<PopupMenu> aMenu(new PopupMenu( ModuleRes( RID_MENU_APP_PREVIEW ) )); @@ -1171,14 +1181,14 @@ IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/) // no disabled entries aMenu->RemoveDisabledEntries(); - sal_uInt16 nSelectedAction = aMenu->Execute(&m_aTBPreview, m_aTBPreview.GetItemRect( SID_DB_APP_DISABLE_PREVIEW )); + sal_uInt16 nSelectedAction = aMenu->Execute(m_aTBPreview.get(), m_aTBPreview->GetItemRect( SID_DB_APP_DISABLE_PREVIEW )); // "cleanup" the toolbox state MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC ); - m_aTBPreview.MouseMove( aLeave ); - m_aTBPreview.SetItemDown( SID_DB_APP_DISABLE_PREVIEW, false); + m_aTBPreview->MouseMove( aLeave ); + m_aTBPreview->SetItemDown( SID_DB_APP_DISABLE_PREVIEW, false); if ( nSelectedAction ) { - m_aTBPreview.SetItemText(SID_DB_APP_DISABLE_PREVIEW, aMenu->GetItemText(nSelectedAction)); + m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, aMenu->GetItemText(nSelectedAction)); Resize(); getBorderWin().getView()->getAppController().executeChecked(nSelectedAction,Sequence<PropertyValue>()); } @@ -1230,19 +1240,19 @@ void OAppDetailPageHelper::ImplInitSettings() aFont = rStyleSettings.GetFieldFont(); aFont.SetColor( rStyleSettings.GetWindowTextColor() ); SetPointFont( aFont ); - m_aTBPreview.SetPointFont( aFont ); + m_aTBPreview->SetPointFont( aFont ); SetTextColor( rStyleSettings.GetFieldTextColor() ); SetTextFillColor(); - m_aBorder.SetTextColor( rStyleSettings.GetFieldTextColor() ); - m_aBorder.SetTextFillColor(); - m_aTBPreview.SetTextColor( rStyleSettings.GetFieldTextColor() ); - m_aTBPreview.SetTextFillColor(); + m_aBorder->SetTextColor( rStyleSettings.GetFieldTextColor() ); + m_aBorder->SetTextFillColor(); + m_aTBPreview->SetTextColor( rStyleSettings.GetFieldTextColor() ); + m_aTBPreview->SetTextFillColor(); SetBackground( rStyleSettings.GetFieldColor() ); - m_aBorder.SetBackground( rStyleSettings.GetFieldColor() ); - m_aFL.SetBackground( rStyleSettings.GetFieldColor() ); - m_aDocumentInfo.SetBackground( rStyleSettings.GetFieldColor() ); - m_aTBPreview.SetBackground( rStyleSettings.GetFieldColor() ); + m_aBorder->SetBackground( rStyleSettings.GetFieldColor() ); + m_aFL->SetBackground( rStyleSettings.GetFieldColor() ); + m_aDocumentInfo->SetBackground( rStyleSettings.GetFieldColor() ); + m_aTBPreview->SetBackground( rStyleSettings.GetFieldColor() ); m_pTablePreview->SetBackground( rStyleSettings.GetFieldColor() ); } diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx index fb86bdd3f050..a9272fa22415 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx @@ -79,12 +79,12 @@ namespace dbaui { DBTreeListBox* m_pLists[ELEMENT_COUNT]; OAppBorderWindow& m_rBorderWin; - FixedLine m_aFL; - ToolBox m_aTBPreview; - Window m_aBorder; - OPreviewWindow m_aPreview; - ::svtools::ODocumentInfoPreview - m_aDocumentInfo; + VclPtr<FixedLine> m_aFL; + VclPtr<ToolBox> m_aTBPreview; + VclPtr<Window> m_aBorder; + VclPtr<OPreviewWindow> m_aPreview; + VclPtr<::svtools::ODocumentInfoPreview> + m_aDocumentInfo; vcl::Window* m_pTablePreview; ::std::unique_ptr<PopupMenu> m_aMenu; PreviewMode m_ePreviewMode; @@ -169,6 +169,7 @@ namespace dbaui public: OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindow& _rBorderWin,PreviewMode _ePreviewMode); virtual ~OAppDetailPageHelper(); + virtual void dispose() SAL_OVERRIDE; // Window overrides virtual void Resize() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 256f0ed61905..a65d6f613849 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -341,30 +341,40 @@ void OCreationList::KeyInput( const KeyEvent& rKEvt ) OTasksWindow::OTasksWindow(vcl::Window* _pParent,OApplicationDetailView* _pDetailView) : Window(_pParent,WB_DIALOGCONTROL ) - ,m_aCreation(*this) - ,m_aDescription(this) - ,m_aHelpText(this,WB_WORDBREAK) - ,m_aFL(this,WB_VERT) + ,m_aCreation(new OCreationList(*this)) + ,m_aDescription(new FixedText(this)) + ,m_aHelpText(new FixedText(this,WB_WORDBREAK)) + ,m_aFL(new FixedLine(this,WB_VERT)) ,m_pDetailView(_pDetailView) { SetUniqueId(UID_APP_TASKS_WINDOW); - m_aCreation.SetHelpId(HID_APP_CREATION_LIST); - m_aCreation.SetSelectHdl(LINK(this, OTasksWindow, OnEntrySelectHdl)); - m_aHelpText.SetHelpId(HID_APP_HELP_TEXT); - m_aDescription.SetHelpId(HID_APP_DESCRIPTION_TEXT); - m_aDescription.SetText(ModuleRes(STR_DESCRIPTION)); + m_aCreation->SetHelpId(HID_APP_CREATION_LIST); + m_aCreation->SetSelectHdl(LINK(this, OTasksWindow, OnEntrySelectHdl)); + m_aHelpText->SetHelpId(HID_APP_HELP_TEXT); + m_aDescription->SetHelpId(HID_APP_DESCRIPTION_TEXT); + m_aDescription->SetText(ModuleRes(STR_DESCRIPTION)); ImageProvider aImageProvider; Image aFolderImage = aImageProvider.getFolderImage( css::sdb::application::DatabaseObject::FORM ); - m_aCreation.SetDefaultCollapsedEntryBmp( aFolderImage ); - m_aCreation.SetDefaultExpandedEntryBmp( aFolderImage ); + m_aCreation->SetDefaultCollapsedEntryBmp( aFolderImage ); + m_aCreation->SetDefaultExpandedEntryBmp( aFolderImage ); ImplInitSettings(true,true,true); } OTasksWindow::~OTasksWindow() { + dispose(); +} + +void OTasksWindow::dispose() +{ Clear(); + m_aCreation.disposeAndClear(); + m_aDescription.disposeAndClear(); + m_aHelpText.disposeAndClear(); + m_aFL.disposeAndClear(); + vcl::Window::dispose(); } void OTasksWindow::DataChanged( const DataChangedEvent& rDCEvt ) @@ -394,23 +404,23 @@ void OTasksWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackgro { SetTextColor( rStyleSettings.GetFieldTextColor() ); SetTextFillColor(); - m_aHelpText.SetTextColor( rStyleSettings.GetFieldTextColor() ); - m_aHelpText.SetTextFillColor(); - m_aDescription.SetTextColor( rStyleSettings.GetFieldTextColor() ); - m_aDescription.SetTextFillColor(); + m_aHelpText->SetTextColor( rStyleSettings.GetFieldTextColor() ); + m_aHelpText->SetTextFillColor(); + m_aDescription->SetTextColor( rStyleSettings.GetFieldTextColor() ); + m_aDescription->SetTextFillColor(); } if( bBackground ) { SetBackground( rStyleSettings.GetFieldColor() ); - m_aHelpText.SetBackground( rStyleSettings.GetFieldColor() ); - m_aDescription.SetBackground( rStyleSettings.GetFieldColor() ); - m_aFL.SetBackground( rStyleSettings.GetFieldColor() ); + m_aHelpText->SetBackground( rStyleSettings.GetFieldColor() ); + m_aDescription->SetBackground( rStyleSettings.GetFieldColor() ); + m_aFL->SetBackground( rStyleSettings.GetFieldColor() ); } - vcl::Font aFont = m_aDescription.GetControlFont(); + vcl::Font aFont = m_aDescription->GetControlFont(); aFont.SetWeight(WEIGHT_BOLD); - m_aDescription.SetControlFont(aFont); + m_aDescription->SetControlFont(aFont); } void OTasksWindow::setHelpText(sal_uInt16 _nId) @@ -418,20 +428,20 @@ void OTasksWindow::setHelpText(sal_uInt16 _nId) if ( _nId ) { OUString sText = ModuleRes(_nId); - m_aHelpText.SetText(sText); + m_aHelpText->SetText(sText); } else { - m_aHelpText.SetText(OUString()); + m_aHelpText->SetText(OUString()); } } IMPL_LINK(OTasksWindow, OnEntrySelectHdl, SvTreeListBox*, /*_pTreeBox*/) { - SvTreeListEntry* pEntry = m_aCreation.GetHdlEntry(); + SvTreeListEntry* pEntry = m_aCreation->GetHdlEntry(); if ( pEntry ) - m_aHelpText.SetText( ModuleRes( static_cast< TaskEntry* >( pEntry->GetUserData() )->nHelpID ) ); + m_aHelpText->SetText( ModuleRes( static_cast< TaskEntry* >( pEntry->GetUserData() )->nHelpID ) ); return 1L; } @@ -446,14 +456,14 @@ void OTasksWindow::Resize() sal_Int32 n6PPT = aFLSize.Height(); long nHalfOutputWidth = static_cast<long>(nOutputWidth * 0.5); - m_aCreation.SetPosSizePixel( Point(0, 0), Size(nHalfOutputWidth - n6PPT, nOutputHeight) ); + m_aCreation->SetPosSizePixel( Point(0, 0), Size(nHalfOutputWidth - n6PPT, nOutputHeight) ); // i77897 make the m_aHelpText a little bit smaller. (-5) sal_Int32 nNewWidth = nOutputWidth - nHalfOutputWidth - aFLSize.Width() - 5; - m_aDescription.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 0), Size(nNewWidth, nOutputHeight) ); - Size aDesc = m_aDescription.CalcMinimumSize(); - m_aHelpText.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, aDesc.Height() ), Size(nNewWidth, nOutputHeight - aDesc.Height() - n6PPT) ); + m_aDescription->SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 0), Size(nNewWidth, nOutputHeight) ); + Size aDesc = m_aDescription->CalcMinimumSize(); + m_aHelpText->SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, aDesc.Height() ), Size(nNewWidth, nOutputHeight - aDesc.Height() - n6PPT) ); - m_aFL.SetPosSizePixel( Point(nHalfOutputWidth , 0), Size(aFLSize.Width(), nOutputHeight ) ); + m_aFL->SetPosSizePixel( Point(nHalfOutputWidth , 0), Size(aFLSize.Width(), nOutputHeight ) ); } void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList ) @@ -485,79 +495,88 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList ) for ( TaskEntryList::const_iterator pTask = _rList.begin(); pTask != aEnd; ++pTask, ++pImages ) { - SvTreeListEntry* pEntry = m_aCreation.InsertEntry( pTask->sTitle ); + SvTreeListEntry* pEntry = m_aCreation->InsertEntry( pTask->sTitle ); pEntry->SetUserData( reinterpret_cast< void* >( new TaskEntry( *pTask ) ) ); Image aImage = Image( *pImages ); - m_aCreation.SetExpandedEntryBmp( pEntry, aImage ); - m_aCreation.SetCollapsedEntryBmp( pEntry, aImage ); + m_aCreation->SetExpandedEntryBmp( pEntry, aImage ); + m_aCreation->SetCollapsedEntryBmp( pEntry, aImage ); } } catch(Exception&) { } - m_aCreation.Show(); - m_aCreation.SelectAll(false); - m_aHelpText.Show(); - m_aDescription.Show(); - m_aFL.Show(); - m_aCreation.updateHelpText(); + m_aCreation->Show(); + m_aCreation->SelectAll(false); + m_aHelpText->Show(); + m_aDescription->Show(); + m_aFL->Show(); + m_aCreation->updateHelpText(); Enable(!_rList.empty()); } void OTasksWindow::Clear() { - m_aCreation.resetLastActive(); - SvTreeListEntry* pEntry = m_aCreation.First(); + m_aCreation->resetLastActive(); + SvTreeListEntry* pEntry = m_aCreation->First(); while ( pEntry ) { delete static_cast< TaskEntry* >( pEntry->GetUserData() ); - pEntry = m_aCreation.Next(pEntry); + pEntry = m_aCreation->Next(pEntry); } - m_aCreation.Clear(); + m_aCreation->Clear(); } // class OApplicationDetailView OApplicationDetailView::OApplicationDetailView(OAppBorderWindow& _rParent,PreviewMode _ePreviewMode) : OSplitterView(&_rParent,false ) - ,m_aHorzSplitter(this) - ,m_aTasks(this,STR_TASKS,WB_BORDER | WB_DIALOGCONTROL ) - ,m_aContainer(this,0,WB_BORDER | WB_DIALOGCONTROL ) + ,m_aHorzSplitter(new Splitter(this)) + ,m_aTasks(new dbaui::OTitleWindow(this,STR_TASKS,WB_BORDER | WB_DIALOGCONTROL) ) + ,m_aContainer(new dbaui::OTitleWindow(this,0,WB_BORDER | WB_DIALOGCONTROL) ) ,m_rBorderWin(_rParent) { SetUniqueId(UID_APP_DETAIL_VIEW); ImplInitSettings( true, true, true ); - m_pControlHelper = new OAppDetailPageHelper(&m_aContainer,m_rBorderWin,_ePreviewMode); + m_pControlHelper = new OAppDetailPageHelper(m_aContainer.get(),m_rBorderWin,_ePreviewMode); m_pControlHelper->Show(); - m_aContainer.setChildWindow(m_pControlHelper); + m_aContainer->setChildWindow(m_pControlHelper); - OTasksWindow* pTasks = new OTasksWindow(&m_aTasks,this); + OTasksWindow* pTasks = new OTasksWindow(m_aTasks.get(),this); pTasks->Show(); pTasks->Disable(m_rBorderWin.getView()->getCommandController().isDataSourceReadOnly()); - m_aTasks.setChildWindow(pTasks); - m_aTasks.SetUniqueId(UID_APP_TASKS_VIEW); - m_aTasks.Show(); + m_aTasks->setChildWindow(pTasks); + m_aTasks->SetUniqueId(UID_APP_TASKS_VIEW); + m_aTasks->Show(); - m_aContainer.SetUniqueId(UID_APP_CONTAINER_VIEW); - m_aContainer.Show(); + m_aContainer->SetUniqueId(UID_APP_CONTAINER_VIEW); + m_aContainer->Show(); const long nFrameWidth = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width(); - m_aHorzSplitter.SetPosSizePixel( Point(0,50), Size(0,nFrameWidth) ); + m_aHorzSplitter->SetPosSizePixel( Point(0,50), Size(0,nFrameWidth) ); // now set the components at the base class - set(&m_aContainer,&m_aTasks); + set(m_aContainer.get(),m_aTasks.get()); - m_aHorzSplitter.Show(); - m_aHorzSplitter.SetUniqueId(UID_APP_VIEW_HORZ_SPLIT); - setSplitter(&m_aHorzSplitter); + m_aHorzSplitter->Show(); + m_aHorzSplitter->SetUniqueId(UID_APP_VIEW_HORZ_SPLIT); + setSplitter(m_aHorzSplitter.get()); } OApplicationDetailView::~OApplicationDetailView() { + dispose(); +} + +void OApplicationDetailView::dispose() +{ set(NULL,NULL); setSplitter(NULL); m_pControlHelper = NULL; + m_aHorzSplitter.disposeAndClear(); + m_aTasks.disposeAndClear(); + m_aContainer.disposeAndClear(); + OSplitterView::dispose(); } void OApplicationDetailView::ImplInitSettings( bool bFont, bool bForeground, bool bBackground ) @@ -580,9 +599,9 @@ void OApplicationDetailView::ImplInitSettings( bool bFont, bool bForeground, boo if( bBackground ) SetBackground( rStyleSettings.GetFieldColor() ); - m_aHorzSplitter.SetBackground( rStyleSettings.GetDialogColor() ); - m_aHorzSplitter.SetFillColor( rStyleSettings.GetDialogColor() ); - m_aHorzSplitter.SetTextFillColor(rStyleSettings.GetDialogColor() ); + m_aHorzSplitter->SetBackground( rStyleSettings.GetDialogColor() ); + m_aHorzSplitter->SetFillColor( rStyleSettings.GetDialogColor() ); + m_aHorzSplitter->SetTextFillColor(rStyleSettings.GetDialogColor() ); } void OApplicationDetailView::DataChanged( const DataChangedEvent& rDCEvt ) @@ -643,7 +662,7 @@ void OApplicationDetailView::impl_createPage( ElementType _eType, const Referenc ? false : getBorderWin().getView()->getCommandController().isCommandEnabled( rData.aTasks[0].sUNOCommand ); getTasksWindow().Enable( bEnabled ); - m_aContainer.setTitle( rData.nTitleId ); + m_aContainer->setTitle( rData.nTitleId ); // let our helper create the object list if ( _eType == E_TABLE ) diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index f90048248ce8..052094d67f0d 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -111,10 +111,10 @@ namespace dbaui class OTasksWindow : public vcl::Window { - OCreationList m_aCreation; - FixedText m_aDescription; - FixedText m_aHelpText; - FixedLine m_aFL; + VclPtr<OCreationList> m_aCreation; + VclPtr<FixedText> m_aDescription; + VclPtr<FixedText> m_aHelpText; + VclPtr<FixedLine> m_aFL; OApplicationDetailView* m_pDetailView; DECL_LINK( OnEntrySelectHdl, SvTreeListBox* ); @@ -124,6 +124,7 @@ namespace dbaui public: OTasksWindow(vcl::Window* _pParent,OApplicationDetailView* _pDetailView); virtual ~OTasksWindow(); + virtual void dispose() SAL_OVERRIDE; // Window overrides virtual void Resize() SAL_OVERRIDE; @@ -135,7 +136,7 @@ namespace dbaui inline bool HandleKeyInput( const KeyEvent& _rKEvt ) { - return m_aCreation.HandleKeyInput( _rKEvt ); + return m_aCreation->HandleKeyInput( _rKEvt ); } void Clear(); @@ -144,9 +145,9 @@ namespace dbaui class OApplicationDetailView : public OSplitterView , public IClipboardTest { - Splitter m_aHorzSplitter; - OTitleWindow m_aTasks; - OTitleWindow m_aContainer; + VclPtr<Splitter> m_aHorzSplitter; + VclPtr<OTitleWindow> m_aTasks; + VclPtr<OTitleWindow> m_aContainer; OAppBorderWindow& m_rBorderWin; // my parent OAppDetailPageHelper* m_pControlHelper; ::std::vector< TaskPaneData > m_aTaskPaneData; @@ -161,6 +162,7 @@ namespace dbaui OApplicationDetailView(OAppBorderWindow& _rParent,PreviewMode _ePreviewMode); virtual ~OApplicationDetailView(); // Window overrides + virtual void dispose() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; /** creates the tables page @@ -188,7 +190,7 @@ namespace dbaui bool interceptKeyInput( const KeyEvent& _rEvent ); inline OAppBorderWindow& getBorderWin() const { return m_rBorderWin; } - inline OTasksWindow& getTasksWindow() const { return *static_cast< OTasksWindow* >( m_aTasks.getChildWindow() ); } + inline OTasksWindow& getTasksWindow() const { return *static_cast< OTasksWindow* >( m_aTasks->getChildWindow() ); } bool isCutAllowed() SAL_OVERRIDE ; bool isCopyAllowed() SAL_OVERRIDE ; diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index ff73ba0fdafc..0345aead2326 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -62,6 +62,11 @@ OApplicationIconControl::OApplicationIconControl(vcl::Window* _pParent) OApplicationIconControl::~OApplicationIconControl() { + dispose(); +} + +void OApplicationIconControl::dispose() +{ sal_uLong nCount = GetEntryCount(); for ( sal_uLong i = 0; i < nCount; ++i ) { @@ -72,7 +77,7 @@ OApplicationIconControl::~OApplicationIconControl() pEntry->SetUserData(NULL); } } - + SvtIconChoiceCtrl::dispose(); } sal_Int8 OApplicationIconControl::AcceptDrop( const AcceptDropEvent& _rEvt ) diff --git a/dbaccess/source/ui/app/AppIconControl.hxx b/dbaccess/source/ui/app/AppIconControl.hxx index 5fcecef90022..10c425b6ea31 100644 --- a/dbaccess/source/ui/app/AppIconControl.hxx +++ b/dbaccess/source/ui/app/AppIconControl.hxx @@ -34,6 +34,7 @@ namespace dbaui public: OApplicationIconControl(vcl::Window* _pParent); virtual ~OApplicationIconControl(); + virtual void dispose() SAL_OVERRIDE; void setControlActionListener( IControlActionListener* _pListener ) { m_pActionListener = _pListener; } IControlActionListener* getControlActionListener( ) const { return m_pActionListener; } diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx index 902c7181d5fe..90b9b4d23017 100644 --- a/dbaccess/source/ui/app/AppSwapWindow.cxx +++ b/dbaccess/source/ui/app/AppSwapWindow.cxx @@ -38,35 +38,41 @@ using namespace ::com::sun::star::container; // class OApplicationSwapWindow OApplicationSwapWindow::OApplicationSwapWindow( vcl::Window* _pParent, OAppBorderWindow& _rBorderWindow ) :Window(_pParent,WB_DIALOGCONTROL ) - ,m_aIconControl(this) + ,m_aIconControl(new OApplicationIconControl(this)) ,m_eLastType(E_NONE) ,m_rBorderWin( _rBorderWindow ) { ImplInitSettings( true, true, true ); - m_aIconControl.SetClickHdl(LINK(this, OApplicationSwapWindow, OnContainerSelectHdl)); - m_aIconControl.setControlActionListener( &m_rBorderWin.getView()->getAppController() ); - m_aIconControl.SetHelpId(HID_APP_SWAP_ICONCONTROL); - m_aIconControl.Show(); + m_aIconControl->SetClickHdl(LINK(this, OApplicationSwapWindow, OnContainerSelectHdl)); + m_aIconControl->setControlActionListener( &m_rBorderWin.getView()->getAppController() ); + m_aIconControl->SetHelpId(HID_APP_SWAP_ICONCONTROL); + m_aIconControl->Show(); } OApplicationSwapWindow::~OApplicationSwapWindow() { + dispose(); +} +void OApplicationSwapWindow::dispose() +{ + m_aIconControl.disposeAndClear(); + vcl::Window::dispose(); } void OApplicationSwapWindow::Resize() { Size aFLSize = LogicToPixel( Size( 8, 0 ), MAP_APPFONT ); long nX = 0; - if ( m_aIconControl.GetEntryCount() != 0 ) - nX = m_aIconControl.GetBoundingBox( m_aIconControl.GetEntry(0) ).GetWidth() + aFLSize.Width(); + if ( m_aIconControl->GetEntryCount() != 0 ) + nX = m_aIconControl->GetBoundingBox( m_aIconControl->GetEntry(0) ).GetWidth() + aFLSize.Width(); Size aOutputSize = GetOutputSize(); - m_aIconControl.SetPosSizePixel( Point(static_cast<long>((aOutputSize.Width() - nX)*0.5), 0) ,Size(nX,aOutputSize.Height())); - m_aIconControl.ArrangeIcons(); + m_aIconControl->SetPosSizePixel( Point(static_cast<long>((aOutputSize.Width() - nX)*0.5), 0) ,Size(nX,aOutputSize.Height())); + m_aIconControl->ArrangeIcons(); } void OApplicationSwapWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackground ) @@ -106,24 +112,24 @@ void OApplicationSwapWindow::DataChanged( const DataChangedEvent& rDCEvt ) void OApplicationSwapWindow::clearSelection() { - m_aIconControl.SetNoSelection(); + m_aIconControl->SetNoSelection(); sal_uLong nPos = 0; - SvxIconChoiceCtrlEntry* pEntry = m_aIconControl.GetSelectedEntry(nPos); + SvxIconChoiceCtrlEntry* pEntry = m_aIconControl->GetSelectedEntry(nPos); if ( pEntry ) - m_aIconControl.InvalidateEntry(pEntry); - m_aIconControl.GetClickHdl().Call(&m_aIconControl); + m_aIconControl->InvalidateEntry(pEntry); + m_aIconControl->GetClickHdl().Call(&m_aIconControl); } void OApplicationSwapWindow::createIconAutoMnemonics( MnemonicGenerator& _rMnemonics ) { - m_aIconControl.CreateAutoMnemonics( _rMnemonics ); + m_aIconControl->CreateAutoMnemonics( _rMnemonics ); } bool OApplicationSwapWindow::interceptKeyInput( const KeyEvent& _rEvent ) { const vcl::KeyCode& rKeyCode = _rEvent.GetKeyCode(); if ( rKeyCode.GetModifier() == KEY_MOD2 ) - return m_aIconControl.DoKeyInput( _rEvent ); + return m_aIconControl->DoKeyInput( _rEvent ); // not handled return false; @@ -132,7 +138,7 @@ bool OApplicationSwapWindow::interceptKeyInput( const KeyEvent& _rEvent ) ElementType OApplicationSwapWindow::getElementType() const { sal_uLong nPos = 0; - SvxIconChoiceCtrlEntry* pEntry = m_aIconControl.GetSelectedEntry(nPos); + SvxIconChoiceCtrlEntry* pEntry = m_aIconControl->GetSelectedEntry(nPos); return ( pEntry ) ? *static_cast<ElementType*>(pEntry->GetUserData()) : E_NONE; } @@ -174,18 +180,18 @@ IMPL_LINK_NOARG(OApplicationSwapWindow, ChangeToLastSelected) void OApplicationSwapWindow::selectContainer(ElementType _eType) { - sal_uLong nCount = m_aIconControl.GetEntryCount(); + sal_uLong nCount = m_aIconControl->GetEntryCount(); SvxIconChoiceCtrlEntry* pEntry = NULL; for (sal_uLong i=0; i < nCount; ++i) { - pEntry = m_aIconControl.GetEntry(i); + pEntry = m_aIconControl->GetEntry(i); if ( pEntry && *static_cast<ElementType*>(pEntry->GetUserData()) == _eType ) break; pEntry = NULL; } if ( pEntry ) - m_aIconControl.SetCursor(pEntry); // this call also initiates a onContainerSelected call + m_aIconControl->SetCursor(pEntry); // this call also initiates a onContainerSelected call else onContainerSelected( _eType ); } diff --git a/dbaccess/source/ui/app/AppSwapWindow.hxx b/dbaccess/source/ui/app/AppSwapWindow.hxx index c7b61c4651c6..b655dd8e4dc1 100644 --- a/dbaccess/source/ui/app/AppSwapWindow.hxx +++ b/dbaccess/source/ui/app/AppSwapWindow.hxx @@ -21,6 +21,7 @@ #include "IClipBoardTest.hxx" #include <vcl/lstbox.hxx> +#include <vcl/vclptr.hxx> #include "AppIconControl.hxx" #include "AppElementType.hxx" @@ -30,7 +31,7 @@ namespace dbaui class OApplicationSwapWindow : public vcl::Window, public IClipboardTest { - OApplicationIconControl m_aIconControl; + VclPtr<OApplicationIconControl> m_aIconControl; ElementType m_eLastType; OAppBorderWindow& m_rBorderWin; @@ -44,6 +45,7 @@ namespace dbaui OApplicationSwapWindow( vcl::Window* _pParent, OAppBorderWindow& _rBorderWindow ); virtual ~OApplicationSwapWindow(); // Window overrides + virtual void dispose() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE; bool isCutAllowed() SAL_OVERRIDE { return false; } @@ -54,9 +56,9 @@ namespace dbaui void cut() SAL_OVERRIDE { } void paste() SAL_OVERRIDE { } - inline sal_uLong GetEntryCount() const { return m_aIconControl.GetEntryCount(); } - inline SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return m_aIconControl.GetEntry(nPos); } - inline Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl.GetBoundingBox(pEntry); } + inline sal_uLong GetEntryCount() const { return m_aIconControl->GetEntryCount(); } + inline SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return m_aIconControl->GetEntry(nPos); } + inline Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl->GetBoundingBox(pEntry); } /** automatically creates mnemonics for the icon/texts in our left hand side panel */ diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx index 2bbd2c66231c..eb8eebc58e02 100644 --- a/dbaccess/source/ui/app/AppTitleWindow.cxx +++ b/dbaccess/source/ui/app/AppTitleWindow.cxx @@ -29,9 +29,9 @@ namespace dbaui OTitleWindow::OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _nBits,bool _bShift) : Window(_pParent,_nBits | WB_DIALOGCONTROL) -, m_aSpace1(this) -, m_aSpace2(this) -, m_aTitle(this) +, m_aSpace1(new FixedText(this)) +, m_aSpace2(new FixedText(this)) +, m_aTitle(new FixedText(this)) , m_pChild(NULL) , m_bShift(_bShift) { @@ -40,20 +40,28 @@ OTitleWindow::OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _n SetBorderStyle(WindowBorderStyle::MONO); ImplInitSettings( true, true, true ); - vcl::Window* pWindows [] = { &m_aSpace1, &m_aSpace2, &m_aTitle }; + vcl::Window* pWindows [] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get() }; for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i) pWindows[i]->Show(); } OTitleWindow::~OTitleWindow() { + dispose(); +} + +void OTitleWindow::dispose() +{ if ( m_pChild ) { m_pChild->Hide(); boost::scoped_ptr<vcl::Window> aTemp(m_pChild); m_pChild = NULL; } - + m_aSpace1.disposeAndClear(); + m_aSpace2.disposeAndClear(); + m_aTitle.disposeAndClear(); + vcl::Window::dispose(); } void OTitleWindow::setChildWindow(vcl::Window* _pChild) @@ -74,11 +82,11 @@ void OTitleWindow::Resize() sal_Int32 nYOffset = aTextSize.Height(); sal_Int32 nHeight = GetTextHeight() + 2*nYOffset; - m_aSpace1.SetPosSizePixel( Point(SPACE_BORDER, SPACE_BORDER ), + m_aSpace1->SetPosSizePixel( Point(SPACE_BORDER, SPACE_BORDER ), Size(nXOffset , nHeight - SPACE_BORDER) ); - m_aSpace2.SetPosSizePixel( Point(nXOffset + SPACE_BORDER, SPACE_BORDER ), + m_aSpace2->SetPosSizePixel( Point(nXOffset + SPACE_BORDER, SPACE_BORDER ), Size(nOutputWidth - nXOffset - 2*SPACE_BORDER, nYOffset) ); - m_aTitle.SetPosSizePixel( Point(nXOffset + SPACE_BORDER, nYOffset + SPACE_BORDER), + m_aTitle->SetPosSizePixel( Point(nXOffset + SPACE_BORDER, nYOffset + SPACE_BORDER), Size(nOutputWidth - nXOffset - 2*SPACE_BORDER, nHeight - nYOffset - SPACE_BORDER) ); if ( m_pChild ) { @@ -91,7 +99,7 @@ void OTitleWindow::setTitle(sal_uInt16 _nTitleId) { if ( _nTitleId != 0 ) { - m_aTitle.SetText(ModuleRes(_nTitleId)); + m_aTitle->SetText(ModuleRes(_nTitleId)); } } @@ -105,7 +113,7 @@ void OTitleWindow::GetFocus() long OTitleWindow::GetWidthPixel() const { Size aTextSize = LogicToPixel( Size( 12, 0 ), MAP_APPFONT ); - sal_Int32 nWidth = GetTextWidth(m_aTitle.GetText()) + 2*aTextSize.Width(); + sal_Int32 nWidth = GetTextWidth(m_aTitle->GetText()) + 2*aTextSize.Width(); return nWidth; } @@ -151,7 +159,7 @@ void OTitleWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackgro if( bBackground ) SetBackground( rStyleSettings.GetFieldColor() ); - vcl::Window* pWindows [] = { &m_aSpace1, &m_aSpace2, &m_aTitle}; + vcl::Window* pWindows [] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get()}; for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i) { vcl::Font aFont = pWindows[i]->GetFont(); diff --git a/dbaccess/source/ui/app/AppTitleWindow.hxx b/dbaccess/source/ui/app/AppTitleWindow.hxx index 76228b54b6cf..d7ffc569f4df 100644 --- a/dbaccess/source/ui/app/AppTitleWindow.hxx +++ b/dbaccess/source/ui/app/AppTitleWindow.hxx @@ -25,9 +25,9 @@ namespace dbaui { class OTitleWindow : public vcl::Window { - FixedText m_aSpace1; - FixedText m_aSpace2; - FixedText m_aTitle; + VclPtr<FixedText> m_aSpace1; + VclPtr<FixedText> m_aSpace2; + VclPtr<FixedText> m_aTitle; vcl::Window* m_pChild; bool m_bShift; void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); @@ -36,6 +36,7 @@ namespace dbaui public: OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _nBits,bool _bShift = true); virtual ~OTitleWindow(); + virtual void dispose() SAL_OVERRIDE; // Window overrides virtual void Resize() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx index fe2d505e9018..237fc3a11976 100644 --- a/dbaccess/source/ui/app/AppView.cxx +++ b/dbaccess/source/ui/app/AppView.cxx @@ -86,6 +86,11 @@ OAppBorderWindow::OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePrev OAppBorderWindow::~OAppBorderWindow() { + dispose(); +} + +void OAppBorderWindow::dispose() +{ // destroy children if ( m_pPanel ) { @@ -99,7 +104,7 @@ OAppBorderWindow::~OAppBorderWindow() boost::scoped_ptr<vcl::Window> aTemp(m_pDetailView); m_pDetailView = NULL; } - + vcl::Window::dispose(); } void OAppBorderWindow::GetFocus() @@ -204,13 +209,16 @@ OApplicationView::OApplicationView( vcl::Window* pParent OApplicationView::~OApplicationView() { + dispose(); +} - { - stopComponentListening(m_xObject); - m_pWin->Hide(); - boost::scoped_ptr<vcl::Window> aTemp(m_pWin); - m_pWin = NULL; - } +void OApplicationView::dispose() +{ + stopComponentListening(m_xObject); + m_pWin->Hide(); + boost::scoped_ptr<vcl::Window> aTemp(m_pWin); + m_pWin = NULL; + ODataView::dispose(); } void OApplicationView::createIconAutoMnemonics( MnemonicGenerator& _rMnemonics ) diff --git a/dbaccess/source/ui/app/AppView.hxx b/dbaccess/source/ui/app/AppView.hxx index 87288117d2cd..c480c4f91520 100644 --- a/dbaccess/source/ui/app/AppView.hxx +++ b/dbaccess/source/ui/app/AppView.hxx @@ -55,6 +55,7 @@ namespace dbaui public: OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePreviewMode); virtual ~OAppBorderWindow(); + virtual void dispose() SAL_OVERRIDE; // Window overrides virtual void GetFocus() SAL_OVERRIDE; @@ -103,6 +104,7 @@ namespace dbaui ,PreviewMode _ePreviewMode ); virtual ~OApplicationView(); + virtual void dispose() SAL_OVERRIDE; /// automatically creates mnemonics for the icon/texts in our left hand side panel void createIconAutoMnemonics( MnemonicGenerator& _rMnemonics ); diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index f41289e3a797..3e66f5cb6db3 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -117,6 +117,11 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont UnoDataBrowserView::~UnoDataBrowserView() { + dispose(); +} + +void UnoDataBrowserView::dispose() +{ { boost::scoped_ptr<Splitter> aTemp(m_pSplitter); m_pSplitter = NULL; @@ -136,7 +141,7 @@ UnoDataBrowserView::~UnoDataBrowserView() } catch(const Exception&) {} - + ODataView::dispose(); } IMPL_LINK( UnoDataBrowserView, SplitHdl, void*, /*NOINTERESTEDIN*/ ) diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx index dc27afe956a3..ba8968f1fcb8 100644 --- a/dbaccess/source/ui/browser/dataview.cxx +++ b/dbaccess/source/ui/browser/dataview.cxx @@ -66,11 +66,11 @@ namespace dbaui :Window(pParent,nStyle) ,m_xContext(_rxContext) ,m_rController( _rController ) - ,m_aSeparator( this ) + ,m_aSeparator( new FixedLine(this) ) { m_rController.acquire(); m_pAccel.reset(::svt::AcceleratorExecute::createAcceleratorHelper()); - m_aSeparator.Show(); + m_aSeparator->Show(); } void ODataView::Construct() @@ -79,8 +79,14 @@ namespace dbaui ODataView::~ODataView() { + dispose(); + } + void ODataView::dispose() + { m_rController.release(); + m_aSeparator.disposeAndClear(); + vcl::Window::dispose(); } void ODataView::resizeDocumentView( Rectangle& /*_rPlayground*/ ) @@ -105,7 +111,7 @@ namespace dbaui // position the separator const Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 ); - m_aSeparator.SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize ); + m_aSeparator->SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize ); aPlayground.Top() += aSeparatorSize.Height() + 1; // position the controls of the document's view diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx index 2d140c3b1326..0956ff13a6e2 100644 --- a/dbaccess/source/ui/browser/dbtreeview.cxx +++ b/dbaccess/source/ui/browser/dbtreeview.cxx @@ -46,6 +46,11 @@ DBTreeView::DBTreeView( vcl::Window* pParent, WinBits nBits) DBTreeView::~DBTreeView() { + dispose(); +} + +void DBTreeView::dispose() +{ if (m_pTreeListBox) { if (m_pTreeListBox->GetModel()) @@ -56,6 +61,7 @@ DBTreeView::~DBTreeView() boost::scoped_ptr<vcl::Window> aTemp(m_pTreeListBox); m_pTreeListBox = NULL; } + vcl::Window::dispose(); } void DBTreeView::SetPreExpandHandler(const Link& _rHdl) diff --git a/dbaccess/source/ui/browser/dbtreeview.hxx b/dbaccess/source/ui/browser/dbtreeview.hxx index 99bf4416ce8c..bc9e11be4cb1 100644 --- a/dbaccess/source/ui/browser/dbtreeview.hxx +++ b/dbaccess/source/ui/browser/dbtreeview.hxx @@ -40,6 +40,7 @@ namespace dbaui DBTreeView( vcl::Window* pParent, WinBits nBits ); virtual ~DBTreeView(); + virtual void dispose() SAL_OVERRIDE; /** sets a handler which is called when an list box entry is to be expanded. <p>When calling the link, the parameter is an SvTreeListEntry marking the entry to be expanded. diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index a35e163c6de9..3eb8ac6819ef 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -717,8 +717,14 @@ SbaGridControl::SbaGridControl(Reference< XComponentContext > _rM, SbaGridControl::~SbaGridControl() { + dispose(); +} + +void SbaGridControl::dispose() +{ if (m_nAsyncDropEvent) Application::RemoveUserEvent(m_nAsyncDropEvent); + FmGridControl::dispose(); } BrowserHeader* SbaGridControl::imp_CreateHeaderBar(BrowseBox* pParent) diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx index a4d44cbc6464..36aff78e2f96 100644 --- a/dbaccess/source/ui/control/ColumnControlWindow.cxx +++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx @@ -47,11 +47,6 @@ OColumnControlWindow::OColumnControlWindow(vcl::Window* pParent m_aLocale = SvtSysLocale().GetLanguageTag().getLocale(); } -OColumnControlWindow::~OColumnControlWindow() -{ - -} - void OColumnControlWindow::ActivateAggregate( EControlType eType ) { switch(eType ) diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 7643cfeb50e0..826384e4eb54 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -161,7 +161,11 @@ void OFieldDescControl::Contruct() OFieldDescControl::~OFieldDescControl() { + dispose(); +} +void OFieldDescControl::dispose() +{ { boost::scoped_ptr<vcl::Window> aTemp(m_pVertScroll); m_pVertScroll = NULL; @@ -187,6 +191,7 @@ OFieldDescControl::~OFieldDescControl() DeactivateAggregate( tpColumnName ); DeactivateAggregate( tpType ); DeactivateAggregate( tpAutoIncrementValue ); + TabPage::dispose(); } OUString OFieldDescControl::BoolStringPersistent(const OUString& rUIString) const diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 9621b71ba04a..293812655582 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -83,7 +83,6 @@ namespace dbaui { m_pBoxControl = pController; } - virtual ~ORelationControl(); /** searches for a connection between these two tables @param _pSource @@ -143,10 +142,6 @@ namespace dbaui return new ORelationControl(pParent); } - ORelationControl::~ORelationControl() - { - } - void ORelationControl::Init(const TTableConnectionData::value_type& _pConnData) { diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index ce73d137ac7a..d48e915e3ca2 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -71,6 +71,11 @@ OTableGrantControl::OTableGrantControl( vcl::Window* pParent, WinBits nBits) OTableGrantControl::~OTableGrantControl() { + dispose(); +} + +void OTableGrantControl::dispose() +{ if (m_nDeactivateEvent) { Application::RemoveUserEvent(m_nDeactivateEvent); @@ -81,6 +86,7 @@ OTableGrantControl::~OTableGrantControl() delete m_pEdit; m_xTables = NULL; + ::svt::EditBrowseBox::dispose(); } void OTableGrantControl::setTablesSupplier(const Reference< XTablesSupplier >& _xTablesSup) diff --git a/dbaccess/source/ui/control/VertSplitView.cxx b/dbaccess/source/ui/control/VertSplitView.cxx index 5313d4213cb6..d0e5bbcf2645 100644 --- a/dbaccess/source/ui/control/VertSplitView.cxx +++ b/dbaccess/source/ui/control/VertSplitView.cxx @@ -39,7 +39,13 @@ OSplitterView::OSplitterView(vcl::Window* _pParent,bool _bVertical) : Window(_pP OSplitterView::~OSplitterView() { + dispose(); +} + +void OSplitterView::dispose() +{ m_pRight = m_pLeft = NULL; + vcl::Window::dispose(); } IMPL_LINK( OSplitterView, SplitHdl, Splitter*, /*pSplit*/ ) diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index 9daa8b9be5de..d7a510b4e255 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -43,10 +43,6 @@ namespace dbaui return new CharSetListBox(pParent); } - CharSetListBox::~CharSetListBox() - { - } - void CharSetListBox::SelectEntryByIanaName( const OUString& _rIanaName ) { OCharsetDisplay::const_iterator aFind = m_aCharSets.findIanaName( _rIanaName ); diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index 95e8234af5dc..bd3414098e9c 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -40,8 +40,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeConnectionURLEdit(vcl: OConnectionURLEdit::~OConnectionURLEdit() { + dispose(); +} + +void OConnectionURLEdit::dispose() +{ SetSubEdit(VclPtr<Edit>()); delete m_pForcedPrefix; + Edit::dispose(); } void OConnectionURLEdit::SetTextNoPrefix(const OUString& _rText) diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 69a70c4c74d3..8aee7006cc66 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -84,7 +84,13 @@ void DBTreeListBox::init() DBTreeListBox::~DBTreeListBox() { + dispose(); +} + +void DBTreeListBox::dispose() +{ implStopSelectionTimer(); + SvTreeListBox::dispose(); } SvTreeListEntry* DBTreeListBox::GetEntryPosByName( const OUString& aName, SvTreeListEntry* pStart, const IEntryFilter* _pFilter ) const diff --git a/dbaccess/source/ui/control/marktree.cxx b/dbaccess/source/ui/control/marktree.cxx index 2fc45e769fa2..fe88aa1880b5 100644 --- a/dbaccess/source/ui/control/marktree.cxx +++ b/dbaccess/source/ui/control/marktree.cxx @@ -37,8 +37,13 @@ OMarkableTreeListBox::OMarkableTreeListBox( vcl::Window* pParent, WinBits nWinSt OMarkableTreeListBox::~OMarkableTreeListBox() { - delete m_pCheckButton; + dispose(); +} +void OMarkableTreeListBox::dispose() +{ + delete m_pCheckButton; + DBTreeListBox::dispose(); } void OMarkableTreeListBox::Paint(const Rectangle& _rRect) diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index ff4007f729f9..bf4aa1f66df8 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -105,6 +105,11 @@ OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) : OSqlEdit::~OSqlEdit() { + dispose(); +} + +void OSqlEdit::dispose() +{ if (m_timerUndoActionCreation.IsActive()) m_timerUndoActionCreation.Stop(); css::uno::Reference< css::beans::XMultiPropertySet > n; @@ -116,6 +121,7 @@ OSqlEdit::~OSqlEdit() n->removePropertiesChangeListener(m_listener.get()); } m_ColorConfig.RemoveListener(this); + MultiLineEditSyntaxHighlight::dispose(); } void OSqlEdit::KeyInput( const KeyEvent& rKEvt ) diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index f437d31d9f58..02410b96681f 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -91,11 +91,6 @@ OCollectionView::OCollectionView( vcl::Window * pParent m_pPB_OK->SetClickHdl( LINK( this, OCollectionView, Save_Click ) ); } -OCollectionView::~OCollectionView( ) -{ -} - - 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 a02b5d68b80b..96e158fde04f 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -110,6 +110,11 @@ namespace dbaui OConnectionHelper::~OConnectionHelper() { + dispose(); + } + + void OConnectionHelper::dispose() + { if(m_bDelete) { delete m_pFT_Connection; @@ -117,6 +122,7 @@ namespace dbaui delete m_pPB_Connection; delete m_pPB_CreateDB; } + OGenericAdministrationPage::dispose(); } void OConnectionHelper::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx index 117295bea89d..5d9ae8beb4e3 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx @@ -42,6 +42,7 @@ namespace dbaui public: 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; diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 4e7b8cc39987..f33b1e44b4fe 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -109,10 +109,6 @@ namespace dbaui m_pTestJavaDriver->SetClickHdl(LINK(this,OConnectionTabPage,OnTestJavaClickHdl)); } - OConnectionTabPage::~OConnectionTabPage() - { - } - 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 5e1c84fb88a1..9713621dfd25 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx @@ -70,7 +70,6 @@ namespace dbaui private: OConnectionTabPage(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); // nControlFlags is a combination of the CBTP_xxx-constants - virtual ~OConnectionTabPage(); private: /** enables the test connection button, if allowed diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index db19ebb9d21b..ce72b8d20405 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -119,10 +119,6 @@ namespace dbaui SetRoadmapStateValue(false); } - OConnectionTabPageSetup::~OConnectionTabPageSetup() - { - } - 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 5705c1530cc2..b417c7882125 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx @@ -71,7 +71,6 @@ namespace dbaui OConnectionTabPageSetup(vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId); virtual bool checkTestConnection() SAL_OVERRIDE; // nControlFlags is a combination of the CBTP_xxx-constants - virtual ~OConnectionTabPageSetup(); }; } // namespace dbaui diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 523b1aa9278d..394073e7472f 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -76,8 +76,13 @@ using namespace ::com::sun::star; OTextConnectionPageSetup::~OTextConnectionPageSetup() { - DELETEZ(m_pTextConnectionHelper); + dispose(); + } + void OTextConnectionPageSetup::dispose() + { + DELETEZ(m_pTextConnectionHelper); + OConnectionTabPageSetup::dispose(); } IMPL_LINK(OTextConnectionPageSetup, ImplGetExtensionHdl, OTextConnectionHelper*, /*_pTextConnectionHelper*/) @@ -241,11 +246,6 @@ using namespace ::com::sun::star; return long(true); } - OMySQLIntroPageSetup::~OMySQLIntroPageSetup() - { - - } - void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, bool /*_bSaveValue*/) { // show the "Connect directly" option only if the driver is installed @@ -292,14 +292,25 @@ using namespace ::com::sun::star; // MySQLNativeSetupPage MySQLNativeSetupPage::MySQLNativeSetupPage( vcl::Window* _pParent, const SfxItemSet& _rCoreAttrs ) :OGenericAdministrationPage( _pParent, "DBWizMysqlNativePage", "dbaccess/ui/dbwizmysqlnativepage.ui", _rCoreAttrs ) - ,m_aMySQLSettings ( *get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink() ) + ,m_aMySQLSettings ( new MySQLNativeSettings(*get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink()) ) { get(m_pHelpText, "helptext"); - m_aMySQLSettings.Show(); + m_aMySQLSettings->Show(); SetRoadmapStateValue(false); } + MySQLNativeSetupPage::~MySQLNativeSetupPage() + { + dispose(); + } + + void MySQLNativeSetupPage::dispose() + { + m_aMySQLSettings.disposeAndClear(); + OGenericAdministrationPage::dispose(); + } + OGenericAdministrationPage* MySQLNativeSetupPage::Create( vcl::Window* pParent, const SfxItemSet& _rAttrSet ) { return new MySQLNativeSetupPage( pParent, _rAttrSet ); @@ -307,23 +318,23 @@ using namespace ::com::sun::star; void MySQLNativeSetupPage::fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ) { - m_aMySQLSettings.fillControls( _rControlList ); + m_aMySQLSettings->fillControls( _rControlList ); } void MySQLNativeSetupPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ) { _rControlList.push_back( new ODisableWrapper< FixedText >( m_pHelpText ) ); - m_aMySQLSettings.fillWindows( _rControlList ); + m_aMySQLSettings->fillWindows( _rControlList ); } bool MySQLNativeSetupPage::FillItemSet( SfxItemSet* _rSet ) { - return m_aMySQLSettings.FillItemSet( _rSet ); + return m_aMySQLSettings->FillItemSet( _rSet ); } void MySQLNativeSetupPage::implInitControls( const SfxItemSet& _rSet, bool _bSaveValue ) { - m_aMySQLSettings.implInitControls( _rSet ); + m_aMySQLSettings->implInitControls( _rSet ); OGenericAdministrationPage::implInitControls( _rSet, _bSaveValue ); @@ -337,7 +348,7 @@ using namespace ::com::sun::star; IMPL_LINK( MySQLNativeSetupPage, OnModified, Edit*, _pEdit ) { - SetRoadmapStateValue( m_aMySQLSettings.canAdvance() ); + SetRoadmapStateValue( m_aMySQLSettings->canAdvance() ); return OGenericAdministrationPage::getControlModifiedLink().Call( _pEdit ); } @@ -634,11 +645,6 @@ using namespace ::com::sun::star; m_pPasswordrequired->SetToggleHdl(getControlModifiedLink()); } - OSpreadSheetConnectionPageSetup::~OSpreadSheetConnectionPageSetup() - { - - } - void OSpreadSheetConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlList*/) { } @@ -683,11 +689,6 @@ using namespace ::com::sun::star; LayoutHelper::fitSizeRightAligned( *m_pPBTestConnection ); } - OAuthentificationPageSetup::~OAuthentificationPageSetup() - { - - } - void OAuthentificationPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) { _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTHelpText)); @@ -753,11 +754,6 @@ using namespace ::com::sun::star; m_pRBRegisterDataSource->SetState(true); } - OFinalDBPageSetup::~OFinalDBPageSetup() - { - - } - 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 4756b6c75b57..3b3ed06b8bd5 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -45,7 +45,6 @@ namespace dbaui protected: CheckBox *m_pPasswordrequired; - virtual ~OSpreadSheetConnectionPageSetup(); protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; @@ -66,6 +65,7 @@ namespace dbaui protected: virtual ~OTextConnectionPageSetup(); + virtual void dispose() SAL_OVERRIDE; virtual bool prepareLeave() SAL_OVERRIDE; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; @@ -108,10 +108,12 @@ namespace dbaui { private: FixedText *m_pHelpText; - MySQLNativeSettings m_aMySQLSettings; + VclPtr<MySQLNativeSettings> m_aMySQLSettings; public: MySQLNativeSetupPage( vcl::Window* _pParent, const SfxItemSet& _rCoreAttrs ); + virtual ~MySQLNativeSetupPage(); + virtual void dispose() SAL_OVERRIDE; static OGenericAdministrationPage* Create( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); @@ -216,7 +218,6 @@ namespace dbaui 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; - virtual ~OMySQLIntroPageSetup(); private: RadioButton *m_pODBCDatabase; @@ -241,7 +242,6 @@ namespace dbaui Edit* m_pETUserName; CheckBox* m_pCBPasswordRequired; PushButton* m_pPBTestConnection; - virtual ~OAuthentificationPageSetup(); protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; @@ -276,9 +276,6 @@ namespace dbaui DECL_LINK(OnOpenSelected, CheckBox*); protected: - virtual ~OFinalDBPageSetup(); - - 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; diff --git a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx index 2c8b9b68ab48..cfdab7758b35 100644 --- a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx +++ b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx @@ -28,10 +28,6 @@ QueryPropertiesDialog::QueryPropertiesDialog( m_pLB_Limit->SetValue( nLimit ); } -QueryPropertiesDialog::~QueryPropertiesDialog() -{ -} - } ///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 28d33723dae6..f0626ae3f698 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.cxx +++ b/dbaccess/source/ui/dlg/RelationDlg.cxx @@ -132,10 +132,6 @@ void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionD } } -ORelationDialog::~ORelationDialog() -{ -} - IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) { // RadioButtons auslesen diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx index a4a51e3d2623..149486427a74 100644 --- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx +++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx @@ -61,7 +61,13 @@ OTableSubscriptionDialog::OTableSubscriptionDialog(vcl::Window* pParent OTableSubscriptionDialog::~OTableSubscriptionDialog() { + dispose(); +} + +void OTableSubscriptionDialog::dispose() +{ delete m_pOutSet; + SfxSingleTabDialog::dispose(); } short OTableSubscriptionDialog::Execute() diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index c99292a925ef..c10751766928 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -151,11 +151,6 @@ namespace dbaui Show(); } - OTextConnectionHelper::~OTextConnectionHelper() - { - - } - IMPL_LINK(OTextConnectionHelper, OnControlModified, Control*, /*EMPTYARG*/) { callModifiedHdl(); diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx index b9317f8b46b6..03dde73cc6dd 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx @@ -48,7 +48,6 @@ namespace dbaui public: OTextConnectionHelper( vcl::Window* pParent, const short _nAvailableSections ); - virtual ~OTextConnectionHelper(); private: FixedText *m_pExtensionHeader; diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index 6afe53364b3b..f776e80e4040 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -114,9 +114,9 @@ OUserAdmin::OUserAdmin(vcl::Window* pParent,const SfxItemSet& _rAttrSet) , m_pNEWUSER(0) , m_pCHANGEPWD(0) , m_pDELETEUSER(0) - ,m_TableCtrl(get<VclAlignment>("table"), WB_TABSTOP) + ,m_TableCtrl(new OTableGrantControl(get<VclAlignment>("table"), WB_TABSTOP)) { - m_TableCtrl.Show(); + m_TableCtrl->Show(); get(m_pUSER, "user"); get(m_pNEWUSER, "add"); get(m_pCHANGEPWD, "changepass"); @@ -131,7 +131,14 @@ OUserAdmin::OUserAdmin(vcl::Window* pParent,const SfxItemSet& _rAttrSet) OUserAdmin::~OUserAdmin() { + dispose(); +} + +void OUserAdmin::dispose() +{ m_xConnection = NULL; + m_TableCtrl.disposeAndClear(); + OGenericAdministrationPage::dispose(); } void OUserAdmin::FillUserNames() @@ -162,11 +169,11 @@ void OUserAdmin::FillUserNames() { Reference<XAuthorizable> xAuth; m_xUsers->getByName(m_UserName) >>= xAuth; - m_TableCtrl.setGrantUser(xAuth); + m_TableCtrl->setGrantUser(xAuth); } - m_TableCtrl.setUserName(GetUser()); - m_TableCtrl.Init(); + m_TableCtrl->setUserName(GetUser()); + m_TableCtrl->Init(); } } } @@ -177,7 +184,7 @@ void OUserAdmin::FillUserNames() m_pDELETEUSER->Enable(xDrop.is()); m_pCHANGEPWD->Enable(m_xUsers.is()); - m_TableCtrl.Enable(m_xUsers.is()); + m_TableCtrl->Enable(m_xUsers.is()); } @@ -261,10 +268,10 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) IMPL_LINK( OUserAdmin, ListDblClickHdl, ListBox *, /*pListBox*/ ) { - m_TableCtrl.setUserName(GetUser()); - m_TableCtrl.UpdateTables(); - m_TableCtrl.DeactivateCell(); - m_TableCtrl.ActivateCell(m_TableCtrl.GetCurRow(),m_TableCtrl.GetCurColumnId()); + m_TableCtrl->setUserName(GetUser()); + m_TableCtrl->UpdateTables(); + m_TableCtrl->DeactivateCell(); + m_TableCtrl->ActivateCell(m_TableCtrl->GetCurRow(),m_TableCtrl->GetCurColumnId()); return 0; } @@ -283,7 +290,7 @@ void OUserAdmin::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlLis void OUserAdmin::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) { - m_TableCtrl.setComponentContext(m_xORB); + m_TableCtrl->setComponentContext(m_xORB); try { if ( !m_xConnection.is() && m_pAdminDialog ) @@ -302,7 +309,7 @@ void OUserAdmin::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) } if ( xUsersSup.is() ) { - m_TableCtrl.setTablesSupplier(xTablesSup); + m_TableCtrl->setTablesSupplier(xTablesSup); m_xUsers = xUsersSup->getUsers(); } } diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx index 6f0720d7a43b..76922bb421c4 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.hxx +++ b/dbaccess/source/ui/dlg/UserAdmin.hxx @@ -45,7 +45,7 @@ protected: PushButton *m_pNEWUSER; PushButton *m_pCHANGEPWD; PushButton *m_pDELETEUSER; - OTableGrantControl m_TableCtrl; // show the grant rights of one user + VclPtr<OTableGrantControl> m_TableCtrl; // show the grant rights of one user ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUsers; @@ -65,6 +65,7 @@ public: static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet ); virtual ~OUserAdmin(); + virtual void dispose() SAL_OVERRIDE; OUString GetUser(); // subclasses must override this, but it isn't pure virtual diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx index 2b17eccec0f9..fbfa3b5cb366 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx +++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx @@ -73,6 +73,11 @@ namespace dbaui OUserAdminDlg::~OUserAdminDlg() { + dispose(); + } + + void OUserAdminDlg::dispose() + { if ( m_bOwnConnection ) { try @@ -86,8 +91,9 @@ namespace dbaui SetInputSet(NULL); DELETEZ(pExampleSet); - + SfxTabDialog::dispose(); } + short OUserAdminDlg::Execute() { try diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index ddff2e67b7cf..9b6f331202ac 100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -168,10 +168,6 @@ namespace dbaui #endif } - MySQLNativeSettings::~MySQLNativeSettings() - { - } - 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 e6e214dca1b9..e1daa864e730 100644 --- a/dbaccess/source/ui/dlg/admincontrols.hxx +++ b/dbaccess/source/ui/dlg/admincontrols.hxx @@ -53,7 +53,6 @@ namespace dbaui public: MySQLNativeSettings( vcl::Window& _rParent, const Link& _rControlModificationLink ); - virtual ~MySQLNativeSettings(); void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ); void fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ); diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 5e4cb63aa6f0..707645b93ac1 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -362,7 +362,13 @@ OAddTableDlg::OAddTableDlg( vcl::Window* pParent, IAddTableDialogContext& _rCont OAddTableDlg::~OAddTableDlg() { + dispose(); +} + +void OAddTableDlg::dispose() +{ m_rContext.onWindowClosing( this ); + ModelessDialog::dispose(); } void OAddTableDlg::impl_switchTo( ObjectList _eList ) diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 65288cd41c81..d9d36cdfc36c 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -134,7 +134,13 @@ namespace dbaui SpecialSettingsPage::~SpecialSettingsPage() { + dispose(); + } + + void SpecialSettingsPage::dispose() + { m_aControlDependencies.clear(); + OGenericAdministrationPage::dispose(); } void SpecialSettingsPage::impl_initBooleanSettings() @@ -317,7 +323,13 @@ namespace dbaui GeneratedValuesPage::~GeneratedValuesPage() { + dispose(); + } + + void GeneratedValuesPage::dispose() + { m_aControlDependencies.clear(); + OGenericAdministrationPage::dispose(); } void GeneratedValuesPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ) @@ -406,8 +418,14 @@ namespace dbaui AdvancedSettingsDialog::~AdvancedSettingsDialog() { + dispose(); + } + + void AdvancedSettingsDialog::dispose() + { SetInputSet(NULL); DELETEZ(pExampleSet); + SfxTabDialog::dispose(); } bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( const OUString& _sURL ) diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index 005f0cb909c5..40f1643cd036 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -78,6 +78,7 @@ namespace dbaui protected: virtual ~SpecialSettingsPage(); + virtual void dispose() SAL_OVERRIDE; // OGenericAdministrationPage overridables virtual void implInitControls (const SfxItemSet& _rSet, bool _bSaveValue ) SAL_OVERRIDE; @@ -115,6 +116,7 @@ namespace dbaui // nControlFlags is a combination of the CBTP_xxx-constants virtual ~GeneratedValuesPage(); + virtual void dispose() SAL_OVERRIDE; // subclasses must override this, but it isn't pure virtual virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 646db7cb7e5b..a49694507280 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -66,9 +66,14 @@ ODbAdminDialog::ODbAdminDialog(vcl::Window* _pParent ODbAdminDialog::~ODbAdminDialog() { + dispose(); +} + +void ODbAdminDialog::dispose() +{ SetInputSet(NULL); DELETEZ(pExampleSet); - + SfxTabDialog::dispose(); } short ODbAdminDialog::Ok() diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 27c57af8fc3b..346128c37469 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -102,7 +102,13 @@ ODbTypeWizDialog::ODbTypeWizDialog(vcl::Window* _pParent ODbTypeWizDialog::~ODbTypeWizDialog() { + dispose(); +} + +void ODbTypeWizDialog::dispose() +{ delete m_pOutSet; + svt::OWizardMachine::dispose(); } IMPL_LINK(ODbTypeWizDialog, OnTypeSelected, OGeneralPage*, _pTabPage) diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 30240f286c08..0852c7550522 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -264,7 +264,13 @@ OUString ODbTypeWizDialogSetup::getStateDisplayName( WizardState _nState ) const ODbTypeWizDialogSetup::~ODbTypeWizDialogSetup() { + dispose(); +} + +void ODbTypeWizDialogSetup::dispose() +{ delete m_pOutSet; + svt::RoadmapWizard::dispose(); } IMPL_LINK(ODbTypeWizDialogSetup, OnTypeSelected, OGeneralPage*, /*_pTabPage*/) diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 5018b582288d..21ecc09d73fe 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -97,6 +97,11 @@ namespace dbaui OCommonBehaviourTabPage::~OCommonBehaviourTabPage() { + dispose(); + } + + void OCommonBehaviourTabPage::dispose() + { if(m_bDelete) { DELETEZ(m_pOptionsLabel); @@ -112,7 +117,7 @@ namespace dbaui DELETEZ(m_pAutoRetrievingLabel); DELETEZ(m_pAutoRetrieving); } - + OGenericAdministrationPage::dispose(); } void OCommonBehaviourTabPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) @@ -194,11 +199,6 @@ namespace dbaui m_pShowDeleted->SetClickHdl(LINK(this, ODbaseDetailsPage, OnButtonClicked)); } - ODbaseDetailsPage::~ODbaseDetailsPage() - { - - } - SfxTabPage* ODriversSettings::CreateDbase( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) { return ( new ODbaseDetailsPage( pParent, *_rAttrSet ) ); @@ -261,10 +261,6 @@ namespace dbaui } - OAdoDetailsPage::~OAdoDetailsPage() - { - - } SfxTabPage* ODriversSettings::CreateAdo( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) { return ( new OAdoDetailsPage( pParent, *_rAttrSet ) ); @@ -511,7 +507,7 @@ namespace dbaui // MySQLNativePage MySQLNativePage::MySQLNativePage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) :OCommonBehaviourTabPage(pParent, "MysqlNativePage", "dbaccess/ui/mysqlnativepage.ui", _rCoreAttrs, CBTP_USE_CHARSET ) - ,m_aMySQLSettings ( *get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink() ) + ,m_aMySQLSettings ( new MySQLNativeSettings(*get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink()) ) { get(m_pSeparator1, "connectionheader"); get(m_pSeparator2, "userheader"); @@ -521,13 +517,24 @@ namespace dbaui m_pUserName->SetModifyHdl(getControlModifiedLink()); - m_aMySQLSettings.Show(); + m_aMySQLSettings->Show(); + } + + MySQLNativePage::~MySQLNativePage() + { + dispose(); + } + + void MySQLNativePage::dispose() + { + m_aMySQLSettings.disposeAndClear(); + OCommonBehaviourTabPage::dispose(); } void MySQLNativePage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) { OCommonBehaviourTabPage::fillControls( _rControlList ); - m_aMySQLSettings.fillControls( _rControlList ); + m_aMySQLSettings->fillControls( _rControlList ); _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pUserName)); _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pPasswordRequired)); @@ -535,7 +542,7 @@ namespace dbaui void MySQLNativePage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) { OCommonBehaviourTabPage::fillWindows( _rControlList ); - m_aMySQLSettings.fillWindows( _rControlList); + m_aMySQLSettings->fillWindows( _rControlList); _rControlList.push_back(new ODisableWrapper<FixedText>(m_pSeparator1)); _rControlList.push_back(new ODisableWrapper<FixedText>(m_pSeparator2)); @@ -546,7 +553,7 @@ namespace dbaui { bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet( _rSet ); - bChangedSomething |= m_aMySQLSettings.FillItemSet( _rSet ); + bChangedSomething |= m_aMySQLSettings->FillItemSet( _rSet ); if ( m_pUserName->IsValueChangedFromSaved() ) { @@ -564,7 +571,7 @@ namespace dbaui bool bValid, bReadonly; getFlags(_rSet, bValid, bReadonly); - m_aMySQLSettings.implInitControls( _rSet ); + m_aMySQLSettings->implInitControls( _rSet ); SFX_ITEMSET_GET(_rSet, pUidItem, SfxStringItem, DSID_USER, true); SFX_ITEMSET_GET(_rSet, pAllowEmptyPwd, SfxBoolItem, DSID_PASSWORDREQUIRED, true); @@ -680,8 +687,13 @@ namespace dbaui OTextDetailsPage::~OTextDetailsPage() { - DELETEZ(m_pTextConnectionHelper); + dispose(); + } + void OTextDetailsPage::dispose() + { + DELETEZ(m_pTextConnectionHelper); + OCommonBehaviourTabPage::dispose(); } SfxTabPage* ODriversSettings::CreateText( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index fd4119bdbbfa..de17ed7f83e8 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -74,6 +74,7 @@ namespace dbaui protected: virtual ~OCommonBehaviourTabPage(); + virtual void dispose() SAL_OVERRIDE; // subclasses must override this, but it isn't pure virtual virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; @@ -100,10 +101,6 @@ namespace dbaui OUString m_sDsn; protected: - - virtual ~ODbaseDetailsPage(); - - protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; private: @@ -113,10 +110,7 @@ namespace dbaui // OAdoDetailsPage class OAdoDetailsPage : public OCommonBehaviourTabPage { - protected: - virtual ~OAdoDetailsPage(); public: - OAdoDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); }; @@ -197,10 +191,12 @@ namespace dbaui public: MySQLNativePage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); + virtual ~MySQLNativePage(); + virtual void dispose() SAL_OVERRIDE; private: FixedText *m_pSeparator1; - MySQLNativeSettings m_aMySQLSettings; + VclPtr<MySQLNativeSettings> m_aMySQLSettings; FixedText *m_pSeparator2; FixedText *m_pUserNameLabel; @@ -237,10 +233,7 @@ namespace dbaui // OMozillaDetailsPage Detail page for Mozilla and Thunderbird addressbook class OMozillaDetailsPage : public OCommonBehaviourTabPage { - protected: - virtual ~OMozillaDetailsPage(); public: - OMozillaDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); }; @@ -255,6 +248,7 @@ namespace dbaui protected: virtual ~OTextDetailsPage(); + virtual void dispose() SAL_OVERRIDE; virtual bool prepareLeave() SAL_OVERRIDE; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index b02b73332e6f..139cd2441fd0 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -76,11 +76,16 @@ namespace dbaui DirectSQLDialog::~DirectSQLDialog() { + dispose(); + } + + void DirectSQLDialog::dispose() + { { ::osl::MutexGuard aGuard(m_aMutex); stopAllComponentListening(); } - + ModalDialog::dispose(); } void DirectSQLDialog::_disposing( const EventObject& _rSource ) diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx index 468233f5c748..6d09dcbb6cd8 100644 --- a/dbaccess/source/ui/dlg/dlgattr.cxx +++ b/dbaccess/source/ui/dlg/dlgattr.cxx @@ -52,8 +52,13 @@ SbaSbAttrDlg::SbaSbAttrDlg(vcl::Window* pParent, const SfxItemSet* pCellAttrs, SbaSbAttrDlg::~SbaSbAttrDlg() { - delete pNumberInfoItem; + dispose(); +} +void SbaSbAttrDlg::dispose() +{ + delete pNumberInfoItem; + SfxTabDialog::dispose(); } void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index e2817a3d9b7a..7ca8febaeec8 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -285,7 +285,13 @@ OSaveAsDlg::OSaveAsDlg( vcl::Window * pParent, OSaveAsDlg::~OSaveAsDlg() { + dispose(); +} + +void OSaveAsDlg::dispose() +{ DELETEZ(m_pImpl); + ModalDialog::dispose(); } IMPL_LINK(OSaveAsDlg, ButtonClickHdl, Button *, pButton) diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index bcd1dc6add60..5151b78d335a 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -70,10 +70,6 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(vcl::Window* _pParent, const St m_pDatasource->SetDoubleClickHdl(LINK(this,ODatasourceSelectDialog,ListDblClickHdl)); } -ODatasourceSelectDialog::~ODatasourceSelectDialog() -{ -} - 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 b124fb0cdaee..16f06de3e40d 100644 --- a/dbaccess/source/ui/dlg/dsselect.hxx +++ b/dbaccess/source/ui/dlg/dsselect.hxx @@ -53,7 +53,6 @@ protected: public: ODatasourceSelectDialog( vcl::Window* _pParent, const StringBag& _rDatasources, SfxItemSet* _pOutputSet = NULL ); - virtual ~ODatasourceSelectDialog(); 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 1a543dce4c73..1e8bd033e50d 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -74,10 +74,6 @@ namespace dbaui m_pDatasourceType->SetSelectHdl(LINK(this, OGeneralPage, OnDatasourceTypeSelected)); } - OGeneralPage::~OGeneralPage() - { - } - namespace { struct DisplayedType diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 0668f679721a..083d3f0cda25 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -34,7 +34,6 @@ namespace dbaui { protected: OGeneralPage( vcl::Window* pParent, const OUString& _rUIXMLDescription, const SfxItemSet& _rItems ); - virtual ~OGeneralPage(); OUString m_eCurrentSelection; /// currently selected type ::dbaccess::DATASOURCE_TYPE diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index d034b68bd597..bdf95194ec94 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -311,9 +311,14 @@ namespace dbaui DbaIndexDialog::~DbaIndexDialog( ) { + dispose(); + } + + void DbaIndexDialog::dispose() + { setToolBox(NULL); delete m_pIndexes; - + ModalDialog::dispose(); } bool DbaIndexDialog::implCommit(SvTreeListEntry* _pEntry) diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index b4c8800fce7b..49a326f7b08d 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -110,9 +110,14 @@ namespace dbaui IndexFieldsControl::~IndexFieldsControl() { + dispose(); + } + + void IndexFieldsControl::dispose() + { delete m_pSortingCell; delete m_pFieldNameCell; - + ::svt::EditBrowseBox::dispose(); } bool IndexFieldsControl::SeekRow(long nRow) diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index d39d86fb623a..809c11f5b536 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -113,9 +113,14 @@ namespace dbaui OParameterDialog::~OParameterDialog() { + dispose(); + } + + void OParameterDialog::dispose() + { if (m_aResetVisitFlag.IsActive()) m_aResetVisitFlag.Stop(); - + ModalDialog::dispose(); } void OParameterDialog::Construct() diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 1274a03bf9b2..5648b84beecb 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -190,10 +190,6 @@ DlgFilterCrit::DlgFilterCrit(vcl::Window * pParent, m_pET_WHEREVALUE1->GrabFocus(); } -DlgFilterCrit::~DlgFilterCrit() -{ -} - #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 f58d3ad7f0c5..9a77bf8be5dc 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -125,10 +125,6 @@ DlgOrderCrit::DlgOrderCrit(vcl::Window * pParent, m_pLB_ORDERFIELD2->SetSelectHdl(LINK(this,DlgOrderCrit,FieldListSelectHdl)); } -DlgOrderCrit::~DlgOrderCrit() -{ -} - 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 9d7cacc9512a..771c20477d42 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -470,24 +470,24 @@ void OSQLMessageBox::impl_positionControls() } // image - lcl_positionInAppFont( *this, m_aInfoImage, OUTER_MARGIN, OUTER_MARGIN, IMAGE_SIZE, IMAGE_SIZE ); - m_aInfoImage.Show(); + lcl_positionInAppFont( *this, *m_aInfoImage.get(), OUTER_MARGIN, OUTER_MARGIN, IMAGE_SIZE, IMAGE_SIZE ); + m_aInfoImage->Show(); // primary text - lcl_positionInAppFont( *this, m_aTitle, TEXT_POS_X, OUTER_MARGIN, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 16 ); + lcl_positionInAppFont( *this, *m_aTitle.get(), TEXT_POS_X, OUTER_MARGIN, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 16 ); sPrimary = lcl_stripOOoBaseVendor( sPrimary ); - m_aTitle.SetText( sPrimary ); - m_aTitle.Show(); + m_aTitle->SetText( sPrimary ); + m_aTitle->Show(); - Rectangle aPrimaryRect( m_aTitle.GetPosPixel(), m_aTitle.GetSizePixel() ); + Rectangle aPrimaryRect( m_aTitle->GetPosPixel(), m_aTitle->GetSizePixel() ); // secondary text (if applicable) - m_aMessage.SetStyle( m_aMessage.GetStyle() | WB_NOLABEL ); + m_aMessage->SetStyle( m_aMessage->GetStyle() | WB_NOLABEL ); sSecondary = lcl_stripOOoBaseVendor( sSecondary ); - m_aMessage.SetText( sSecondary ); + m_aMessage->SetText( sSecondary ); - lcl_positionInAppFont( *this, m_aMessage, TEXT_POS_X, OUTER_MARGIN + 16 + 3, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 8 ); - Rectangle aSecondaryRect( m_aMessage.GetPosPixel(), m_aMessage.GetSizePixel() ); + lcl_positionInAppFont( *this, *m_aMessage.get(), TEXT_POS_X, OUTER_MARGIN + 16 + 3, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 8 ); + Rectangle aSecondaryRect( m_aMessage->GetPosPixel(), m_aMessage->GetSizePixel() ); bool bHaveSecondaryText = !sSecondary.isEmpty(); @@ -498,8 +498,8 @@ void OSQLMessageBox::impl_positionControls() aSecondaryRect.Bottom() = aSecondaryRect.Top() - 1; // adjust secondary control height accordingly - m_aMessage.SetSizePixel( aSecondaryRect.GetSize() ); - m_aMessage.Show( aSecondaryRect.GetHeight() > 0 ); + m_aMessage->SetSizePixel( aSecondaryRect.GetSize() ); + m_aMessage->Show( aSecondaryRect.GetHeight() > 0 ); // if there's no secondary text ... if ( !bHaveSecondaryText ) @@ -508,23 +508,23 @@ void OSQLMessageBox::impl_positionControls() aPrimaryRect.Right() = aPrimaryRect.Left() + aSuggestedRect.GetWidth(); aPrimaryRect.Bottom() = aPrimaryRect.Top() + aSuggestedRect.GetHeight(); // and center it horizontally - m_aTitle.SetStyle( ( m_aTitle.GetStyle() & ~WB_LEFT ) | WB_CENTER ); + m_aTitle->SetStyle( ( m_aTitle->GetStyle() & ~WB_LEFT ) | WB_CENTER ); - Rectangle aInfoRect( m_aInfoImage.GetPosPixel(), m_aInfoImage.GetSizePixel() ); + Rectangle aInfoRect( m_aInfoImage->GetPosPixel(), m_aInfoImage->GetSizePixel() ); // also, if it's not as high as the image ... - if ( aPrimaryRect.GetHeight() < m_aInfoImage.GetSizePixel().Height() ) + if ( aPrimaryRect.GetHeight() < m_aInfoImage->GetSizePixel().Height() ) { // ... make it fit the image height aPrimaryRect.Bottom() += aInfoRect.GetHeight() - aPrimaryRect.GetHeight(); // and center it vertically - m_aTitle.SetStyle( m_aTitle.GetStyle() | WB_VCENTER ); + m_aTitle->SetStyle( m_aTitle->GetStyle() | WB_VCENTER ); } else { // ... otherwise, center the image vertically, relative to the primary text aInfoRect.Move( 0, ( aPrimaryRect.GetHeight() - aInfoRect.GetHeight() ) / 2 ); - m_aInfoImage.SetPosSizePixel( aInfoRect.TopLeft(), aInfoRect.GetSize() ); + m_aInfoImage->SetPosSizePixel( aInfoRect.TopLeft(), aInfoRect.GetSize() ); } - m_aTitle.SetPosSizePixel( aPrimaryRect.TopLeft(), aPrimaryRect.GetSize() ); + m_aTitle->SetPosSizePixel( aPrimaryRect.TopLeft(), aPrimaryRect.GetSize() ); } // adjust dialog size accordingly @@ -546,16 +546,16 @@ void OSQLMessageBox::impl_initImage( MessageType _eImage ) OSL_FAIL( "OSQLMessageBox::impl_initImage: unsupported image type!" ); /* Fall through */ case Info: - m_aInfoImage.SetImage(InfoBox::GetStandardImage()); + m_aInfoImage->SetImage(InfoBox::GetStandardImage()); break; case Warning: - m_aInfoImage.SetImage(WarningBox::GetStandardImage()); + m_aInfoImage->SetImage(WarningBox::GetStandardImage()); break; case Error: - m_aInfoImage.SetImage(ErrorBox::GetStandardImage()); + m_aInfoImage->SetImage(ErrorBox::GetStandardImage()); break; case Query: - m_aInfoImage.SetImage(QueryBox::GetStandardImage()); + m_aInfoImage->SetImage(QueryBox::GetStandardImage()); break; } } @@ -606,7 +606,7 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) void OSQLMessageBox::impl_addDetailsButton() { - size_t nFirstPageVisible = m_aMessage.IsVisible() ? 2 : 1; + size_t nFirstPageVisible = m_aMessage->IsVisible() ? 2 : 1; bool bMoreDetailsAvailable = m_pImpl->aDisplayInfo.size() > nFirstPageVisible; if ( !bMoreDetailsAvailable ) @@ -664,9 +664,9 @@ void OSQLMessageBox::Construct( WinBits _nStyle, MessageType _eImage ) OSQLMessageBox::OSQLMessageBox(vcl::Window* _pParent, const SQLExceptionInfo& _rException, WinBits _nStyle, const OUString& _rHelpURL ) :ButtonDialog( _pParent, WB_HORZ | WB_STDDIALOG ) - ,m_aInfoImage( this ) - ,m_aTitle( this, WB_WORDBREAK | WB_LEFT ) - ,m_aMessage( this, WB_WORDBREAK | WB_LEFT ) + ,m_aInfoImage( new FixedImage(this) ) + ,m_aTitle( new FixedText(this, WB_WORDBREAK | WB_LEFT) ) + ,m_aMessage( new FixedText(this, WB_WORDBREAK | WB_LEFT) ) ,m_sHelpURL( _rHelpURL ) ,m_pImpl( new SQLMessageBox_Impl( _rException ) ) { @@ -675,9 +675,9 @@ OSQLMessageBox::OSQLMessageBox(vcl::Window* _pParent, const SQLExceptionInfo& _r OSQLMessageBox::OSQLMessageBox( vcl::Window* _pParent, const OUString& _rTitle, const OUString& _rMessage, WinBits _nStyle, MessageType _eType, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo ) :ButtonDialog( _pParent, WB_HORZ | WB_STDDIALOG ) - ,m_aInfoImage( this ) - ,m_aTitle( this, WB_WORDBREAK | WB_LEFT ) - ,m_aMessage( this, WB_WORDBREAK | WB_LEFT ) + ,m_aInfoImage( new FixedImage(this) ) + ,m_aTitle( new FixedText(this, WB_WORDBREAK | WB_LEFT) ) + ,m_aMessage( new FixedText(this, WB_WORDBREAK | WB_LEFT) ) { SQLContext aError; aError.Message = _rTitle; @@ -692,6 +692,15 @@ OSQLMessageBox::OSQLMessageBox( vcl::Window* _pParent, const OUString& _rTitle, OSQLMessageBox::~OSQLMessageBox() { + dispose(); +} + +void OSQLMessageBox::dispose() +{ + m_aInfoImage.disposeAndClear(); + m_aTitle.disposeAndClear(); + m_aMessage.disposeAndClear(); + ButtonDialog::dispose(); } IMPL_LINK( OSQLMessageBox, ButtonClickHdl, Button *, /*pButton*/ ) diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index ee89c63ef83a..e6284d230b64 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -99,13 +99,18 @@ namespace dbaui OTableSubscriptionPage::~OTableSubscriptionPage() { + dispose(); + } + + void OTableSubscriptionPage::dispose() + { // just to make sure that our connection will be removed try { ::comphelper::disposeComponent(m_xCurrentConnection); } catch (RuntimeException&) { } - + OGenericAdministrationPage::dispose(); } void OTableSubscriptionPage::StateChanged( StateChangedType nType ) diff --git a/dbaccess/source/ui/dlg/tablespage.hxx b/dbaccess/source/ui/dlg/tablespage.hxx index 37db79c853a9..c8b50ddbda15 100644 --- a/dbaccess/source/ui/dlg/tablespage.hxx +++ b/dbaccess/source/ui/dlg/tablespage.hxx @@ -62,6 +62,7 @@ namespace dbaui OTableSubscriptionPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ,OTableSubscriptionDialog* _pTablesDlg); virtual ~OTableSubscriptionPage(); + virtual void dispose() SAL_OVERRIDE; protected: virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/textconnectionsettings.cxx b/dbaccess/source/ui/dlg/textconnectionsettings.cxx index 11f84162318b..a0eb3330917e 100644 --- a/dbaccess/source/ui/dlg/textconnectionsettings.cxx +++ b/dbaccess/source/ui/dlg/textconnectionsettings.cxx @@ -39,10 +39,6 @@ namespace dbaui m_pOK->SetClickHdl( LINK( this, TextConnectionSettingsDialog, OnOK ) ); } - TextConnectionSettingsDialog::~TextConnectionSettingsDialog() - { - } - 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 704ea76c6068..27abf7422d9f 100644 --- a/dbaccess/source/ui/inc/CollectionView.hxx +++ b/dbaccess/source/ui/inc/CollectionView.hxx @@ -56,7 +56,6 @@ 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(); ::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/ColumnControlWindow.hxx b/dbaccess/source/ui/inc/ColumnControlWindow.hxx index b09d6ff6e030..583481a7d7b2 100644 --- a/dbaccess/source/ui/inc/ColumnControlWindow.hxx +++ b/dbaccess/source/ui/inc/ColumnControlWindow.hxx @@ -55,7 +55,6 @@ namespace dbaui public: OColumnControlWindow(vcl::Window* pParent ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext); - virtual ~OColumnControlWindow(); void setConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xCon); diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index d8913ed932fa..9eb035fc9fda 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -175,6 +175,7 @@ namespace dbaui public: OFieldDescControl( vcl::Window* pParent, OTableDesignHelpBar* pHelpBar); virtual ~OFieldDescControl(); + virtual void dispose() SAL_OVERRIDE; void DisplayData(OFieldDescription* pFieldDescr ); diff --git a/dbaccess/source/ui/inc/JoinDesignView.hxx b/dbaccess/source/ui/inc/JoinDesignView.hxx index 7b29ddde90af..13de042e489a 100644 --- a/dbaccess/source/ui/inc/JoinDesignView.hxx +++ b/dbaccess/source/ui/inc/JoinDesignView.hxx @@ -42,6 +42,7 @@ namespace dbaui OJoinController& _rController, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ); virtual ~OJoinDesignView(); + virtual void dispose() SAL_OVERRIDE; // set the view readonly or not virtual void setReadOnly(bool _bReadOnly); diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index f43cdd254baf..bec75b6103df 100644 --- a/dbaccess/source/ui/inc/JoinTableView.hxx +++ b/dbaccess/source/ui/inc/JoinTableView.hxx @@ -23,6 +23,7 @@ #include <vcl/timer.hxx> #include <vcl/idle.hxx> #include <vcl/scrbar.hxx> +#include <vcl/vclptr.hxx> #include <tools/rtti.hxx> #include <svtools/transfer.hxx> @@ -51,9 +52,9 @@ namespace dbaui class OJoinTableView; class OScrollWindowHelper : public vcl::Window { - ScrollBar m_aHScrollBar; - ScrollBar m_aVScrollBar; - vcl::Window* m_pCornerWindow; + VclPtr<ScrollBar> m_aHScrollBar; + VclPtr<ScrollBar> m_aVScrollBar; + vcl::Window* m_pCornerWindow; OJoinTableView* m_pTableView; protected: @@ -62,14 +63,15 @@ namespace dbaui public: OScrollWindowHelper( vcl::Window* pParent); virtual ~OScrollWindowHelper(); + virtual void dispose() SAL_OVERRIDE; void setTableView(OJoinTableView* _pTableView); void resetRange(const Point& _aSize); // own methods - ScrollBar& GetHScrollBar() { return m_aHScrollBar; } - ScrollBar& GetVScrollBar() { return m_aVScrollBar; } + ScrollBar& GetHScrollBar() { return *m_aHScrollBar.get(); } + ScrollBar& GetVScrollBar() { return *m_aVScrollBar.get(); } }; @@ -112,6 +114,7 @@ namespace dbaui public: OJoinTableView( vcl::Window* pParent, OJoinDesignView* pView ); virtual ~OJoinTableView(); + virtual void dispose() SAL_OVERRIDE; // window override virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/LimitBox.hxx b/dbaccess/source/ui/inc/LimitBox.hxx index 5f9187a38bba..6ff436daa170 100644 --- a/dbaccess/source/ui/inc/LimitBox.hxx +++ b/dbaccess/source/ui/inc/LimitBox.hxx @@ -24,7 +24,6 @@ class LimitBox: public NumericBox { public: LimitBox( vcl::Window* pParent, WinBits nStyle ); - virtual ~LimitBox(); virtual OUString CreateFieldText( sal_Int64 nValue ) const SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx index 2baba04ac840..347989376717 100644 --- a/dbaccess/source/ui/inc/QueryDesignView.hxx +++ b/dbaccess/source/ui/inc/QueryDesignView.hxx @@ -64,18 +64,19 @@ namespace dbaui NONE }; - Splitter m_aSplitter; + VclPtr<Splitter> m_aSplitter; ::com::sun::star::lang::Locale m_aLocale; - OUString m_sDecimalSep; + OUString m_sDecimalSep; OSelectionBrowseBox* m_pSelectionBox; // presents the lower window ChildFocusState m_eChildFocus; - bool m_bInSplitHandler; + bool m_bInSplitHandler; public: OQueryDesignView(OQueryContainerWindow* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ); virtual ~OQueryDesignView(); + virtual void dispose() SAL_OVERRIDE; virtual bool isCutAllowed() SAL_OVERRIDE; virtual bool isPasteAllowed() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx index 6b19daedb287..bb7b9bcac2a7 100644 --- a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx +++ b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx @@ -29,7 +29,6 @@ public: QueryPropertiesDialog( vcl::Window* pParent, const bool bDistinct, const sal_Int64 nLimit ); - virtual ~QueryPropertiesDialog(); bool getDistinct() const; sal_Int64 getLimit() const; diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx index 5bac4fb4d2b0..962c71c39cf9 100644 --- a/dbaccess/source/ui/inc/QueryTableView.hxx +++ b/dbaccess/source/ui/inc/QueryTableView.hxx @@ -58,7 +58,6 @@ namespace dbaui public: OQueryTableView(vcl::Window* pParent,OQueryDesignView* pView); - virtual ~OQueryTableView(); /// base class overwritten: create and delete windows /// (not really delete, as it becomes an UndoAction) diff --git a/dbaccess/source/ui/inc/QueryTextView.hxx b/dbaccess/source/ui/inc/QueryTextView.hxx index a45eefb93a12..78fbc7d6d158 100644 --- a/dbaccess/source/ui/inc/QueryTextView.hxx +++ b/dbaccess/source/ui/inc/QueryTextView.hxx @@ -32,6 +32,7 @@ namespace dbaui public: OQueryTextView( OQueryContainerWindow* pParent ); virtual ~OQueryTextView(); + virtual void dispose() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/RelationDesignView.hxx b/dbaccess/source/ui/inc/RelationDesignView.hxx index f7a97a9687f5..7f1559427eb9 100644 --- a/dbaccess/source/ui/inc/RelationDesignView.hxx +++ b/dbaccess/source/ui/inc/RelationDesignView.hxx @@ -33,7 +33,6 @@ namespace dbaui { public: ORelationDesignView(vcl::Window* pParent, ORelationController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ); - virtual ~ORelationDesignView(); // set the statement for representation /// late construction diff --git a/dbaccess/source/ui/inc/RelationDlg.hxx b/dbaccess/source/ui/inc/RelationDlg.hxx index 5950d64f7502..fc4f17a08467 100644 --- a/dbaccess/source/ui/inc/RelationDlg.hxx +++ b/dbaccess/source/ui/inc/RelationDlg.hxx @@ -27,11 +27,11 @@ #include "JoinTableView.hxx" #include "RelControliFace.hxx" #include "moduledbu.hxx" +#include "RelationControl.hxx" namespace dbaui { class OJoinTableView; - class OTableListBoxControl; class ORelationDialog : public ModalDialog ,public IRelationControlInterface { @@ -60,7 +60,6 @@ namespace dbaui ORelationDialog(OJoinTableView* pParent, const TTableConnectionData::value_type& pConnectionData, bool bAllowTableSelect = false ); - virtual ~ORelationDialog(); 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 9b38d8fb47b6..eb251863ffdd 100644 --- a/dbaccess/source/ui/inc/RelationTableView.hxx +++ b/dbaccess/source/ui/inc/RelationTableView.hxx @@ -54,6 +54,7 @@ namespace dbaui public: ORelationTableView( vcl::Window* pParent, ORelationDesignView* pView ); virtual ~ORelationTableView(); + virtual void dispose() SAL_OVERRIDE; virtual void RemoveTabWin( OTableWindow* pTabWin ) SAL_OVERRIDE; virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx index 76428fb60b24..ae4ff745dedd 100644 --- a/dbaccess/source/ui/inc/TableConnection.hxx +++ b/dbaccess/source/ui/inc/TableConnection.hxx @@ -65,6 +65,7 @@ namespace dbaui eventually. */ virtual ~OTableConnection(); + virtual void dispose() SAL_OVERRIDE; OTableConnection& operator=( const OTableConnection& rConn ); diff --git a/dbaccess/source/ui/inc/TableDesignControl.hxx b/dbaccess/source/ui/inc/TableDesignControl.hxx index 4cabf5d7dd7e..97acc014cf04 100644 --- a/dbaccess/source/ui/inc/TableDesignControl.hxx +++ b/dbaccess/source/ui/inc/TableDesignControl.hxx @@ -47,7 +47,6 @@ namespace dbaui public: OTableRowView(vcl::Window* pParent); - virtual ~OTableRowView(); virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0; diff --git a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx index 900c32374754..f4ef497c6c0d 100644 --- a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx +++ b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx @@ -41,6 +41,7 @@ namespace dbaui public: OTableDesignHelpBar( vcl::Window* pParent ); virtual ~OTableDesignHelpBar(); + virtual void dispose() SAL_OVERRIDE; void SetHelpText( const OUString& rText ); OUString GetHelpText() const { return m_sHelpText; } diff --git a/dbaccess/source/ui/inc/TableDesignView.hxx b/dbaccess/source/ui/inc/TableDesignView.hxx index 72ece65cf6cc..cc3349ada1bf 100644 --- a/dbaccess/source/ui/inc/TableDesignView.hxx +++ b/dbaccess/source/ui/inc/TableDesignView.hxx @@ -32,7 +32,7 @@ namespace dbaui class OTableEditorCtrl; class OTableBorderWindow : public vcl::Window { - Splitter m_aHorzSplitter; + VclPtr<Splitter> m_aHorzSplitter; OTableFieldDescWin* m_pFieldDescWin; OTableEditorCtrl* m_pEditorCtrl; @@ -45,6 +45,7 @@ namespace dbaui OTableBorderWindow(vcl::Window* pParent); virtual ~OTableBorderWindow(); // Window overrides + virtual void dispose() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; @@ -77,6 +78,7 @@ namespace dbaui const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&, OTableController& _rController); virtual ~OTableDesignView(); + virtual void dispose() SAL_OVERRIDE; // Window overrides virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx index c16cba5d5568..a0e2e95631b6 100644 --- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx +++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx @@ -61,6 +61,7 @@ class OTableGrantControl : public ::svt::EditBrowseBox public: OTableGrantControl( vcl::Window* pParent, WinBits nBits); virtual ~OTableGrantControl(); + virtual void dispose() SAL_OVERRIDE; void UpdateTables(); void setUserName(const OUString& _sUserName); void setGrantUser(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XAuthorizable>& _xGrantUser); diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx index 004139a5cb95..67cb66b8f451 100644 --- a/dbaccess/source/ui/inc/TableWindow.hxx +++ b/dbaccess/source/ui/inc/TableWindow.hxx @@ -54,8 +54,8 @@ namespace dbaui friend class OTableWindowListBox; protected: // and the table itself (needed for me as I want to lock it as long as the window is alive) - FixedImage m_aTypeImage; - OTableWindowTitle m_aTitle; + VclPtr<FixedImage> m_aTypeImage; + VclPtr<OTableWindowTitle> m_aTitle; OTableWindowListBox* m_pListBox; OTableWindowAccess* m_pAccessible; @@ -125,6 +125,7 @@ namespace dbaui public: virtual ~OTableWindow(); + virtual void dispose() SAL_OVERRIDE; // late Constructor, see also CreateListbox and FillListbox virtual bool Init(); @@ -148,7 +149,7 @@ namespace dbaui OUString GetComposedName() const { return m_pData->GetComposedName(); } OTableWindowListBox* GetListBox() const { return m_pListBox; } TTableWindowData::value_type GetData() const { return m_pData; } - OTableWindowTitle& GetTitleCtrl() { return m_aTitle; } + OTableWindowTitle& GetTitleCtrl() { return *m_aTitle.get(); } /** returns the name which should be used when displaying join or relations @return diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx index 13f30c6437fb..8e5769883bdf 100644 --- a/dbaccess/source/ui/inc/TableWindowListBox.hxx +++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx @@ -78,6 +78,7 @@ namespace dbaui public: OTableWindowListBox(OTableWindow* pParent); virtual ~OTableWindowListBox(); + virtual void dispose() SAL_OVERRIDE; // DnD stuff virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/TableWindowTitle.hxx b/dbaccess/source/ui/inc/TableWindowTitle.hxx index 77ac0d4ce89f..5a08b3986b6d 100644 --- a/dbaccess/source/ui/inc/TableWindowTitle.hxx +++ b/dbaccess/source/ui/inc/TableWindowTitle.hxx @@ -38,6 +38,7 @@ namespace dbaui public: OTableWindowTitle( OTableWindow* pParent ); virtual ~OTableWindowTitle(); + virtual void dispose() SAL_OVERRIDE; virtual void LoseFocus() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/TablesSingleDlg.hxx b/dbaccess/source/ui/inc/TablesSingleDlg.hxx index 7b0bf1651d2a..51977b928e4c 100644 --- a/dbaccess/source/ui/inc/TablesSingleDlg.hxx +++ b/dbaccess/source/ui/inc/TablesSingleDlg.hxx @@ -55,6 +55,7 @@ class ODbDataSourceAdministrationHelper; ,const ::com::sun::star::uno::Any& _aDataSourceName ); virtual ~OTableSubscriptionDialog(); + virtual void dispose() SAL_OVERRIDE; // forwards from ODbDataSourceAdministrationHelper void successfullyConnected(); diff --git a/dbaccess/source/ui/inc/UserAdminDlg.hxx b/dbaccess/source/ui/inc/UserAdminDlg.hxx index a003fe898e3e..cc2df632a9f5 100644 --- a/dbaccess/source/ui/inc/UserAdminDlg.hxx +++ b/dbaccess/source/ui/inc/UserAdminDlg.hxx @@ -60,6 +60,7 @@ namespace dbaui ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection); virtual ~OUserAdminDlg(); + virtual void dispose() SAL_OVERRIDE; virtual const SfxItemSet* getOutputSet() const SAL_OVERRIDE; virtual SfxItemSet* getWriteOutputSet() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/VertSplitView.hxx b/dbaccess/source/ui/inc/VertSplitView.hxx index 4a91f47e05d5..22393b9c2d84 100644 --- a/dbaccess/source/ui/inc/VertSplitView.hxx +++ b/dbaccess/source/ui/inc/VertSplitView.hxx @@ -40,6 +40,7 @@ namespace dbaui OSplitterView(vcl::Window* _pParent,bool _bVertical = true); virtual ~OSplitterView(); // Window overrides + virtual void dispose() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; void setSplitter(Splitter* _pSplitter); diff --git a/dbaccess/source/ui/inc/WCPage.hxx b/dbaccess/source/ui/inc/WCPage.hxx index e99fcf810529..7fe938c37914 100644 --- a/dbaccess/source/ui/inc/WCPage.hxx +++ b/dbaccess/source/ui/inc/WCPage.hxx @@ -65,7 +65,6 @@ namespace dbaui virtual OUString GetTitle() const SAL_OVERRIDE ; OCopyTable( vcl::Window * pParent ); - virtual ~OCopyTable(); 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 98f029c6c665..a271aaacc152 100644 --- a/dbaccess/source/ui/inc/WColumnSelect.hxx +++ b/dbaccess/source/ui/inc/WColumnSelect.hxx @@ -80,6 +80,7 @@ namespace dbaui OWizColumnSelect(vcl::Window* pParent); virtual ~OWizColumnSelect(); + virtual void dispose() SAL_OVERRIDE; }; } #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WCOLUMNSELECT_HXX diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx index 388ee1c27a1d..f60093dc601f 100644 --- a/dbaccess/source/ui/inc/WCopyTable.hxx +++ b/dbaccess/source/ui/inc/WCopyTable.hxx @@ -323,6 +323,7 @@ namespace dbaui ); virtual ~OCopyTableWizard(); + virtual void dispose() SAL_OVERRIDE; virtual long DeactivatePage() SAL_OVERRIDE; OKButton& GetOKButton() { return static_cast<OKButton&>(*m_pbFinish); } diff --git a/dbaccess/source/ui/inc/WExtendPages.hxx b/dbaccess/source/ui/inc/WExtendPages.hxx index e9d19621457f..612dc4816d42 100644 --- a/dbaccess/source/ui/inc/WExtendPages.hxx +++ b/dbaccess/source/ui/inc/WExtendPages.hxx @@ -36,8 +36,6 @@ namespace dbaui } static OWizTypeSelect* Create( vcl::Window* _pParent, SvStream& _rInput ) { return new OWizHTMLExtend( _pParent, _rInput ); } - - virtual ~OWizHTMLExtend(){} }; // Wizard Page: OWizRTFExtend class OWizRTFExtend : public OWizTypeSelect @@ -51,8 +49,6 @@ namespace dbaui } static OWizTypeSelect* Create( vcl::Window* _pParent, SvStream& _rInput ) { return new OWizRTFExtend( _pParent, _rInput ); } - - virtual ~OWizRTFExtend(){} }; // Wizard Page: OWizNormalExtend diff --git a/dbaccess/source/ui/inc/WNameMatch.hxx b/dbaccess/source/ui/inc/WNameMatch.hxx index 3feb7dc28e01..e4a05eed9223 100644 --- a/dbaccess/source/ui/inc/WNameMatch.hxx +++ b/dbaccess/source/ui/inc/WNameMatch.hxx @@ -78,7 +78,6 @@ namespace dbaui virtual OUString GetTitle() const SAL_OVERRIDE ; OWizNameMatching(vcl::Window* pParent); - virtual ~OWizNameMatching(); }; } diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx index 5f587481e867..046a484034ef 100644 --- a/dbaccess/source/ui/inc/WTypeSelect.hxx +++ b/dbaccess/source/ui/inc/WTypeSelect.hxx @@ -52,7 +52,6 @@ namespace dbaui public: OWizTypeSelectControl(vcl::Window* pParent, vcl::Window* pParentTabPage, OTableDesignHelpBar* pHelpBar=NULL); - virtual ~OWizTypeSelectControl(); 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; @@ -118,6 +117,7 @@ namespace dbaui OWizTypeSelect(vcl::Window* pParent, SvStream* _pStream = NULL ); virtual ~OWizTypeSelect(); + virtual void dispose() SAL_OVERRIDE; inline void setDisplayRow(sal_Int32 _nRow) { m_nDisplayRow = _nRow - 1; } inline void setDuplicateName(bool _bDuplicateName) { m_bDuplicateName = _bDuplicateName; } diff --git a/dbaccess/source/ui/inc/adtabdlg.hxx b/dbaccess/source/ui/inc/adtabdlg.hxx index 360ee70fa9eb..77b2400831cf 100644 --- a/dbaccess/source/ui/inc/adtabdlg.hxx +++ b/dbaccess/source/ui/inc/adtabdlg.hxx @@ -81,6 +81,7 @@ namespace dbaui vcl::Window* _pParent, IAddTableDialogContext& _rContext ); virtual ~OAddTableDlg(); + virtual void dispose() SAL_OVERRIDE; void DetermineAddTable() { m_pAddButton->Enable( impl_isAddAllowed() ); } void Update(); diff --git a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx index 108467ac78f8..2ba76b55466c 100644 --- a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx +++ b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx @@ -51,6 +51,7 @@ namespace dbaui ,const ::com::sun::star::uno::Any& _aDataSourceName); virtual ~AdvancedSettingsDialog(); + virtual void dispose() SAL_OVERRIDE; /// determines whether or not the given data source type has any advanced setting static bool doesHaveAnyAdvancedSettings( const OUString& _sURL ); diff --git a/dbaccess/source/ui/inc/brwview.hxx b/dbaccess/source/ui/inc/brwview.hxx index a214e462e08e..7768ae345bfb 100644 --- a/dbaccess/source/ui/inc/brwview.hxx +++ b/dbaccess/source/ui/inc/brwview.hxx @@ -62,6 +62,7 @@ namespace dbaui IController& _rController, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ); virtual ~UnoDataBrowserView(); + virtual void dispose() SAL_OVERRIDE; /// late construction void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel); diff --git a/dbaccess/source/ui/inc/charsetlistbox.hxx b/dbaccess/source/ui/inc/charsetlistbox.hxx index 78f2da4f4a28..02641062174a 100644 --- a/dbaccess/source/ui/inc/charsetlistbox.hxx +++ b/dbaccess/source/ui/inc/charsetlistbox.hxx @@ -34,7 +34,6 @@ namespace dbaui { public: CharSetListBox( vcl::Window* _pParent, WinBits _nBits ); - virtual ~CharSetListBox(); void SelectEntryByIanaName( const OUString& _rIanaName ); bool StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ); diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx index cb9201328ada..0ec359e13978 100644 --- a/dbaccess/source/ui/inc/curledit.hxx +++ b/dbaccess/source/ui/inc/curledit.hxx @@ -43,6 +43,7 @@ class OConnectionURLEdit : public Edit public: OConnectionURLEdit(vcl::Window* pParent, WinBits _nBits,bool _bShowPrefix = false); virtual ~OConnectionURLEdit(); + virtual void dispose() SAL_OVERRIDE; public: // Edit overridables diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx index 7c437d6f1ab7..0510cd6fa10d 100644 --- a/dbaccess/source/ui/inc/dbadmin.hxx +++ b/dbaccess/source/ui/inc/dbadmin.hxx @@ -66,6 +66,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB ); virtual ~ODbAdminDialog(); + virtual void dispose() SAL_OVERRIDE; /** create and return an item set for use with the dialog. @param _pTypeCollection pointer to an <type>ODatasourceMap</type>. May be NULL, in this case diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index ab15137087bb..8d7147ce2c2d 100644 --- a/dbaccess/source/ui/inc/dbtreelistbox.hxx +++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx @@ -84,6 +84,7 @@ namespace dbaui ,WinBits nWinStyle=0 ,bool _bHandleEnterKey = false); virtual ~DBTreeListBox(); + virtual void dispose() SAL_OVERRIDE; void setControlActionListener( IControlActionListener* _pListener ) { m_pActionListener = _pListener; } void setContextMenuProvider( IContextMenuProvider* _pContextMenuProvider ) { m_pContextMenuProvider = _pContextMenuProvider; } diff --git a/dbaccess/source/ui/inc/dbwiz.hxx b/dbaccess/source/ui/inc/dbwiz.hxx index d86e027a0092..b12d1031edab 100644 --- a/dbaccess/source/ui/inc/dbwiz.hxx +++ b/dbaccess/source/ui/inc/dbwiz.hxx @@ -76,6 +76,7 @@ public: ,const ::com::sun::star::uno::Any& _aDataSourceName ); virtual ~ODbTypeWizDialog(); + virtual void dispose() SAL_OVERRIDE; virtual const SfxItemSet* getOutputSet() const SAL_OVERRIDE; virtual SfxItemSet* getWriteOutputSet() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx index 734f967e7ef8..3529dae34699 100644 --- a/dbaccess/source/ui/inc/dbwizsetup.hxx +++ b/dbaccess/source/ui/inc/dbwizsetup.hxx @@ -102,6 +102,7 @@ public: ,const ::com::sun::star::uno::Any& _aDataSourceName ); virtual ~ODbTypeWizDialogSetup(); + virtual void dispose() SAL_OVERRIDE; virtual const SfxItemSet* getOutputSet() const SAL_OVERRIDE; virtual SfxItemSet* getWriteOutputSet() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index d27de6c58125..c0858a729dea 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -69,6 +69,7 @@ namespace dbaui vcl::Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn); virtual ~DirectSQLDialog(); + virtual void dispose() SAL_OVERRIDE; /// number of history entries sal_Int32 getHistorySize() const; diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx index b6614cf62701..4bf07d1b3406 100644 --- a/dbaccess/source/ui/inc/dlgattr.hxx +++ b/dbaccess/source/ui/inc/dlgattr.hxx @@ -35,6 +35,7 @@ namespace dbaui public: SbaSbAttrDlg(vcl::Window * pParent, const SfxItemSet*, SvNumberFormatter*, bool bHasFormat, bool bRow = false); virtual ~SbaSbAttrDlg(); + virtual void dispose() SAL_OVERRIDE; virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) SAL_OVERRIDE; }; diff --git a/dbaccess/source/ui/inc/dlgsave.hxx b/dbaccess/source/ui/inc/dlgsave.hxx index 5217e1fcb0a0..38c0f5b7c2d8 100644 --- a/dbaccess/source/ui/inc/dlgsave.hxx +++ b/dbaccess/source/ui/inc/dlgsave.hxx @@ -66,6 +66,7 @@ namespace dbaui const IObjectNameCheck& _rObjectNameCheck, sal_Int32 _nFlags = SAD_DEFAULT | SAD_TITLE_STORE_AS); virtual ~OSaveAsDlg(); + virtual void dispose() SAL_OVERRIDE; OUString getName() const; OUString getCatalog() const; diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx index f204c8c3cf89..75f8661dd4a6 100644 --- a/dbaccess/source/ui/inc/indexdialog.hxx +++ b/dbaccess/source/ui/inc/indexdialog.hxx @@ -111,6 +111,7 @@ namespace dbaui sal_Int32 _nMaxColumnsInIndex ); virtual ~DbaIndexDialog(); + virtual void dispose() SAL_OVERRIDE; virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE; virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx index fb1347d2b3eb..df9a8f5715f0 100644 --- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx +++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx @@ -52,6 +52,7 @@ namespace dbaui public: IndexFieldsControl( vcl::Window* _pParent, WinBits nWinStyle); virtual ~IndexFieldsControl(); + virtual void dispose() SAL_OVERRIDE; void Init(const ::com::sun::star::uno::Sequence< OUString >& _rAvailableFields, sal_Int32 _nMaxColumnsInIndex,bool _bAddIndexAppendix); diff --git a/dbaccess/source/ui/inc/marktree.hxx b/dbaccess/source/ui/inc/marktree.hxx index 2e10a99b82c6..f39d5281ffde 100644 --- a/dbaccess/source/ui/inc/marktree.hxx +++ b/dbaccess/source/ui/inc/marktree.hxx @@ -40,6 +40,7 @@ class OMarkableTreeListBox : public DBTreeListBox public: OMarkableTreeListBox( vcl::Window* pParent, WinBits nWinStyle=0 ); virtual ~OMarkableTreeListBox(); + virtual void dispose() SAL_OVERRIDE; virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; virtual void CheckButtonHdl() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx index edc37862a366..7e27a3df57cd 100644 --- a/dbaccess/source/ui/inc/paramdialog.hxx +++ b/dbaccess/source/ui/inc/paramdialog.hxx @@ -84,6 +84,7 @@ namespace dbaui const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > & _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext); virtual ~OParameterDialog(); + virtual void dispose() SAL_OVERRIDE; ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getValues() const { return m_aFinalValues; } diff --git a/dbaccess/source/ui/inc/querycontainerwindow.hxx b/dbaccess/source/ui/inc/querycontainerwindow.hxx index 646c5e1488a9..ba2447c854d6 100644 --- a/dbaccess/source/ui/inc/querycontainerwindow.hxx +++ b/dbaccess/source/ui/inc/querycontainerwindow.hxx @@ -50,6 +50,7 @@ namespace dbaui public: OQueryContainerWindow(vcl::Window* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); virtual ~OQueryContainerWindow(); + virtual void dispose() SAL_OVERRIDE; virtual void Construct() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx index b9d76cccca97..e5286f42045d 100644 --- a/dbaccess/source/ui/inc/queryfilter.hxx +++ b/dbaccess/source/ui/inc/queryfilter.hxx @@ -112,7 +112,6 @@ 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(); void BuildWherePart(); diff --git a/dbaccess/source/ui/inc/queryorder.hxx b/dbaccess/source/ui/inc/queryorder.hxx index 007c42966a6a..706e70176fb9 100644 --- a/dbaccess/source/ui/inc/queryorder.hxx +++ b/dbaccess/source/ui/inc/queryorder.hxx @@ -84,7 +84,6 @@ 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 ~DlgOrderCrit(); void BuildOrderPart(); OUString GetOrderList( ) const; diff --git a/dbaccess/source/ui/inc/queryview.hxx b/dbaccess/source/ui/inc/queryview.hxx index 0a05a3153b40..645525ca8874 100644 --- a/dbaccess/source/ui/inc/queryview.hxx +++ b/dbaccess/source/ui/inc/queryview.hxx @@ -28,7 +28,6 @@ namespace dbaui { public: OQueryView(vcl::Window* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ); - virtual ~OQueryView(); virtual bool isCutAllowed() = 0; virtual bool isPasteAllowed() = 0; diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx index f016da2720bc..7691291daec6 100644 --- a/dbaccess/source/ui/inc/sbagrid.hxx +++ b/dbaccess/source/ui/inc/sbagrid.hxx @@ -231,6 +231,7 @@ namespace dbaui public: SbaGridControl(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >,Window* pParent, FmXGridPeer* _pPeer, WinBits nBits = WB_TABSTOP); virtual ~SbaGridControl(); + virtual void dispose() SAL_OVERRIDE; virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; virtual void Select() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index c941bdfa4c6e..87b936b9b786 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -68,6 +68,7 @@ namespace dbaui public: OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle = WB_LEFT | WB_VSCROLL |WB_BORDER); virtual ~OSqlEdit(); + virtual void dispose() SAL_OVERRIDE; // Edit overridables virtual void SetText(const OUString& rNewText) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/sqlmessage.hxx b/dbaccess/source/ui/inc/sqlmessage.hxx index 1f4200c827ad..51cc296b5624 100644 --- a/dbaccess/source/ui/inc/sqlmessage.hxx +++ b/dbaccess/source/ui/inc/sqlmessage.hxx @@ -45,9 +45,9 @@ namespace dbaui struct SQLMessageBox_Impl; class OSQLMessageBox : public ButtonDialog { - FixedImage m_aInfoImage; - FixedText m_aTitle; - FixedText m_aMessage; + VclPtr<FixedImage> m_aInfoImage; + VclPtr<FixedText> m_aTitle; + VclPtr<FixedText> m_aMessage; OUString m_sHelpURL; ::std::unique_ptr< SQLMessageBox_Impl > m_pImpl; @@ -90,6 +90,7 @@ public: const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo = NULL ); virtual ~OSQLMessageBox(); + virtual void dispose() SAL_OVERRIDE; private: void Construct( WinBits nStyle, MessageType eImage ); diff --git a/dbaccess/source/ui/inc/textconnectionsettings.hxx b/dbaccess/source/ui/inc/textconnectionsettings.hxx index 872b02e42734..528382def297 100644 --- a/dbaccess/source/ui/inc/textconnectionsettings.hxx +++ b/dbaccess/source/ui/inc/textconnectionsettings.hxx @@ -38,7 +38,6 @@ namespace dbaui { public: TextConnectionSettingsDialog( vcl::Window* _pParent, SfxItemSet& _rItems ); - virtual ~TextConnectionSettingsDialog(); /** initializes a set of PropertyStorage instaces, which are bound to the text-connection relevant items in our item sets diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 5d2b824df208..db87ee74faa0 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -101,10 +101,6 @@ OCopyTable::OCopyTable(vcl::Window * pParent) SetText(ModuleRes(STR_COPYTABLE_TITLE_COPY)); } -OCopyTable::~OCopyTable() -{ -} - IMPL_LINK( OCopyTable, AppendDataClickHdl, Button*, /*pButton*/ ) { diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index 0df651f41212..dbb53a8313d6 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -81,6 +81,11 @@ OWizColumnSelect::OWizColumnSelect( vcl::Window* pParent) OWizColumnSelect::~OWizColumnSelect() { + dispose(); +} + +void OWizColumnSelect::dispose() +{ while ( m_pNewColumnNames->GetEntryCount() ) { void* pData = m_pNewColumnNames->GetEntryData(0); @@ -90,6 +95,7 @@ OWizColumnSelect::~OWizColumnSelect() m_pNewColumnNames->RemoveEntry(0); } m_pNewColumnNames->Clear(); + OWizardPage::dispose(); } void OWizColumnSelect::Reset() diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index d5e57ffe34e9..f4394921c68a 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -686,6 +686,11 @@ void OCopyTableWizard::construct() OCopyTableWizard::~OCopyTableWizard() { + dispose(); +} + +void OCopyTableWizard::dispose() +{ for ( ;; ) { TabPage *pPage = GetPage(0); @@ -710,6 +715,7 @@ OCopyTableWizard::~OCopyTableWizard() delete m_pbPrev; delete m_pbNext; delete m_pbFinish; + WizardDialog::dispose(); } IMPL_LINK_NOARG(OCopyTableWizard, ImplPrevHdl) diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 52af008b4979..a837ff2670de 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -72,10 +72,6 @@ OWizNameMatching::OWizNameMatching( vcl::Window* pParent) m_sDestText += "\n"; } -OWizNameMatching::~OWizNameMatching() -{ -} - void OWizNameMatching::Reset() { // urspr"unglichen zustand wiederherstellen diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 40e2227fd3ea..44c2b6b2eafd 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -49,11 +49,6 @@ OWizTypeSelectControl::OWizTypeSelectControl(vcl::Window* pParent, vcl::Window* m_pParentTabPage = pParentTabPage; } -OWizTypeSelectControl::~OWizTypeSelectControl() -{ - -} - void OWizTypeSelectControl::ActivateAggregate( EControlType eType ) { switch(eType ) @@ -255,7 +250,13 @@ OWizTypeSelect::OWizTypeSelect( vcl::Window* pParent, SvStream* _pStream ) OWizTypeSelect::~OWizTypeSelect() { + dispose(); +} + +void OWizTypeSelect::dispose() +{ delete m_pTypeControl; + OWizardPage::dispose(); } OUString OWizTypeSelect::GetTitle() const diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx index 0ea77ec75f26..2b6b3a42db34 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx @@ -180,12 +180,16 @@ namespace dbaui } OTableConnection::~OTableConnection() { + dispose(); + } + void OTableConnection::dispose() + { // clear vector clearLineData(); + vcl::Window::dispose(); } bool OConnectionLineAccess::isEditable() const { - return m_pLine ? !m_pLine->GetParent()->getDesignView()->getController().isReadOnly() : sal_False; } Reference< XAccessibleContext > SAL_CALL OConnectionLineAccess::getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException, std::exception) diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx index b61a512c1de6..58399a08f0e8 100644 --- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx +++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx @@ -61,10 +61,16 @@ OJoinDesignView::OJoinDesignView(vcl::Window* _pParent, OJoinController& _rContr OJoinDesignView::~OJoinDesignView() { + dispose(); +} + +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; + ODataView::dispose(); } void OJoinDesignView::Construct() diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index fda33fa98feb..be2b0e0bde1e 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -65,8 +65,8 @@ using namespace ::com::sun::star::lang; #define TABWIN_HEIGHT_STD 120 OScrollWindowHelper::OScrollWindowHelper( vcl::Window* pParent) : Window( pParent) - ,m_aHScrollBar( this, WB_HSCROLL|WB_REPEAT|WB_DRAG ) - ,m_aVScrollBar( this, WB_VSCROLL|WB_REPEAT|WB_DRAG ) + ,m_aHScrollBar( new ScrollBar(this, WB_HSCROLL|WB_REPEAT|WB_DRAG) ) + ,m_aVScrollBar( new ScrollBar(this, WB_VSCROLL|WB_REPEAT|WB_DRAG) ) ,m_pCornerWindow(new ScrollBarBox(this, WB_3DLOOK)) ,m_pTableView(NULL) { @@ -89,9 +89,17 @@ OScrollWindowHelper::OScrollWindowHelper( vcl::Window* pParent) : Window( pParen OScrollWindowHelper::~OScrollWindowHelper() { + dispose(); +} + +void OScrollWindowHelper::dispose() +{ boost::scoped_ptr<vcl::Window> aTemp(m_pCornerWindow); m_pCornerWindow = NULL; m_pTableView = NULL; + m_aHScrollBar.disposeAndClear(); + m_aVScrollBar.disposeAndClear(); + vcl::Window::dispose(); } void OScrollWindowHelper::setTableView(OJoinTableView* _pTableView) @@ -174,6 +182,11 @@ OJoinTableView::OJoinTableView( vcl::Window* pParent, OJoinDesignView* pView ) OJoinTableView::~OJoinTableView() { + dispose(); +} + +void OJoinTableView::dispose() +{ if( m_pAccessible ) { m_pAccessible->clearTableView(); @@ -181,6 +194,7 @@ OJoinTableView::~OJoinTableView() } // delete lists clearLayoutInformation(); + vcl::Window::dispose(); } IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar ) diff --git a/dbaccess/source/ui/querydesign/LimitBox.cxx b/dbaccess/source/ui/querydesign/LimitBox.cxx index 4f4175be859b..d22cb84d85f2 100644 --- a/dbaccess/source/ui/querydesign/LimitBox.cxx +++ b/dbaccess/source/ui/querydesign/LimitBox.cxx @@ -47,10 +47,6 @@ LimitBox::LimitBox( vcl::Window* pParent, WinBits nStyle ) SetSizePixel(aSize); } -LimitBox::~LimitBox() -{ -} - OUString LimitBox::CreateFieldText( sal_Int64 nValue ) const { if( nValue == ALL_INT ) diff --git a/dbaccess/source/ui/querydesign/QTableConnection.cxx b/dbaccess/source/ui/querydesign/QTableConnection.cxx index 2789e7bc11aa..0f546066be32 100644 --- a/dbaccess/source/ui/querydesign/QTableConnection.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnection.cxx @@ -37,10 +37,6 @@ OQueryTableConnection::OQueryTableConnection(const OQueryTableConnection& rConn) // no own members, so base class functionality is sufficient } -OQueryTableConnection::~OQueryTableConnection() -{ -} - OQueryTableConnection& OQueryTableConnection::operator=(const OQueryTableConnection& rConn) { if (&rConn == this) diff --git a/dbaccess/source/ui/querydesign/QTableConnection.hxx b/dbaccess/source/ui/querydesign/QTableConnection.hxx index 414b805346e3..33f492fcc03b 100644 --- a/dbaccess/source/ui/querydesign/QTableConnection.hxx +++ b/dbaccess/source/ui/querydesign/QTableConnection.hxx @@ -32,7 +32,6 @@ namespace dbaui public: OQueryTableConnection(OQueryTableView* pContainer, const TTableConnectionData::value_type& pTabConnData); OQueryTableConnection(const OQueryTableConnection& rConn); - virtual ~OQueryTableConnection(); OQueryTableConnection& operator=(const OQueryTableConnection& rConn); bool operator==(const OQueryTableConnection& rCompare); diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx index 6c3ab2d64d18..e12ad2990e59 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.cxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx @@ -66,10 +66,6 @@ OQueryTableWindow::OQueryTableWindow( vcl::Window* pParent, const TTableWindowDa SetHelpId(HID_CTL_QRYDGNTAB); } -OQueryTableWindow::~OQueryTableWindow() -{ -} - bool OQueryTableWindow::Init() { bool bSuccess = OTableWindow::Init(); @@ -102,8 +98,8 @@ bool OQueryTableWindow::Init() SetAliasName(sAliasName); // SetAliasName passes it as WinName, hence it uses the base class // reset the title - m_aTitle.SetText( pWinData->GetWinName() ); - m_aTitle.Show(); + m_aTitle->SetText( pWinData->GetWinName() ); + m_aTitle->Show(); getTableView()->getDesignView()->getController().InvalidateFeature(ID_BROWSER_QUERY_EXECUTE); return bSuccess; diff --git a/dbaccess/source/ui/querydesign/QTableWindow.hxx b/dbaccess/source/ui/querydesign/QTableWindow.hxx index 95c674107e77..8f64918b4eb5 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.hxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.hxx @@ -32,7 +32,6 @@ namespace dbaui OUString m_strInitialAlias; public: OQueryTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData, sal_Unicode* pszInitialAlias = NULL ); - virtual ~OQueryTableWindow(); OUString GetAliasName() const { diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index d8fe0e30520b..2c6ddebf9037 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -2490,7 +2490,7 @@ OQueryDesignView::OQueryDesignView( OQueryContainerWindow* _pParent, OQueryController& _rController, const Reference< XComponentContext >& _rxContext) :OQueryView( _pParent, _rController, _rxContext ) - ,m_aSplitter( this ) + ,m_aSplitter( new Splitter(this) ) ,m_eChildFocus(NONE) ,m_bInSplitHandler( false ) { @@ -2510,18 +2510,24 @@ OQueryDesignView::OQueryDesignView( OQueryContainerWindow* _pParent, setNoneVisbleRow(static_cast<OQueryController&>(getController()).getVisibleRows()); m_pSelectionBox->Show(); // setup Splitter - m_aSplitter.SetSplitHdl(LINK(this, OQueryDesignView,SplitHdl)); - m_aSplitter.Show(); + m_aSplitter->SetSplitHdl(LINK(this, OQueryDesignView,SplitHdl)); + m_aSplitter->Show(); } OQueryDesignView::~OQueryDesignView() { + dispose(); +} + +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_aSplitter.disposeAndClear(); + OQueryView::dispose(); } IMPL_LINK( OQueryDesignView, SplitHdl, void*, /*p*/ ) @@ -2529,8 +2535,8 @@ IMPL_LINK( OQueryDesignView, SplitHdl, void*, /*p*/ ) if (!getController().isReadOnly()) { m_bInSplitHandler = true; - m_aSplitter.SetPosPixel( Point( m_aSplitter.GetPosPixel().X(),m_aSplitter.GetSplitPosPixel() ) ); - static_cast<OQueryController&>(getController()).setSplitPos(m_aSplitter.GetSplitPosPixel()); + m_aSplitter->SetPosPixel( Point( m_aSplitter->GetPosPixel().X(),m_aSplitter->GetSplitPosPixel() ) ); + static_cast<OQueryController&>(getController()).setSplitPos(m_aSplitter->GetSplitPosPixel()); static_cast<OQueryController&>(getController()).setModified( sal_True ); Resize(); m_bInSplitHandler = true; @@ -2549,8 +2555,8 @@ void OQueryDesignView::initialize() { if(static_cast<OQueryController&>(getController()).getSplitPos() != -1) { - m_aSplitter.SetPosPixel( Point( m_aSplitter.GetPosPixel().X(),static_cast<OQueryController&>(getController()).getSplitPos() ) ); - m_aSplitter.SetSplitPosPixel(static_cast<OQueryController&>(getController()).getSplitPos()); + m_aSplitter->SetPosPixel( Point( m_aSplitter->GetPosPixel().X(),static_cast<OQueryController&>(getController()).getSplitPos() ) ); + m_aSplitter->SetSplitPosPixel(static_cast<OQueryController&>(getController()).getSplitPos()); } m_pSelectionBox->initialize(); reset(); @@ -2571,7 +2577,7 @@ void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground) { // let the selection browse box determine an optimal size Size aSelectionBoxSize = m_pSelectionBox->CalcOptimalSize( aPlaygroundSize ); - nSplitPos = aPlaygroundSize.Height() - aSelectionBoxSize.Height() - m_aSplitter.GetSizePixel().Height(); + nSplitPos = aPlaygroundSize.Height() - aSelectionBoxSize.Height() - m_aSplitter->GetSizePixel().Height(); // still an invalid size? if ( nSplitPos == -1 || nSplitPos >= aPlaygroundSize.Height() ) nSplitPos = sal_Int32(aPlaygroundSize.Height()*0.6); @@ -2586,13 +2592,13 @@ void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground) if ( aSelBoxSize.Height() ) { // keep the size of the sel box constant - nSplitPos = aPlaygroundSize.Height() - m_aSplitter.GetSizePixel().Height() - aSelBoxSize.Height(); + nSplitPos = aPlaygroundSize.Height() - m_aSplitter->GetSizePixel().Height() - aSelBoxSize.Height(); // and if the box is smaller than the optimal size, try to do something about it Size aSelBoxOptSize = m_pSelectionBox->CalcOptimalSize( aPlaygroundSize ); if ( aSelBoxOptSize.Height() > aSelBoxSize.Height() ) { - nSplitPos = aPlaygroundSize.Height() - m_aSplitter.GetSizePixel().Height() - aSelBoxOptSize.Height(); + nSplitPos = aPlaygroundSize.Height() - m_aSplitter->GetSizePixel().Height() - aSelBoxOptSize.Height(); } static_cast< OQueryController& >(getController()).setSplitPos( nSplitPos ); @@ -2602,7 +2608,7 @@ void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground) // normalize the split pos Point aSplitPos = Point( _rPlayground.Left(), nSplitPos ); - Size aSplitSize = Size( _rPlayground.GetSize().Width(), m_aSplitter.GetSizePixel().Height() ); + Size aSplitSize = Size( _rPlayground.GetSize().Width(), m_aSplitter->GetSizePixel().Height() ); if( ( aSplitPos.Y() + aSplitSize.Height() ) > ( aPlaygroundSize.Height() )) aSplitPos.Y() = aPlaygroundSize.Height() - aSplitSize.Height(); @@ -2619,8 +2625,8 @@ void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground) m_pSelectionBox->SetPosSizePixel( aPos, Size( aPlaygroundSize.Width(), aPlaygroundSize.Height() - aSplitSize.Height() - aTableViewSize.Height() )); // set the size of the splitter - m_aSplitter.SetPosSizePixel( aSplitPos, aSplitSize ); - m_aSplitter.SetDragRectPixel( _rPlayground ); + m_aSplitter->SetPosSizePixel( aSplitPos, aSplitSize ); + m_aSplitter->SetDragRectPixel( _rPlayground ); // just for completeness: there is no space left, we occupied it all ... _rPlayground.SetPos( _rPlayground.BottomRight() ); @@ -2993,8 +2999,8 @@ void OQueryDesignView::SaveUIConfig() OQueryController& rCtrl = static_cast<OQueryController&>(getController()); rCtrl.SaveTabWinsPosSize( &m_pTableView->GetTabWinMap(), m_pScrollWindow->GetHScrollBar().GetThumbPos(), m_pScrollWindow->GetVScrollBar().GetThumbPos() ); rCtrl.setVisibleRows( m_pSelectionBox->GetNoneVisibleRows() ); - if ( m_aSplitter.GetSplitPosPixel() != 0 ) - rCtrl.setSplitPos( m_aSplitter.GetSplitPosPixel() ); + if ( m_aSplitter->GetSplitPosPixel() != 0 ) + rCtrl.setSplitPos( m_aSplitter->GetSplitPosPixel() ); } OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(OTableFieldDescRef pEntry, diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index e3e92e2c3637..b4b313be212c 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -228,10 +228,6 @@ OQueryTableView::OQueryTableView( vcl::Window* pParent,OQueryDesignView* pView) SetHelpId(HID_CTL_QRYDGNTAB); } -OQueryTableView::~OQueryTableView() -{ -} - sal_Int32 OQueryTableView::CountTableAlias(const OUString& rName, sal_Int32& rMax) { sal_Int32 nRet = 0; diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx index 162eb9b93502..62e282bed659 100644 --- a/dbaccess/source/ui/querydesign/QueryTextView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx @@ -52,8 +52,14 @@ OQueryTextView::OQueryTextView(OQueryContainerWindow* _pParent) OQueryTextView::~OQueryTextView() { + dispose(); +} + +void OQueryTextView::dispose() +{ boost::scoped_ptr<vcl::Window> aTemp(m_pEdit); m_pEdit = NULL; + vcl::Window::dispose(); } void OQueryTextView::GetFocus() diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index e11f08d7184d..07c0c2d6b43d 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -153,13 +153,18 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent ) OSelectionBrowseBox::~OSelectionBrowseBox() { + dispose(); +} +void OSelectionBrowseBox::dispose() +{ delete m_pTextCell; delete m_pVisibleCell; delete m_pFieldCell; delete m_pTableCell; delete m_pOrderCell; delete m_pFunctionCell; + ::svt::EditBrowseBox::dispose(); } void OSelectionBrowseBox::initialize() diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 6d3901e8d4ca..233ddeb1f2b7 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -80,6 +80,7 @@ namespace dbaui DECL_LINK(OnInvalidateTimer, void*); public: OSelectionBrowseBox( vcl::Window* pParent ); virtual ~OSelectionBrowseBox(); + virtual void dispose() SAL_OVERRIDE; void initialize(); OTableFieldDescRef InsertField( const OJoinExchangeData& jxdSource, sal_uInt16 _nColumnPosition = BROWSER_INVALIDID, bool bVis=true, bool bActivate=true ); diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index 35888462af34..dbc0264df085 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -69,8 +69,8 @@ namespace DatabaseObject = css::sdb::application::DatabaseObject; OTableWindow::OTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData ) : ::comphelper::OContainerListener(m_aMutex) ,Window( pParent, WB_3DLOOK|WB_MOVEABLE ) - ,m_aTypeImage( this ) - ,m_aTitle( this ) + ,m_aTypeImage( new FixedImage(this) ) + ,m_aTitle( new OTableWindowTitle(this) ) ,m_pListBox(NULL) ,m_pAccessible(NULL) ,m_pData( pTabWinData ) @@ -99,7 +99,11 @@ OTableWindow::OTableWindow( vcl::Window* pParent, const TTableWindowData::value_ OTableWindow::~OTableWindow() { + dispose(); +} +void OTableWindow::dispose() +{ if (m_pListBox) { OSL_ENSURE(m_pListBox->GetEntryCount()==0,"Forgot to call EmptyListbox()!"); @@ -110,6 +114,9 @@ OTableWindow::~OTableWindow() m_pContainerListener->dispose(); m_pAccessible = NULL; + m_aTypeImage.disposeAndClear(); + m_aTitle.disposeAndClear(); + vcl::Window::dispose(); } const OJoinTableView* OTableWindow::getTableView() const @@ -263,8 +270,8 @@ void OTableWindow::impl_updateImage() return; } - m_aTypeImage.SetModeImage( aImage ); - m_aTypeImage.Show(); + m_aTypeImage->SetModeImage( aImage ); + m_aTypeImage->Show(); } bool OTableWindow::Init() @@ -278,8 +285,8 @@ bool OTableWindow::Init() } // Set the title - m_aTitle.SetText( m_pData->GetWinName() ); - m_aTitle.Show(); + m_aTitle->SetText( m_pData->GetWinName() ); + m_aTitle->Show(); m_pListBox->Show(); @@ -456,15 +463,15 @@ void OTableWindow::Resize() long nPositionY = n5Pos; // position the image which indicates the type - m_aTypeImage.SetPosPixel( Point( nPositionX, nPositionY ) ); - Size aImageSize( m_aTypeImage.GetImage().GetSizePixel() ); - m_aTypeImage.SetSizePixel( aImageSize ); + m_aTypeImage->SetPosPixel( Point( nPositionX, nPositionY ) ); + Size aImageSize( m_aTypeImage->GetImage().GetSizePixel() ); + m_aTypeImage->SetSizePixel( aImageSize ); if ( nTitleHeight < aImageSize.Height() ) nTitleHeight = aImageSize.Height(); nPositionX += aImageSize.Width() + CalcZoom( 2 ); - m_aTitle.SetPosSizePixel( Point( nPositionX, nPositionY ), Size( aOutSize.Width() - nPositionX - n5Pos, nTitleHeight ) ); + m_aTitle->SetPosSizePixel( Point( nPositionX, nPositionY ), Size( aOutSize.Width() - nPositionX - n5Pos, nTitleHeight ) ); long nTitleToList = CalcZoom( 3 ); @@ -478,10 +485,10 @@ void OTableWindow::Resize() void OTableWindow::SetBoldTitle( bool bBold ) { - vcl::Font aFont = m_aTitle.GetFont(); + vcl::Font aFont = m_aTitle->GetFont(); aFont.SetWeight( bBold?WEIGHT_BOLD:WEIGHT_NORMAL ); - m_aTitle.SetFont( aFont ); - m_aTitle.Invalidate(); + m_aTitle->SetFont( aFont ); + m_aTitle->Invalidate(); } void OTableWindow::GetFocus() @@ -559,7 +566,7 @@ void OTableWindow::StateChanged( StateChangedType nType ) aFont.Merge( GetControlFont() ); SetZoomedPointFont( aFont ); - m_aTitle.SetZoom(GetZoom()); + m_aTitle->SetZoom(GetZoom()); m_pListBox->SetZoom(GetZoom()); Resize(); Invalidate(); @@ -591,7 +598,7 @@ void OTableWindow::Command(const CommandEvent& rEvt) if ( pCurrent ) ptWhere = m_pListBox->GetEntryPosition(pCurrent); else - ptWhere = m_aTitle.GetPosPixel(); + ptWhere = m_aTitle->GetPosPixel(); } PopupMenu aContextMenu(ModuleRes(RID_MENU_JOINVIEW_TABLE)); @@ -746,7 +753,7 @@ bool OTableWindow::PreNotify(NotifyEvent& rNEvt) OUString OTableWindow::getTitle() const { - return m_aTitle.GetText(); + return m_aTitle->GetText(); } void OTableWindow::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException, std::exception) diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index 1796dcf8e574..77a354ca58a8 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -68,6 +68,11 @@ void OTableWindowListBox::dragFinished( ) OTableWindowListBox::~OTableWindowListBox() { + dispose(); +} + +void OTableWindowListBox::dispose() +{ if (m_nDropEvent) Application::RemoveUserEvent(m_nDropEvent); if (m_nUiEvent) @@ -75,6 +80,7 @@ OTableWindowListBox::~OTableWindowListBox() if( m_aScrollTimer.IsActive() ) m_aScrollTimer.Stop(); m_pTabWin = NULL; + SvTreeListBox::dispose(); } SvTreeListEntry* OTableWindowListBox::GetEntryFromText( const OUString& rEntryText ) diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx index 79bcc29c871d..69adb564f4e8 100644 --- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx @@ -55,7 +55,13 @@ OTableWindowTitle::OTableWindowTitle( OTableWindow* pParent ) : OTableWindowTitle::~OTableWindowTitle() { + dispose(); +} + +void OTableWindowTitle::dispose() +{ m_pTabWin = NULL; + FixedText::dispose(); } void OTableWindowTitle::GetFocus() diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx index ad0c88866ed6..29bc0e70eebf 100644 --- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx +++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx @@ -34,7 +34,6 @@ class LimitBoxImpl: public LimitBox { public: LimitBoxImpl( vcl::Window* pParent, LimitBoxController* pCtrl ); - virtual ~LimitBoxImpl(); virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE; @@ -48,10 +47,6 @@ LimitBoxImpl::LimitBoxImpl( vcl::Window* pParent, LimitBoxController* pCtrl ) { } -LimitBoxImpl::~LimitBoxImpl() -{ -} - bool LimitBoxImpl::Notify( NotifyEvent& rNEvt ) { bool nHandled = false; diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 7372ec724d2a..26f91d004fd2 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -56,6 +56,10 @@ namespace dbaui } OQueryContainerWindow::~OQueryContainerWindow() { + dispose(); + } + void OQueryContainerWindow::dispose() + { { boost::scoped_ptr<OQueryViewSwitch> aTemp(m_pViewSwitch); m_pViewSwitch = NULL; @@ -73,7 +77,7 @@ namespace dbaui boost::scoped_ptr<vcl::Window> aTemp(m_pSplitter); m_pSplitter = NULL; - + 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 6263d0cd52a7..aa1ea5dcc564 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -139,7 +139,13 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, DlgQryJoin::~DlgQryJoin() { + dispose(); +} + +void DlgQryJoin::dispose() +{ delete m_pTableControl; + ModalDialog::dispose(); } IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) diff --git a/dbaccess/source/ui/querydesign/querydlg.hxx b/dbaccess/source/ui/querydesign/querydlg.hxx index e8ce875cbdea..18c2c1bc6775 100644 --- a/dbaccess/source/ui/querydesign/querydlg.hxx +++ b/dbaccess/source/ui/querydesign/querydlg.hxx @@ -69,6 +69,7 @@ namespace dbaui const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection, bool _bAllowTableSelect); virtual ~DlgQryJoin(); + virtual void dispose() SAL_OVERRIDE; EJoinType GetJoinType() const { return eJoinType; }; /** getConnectionData returns the current connection data diff --git a/dbaccess/source/ui/querydesign/queryview.cxx b/dbaccess/source/ui/querydesign/queryview.cxx index a10a73045a0b..c18ef092d24d 100644 --- a/dbaccess/source/ui/querydesign/queryview.cxx +++ b/dbaccess/source/ui/querydesign/queryview.cxx @@ -30,9 +30,4 @@ OQueryView::OQueryView(vcl::Window* _pParent, OQueryController& _rController,con } -OQueryView::~OQueryView() -{ - -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx index 03a9b56c8826..1f18d83af39a 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx @@ -38,10 +38,6 @@ ORelationTableConnection::ORelationTableConnection( const ORelationTableConnecti // no own members, thus the base class functionality is enough } -ORelationTableConnection::~ORelationTableConnection() -{ -} - ORelationTableConnection& ORelationTableConnection::operator=( const ORelationTableConnection& rConn ) { // this doesn't change anything, since the base class tests this, too and I don't have my own members to copy diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.hxx b/dbaccess/source/ui/relationdesign/RTableConnection.hxx index 24339b521a23..3ebea9b873f3 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnection.hxx +++ b/dbaccess/source/ui/relationdesign/RTableConnection.hxx @@ -31,7 +31,6 @@ namespace dbaui ORelationTableConnection( ORelationTableView* pContainer, const TTableConnectionData::value_type& pTabConnData ); ORelationTableConnection( const ORelationTableConnection& rConn ); // wichtiger Kommentar zum CopyConstructor siehe OTableConnection(const OTableConnection&) - virtual ~ORelationTableConnection(); ORelationTableConnection& operator=( const ORelationTableConnection& rConn ); diff --git a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx index a27f4a5b2eb6..86b52a38bd6c 100644 --- a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx @@ -50,10 +50,6 @@ ORelationDesignView::ORelationDesignView(vcl::Window* _pParent, ORelationControl { } -ORelationDesignView::~ORelationDesignView() -{ -} - void ORelationDesignView::Construct() { m_pTableView = new ORelationTableView(m_pScrollWindow,this); diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index 38ee81fb1715..bf39293e01a2 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -73,8 +73,14 @@ ORelationTableView::ORelationTableView( vcl::Window* pParent, ORelationDesignVie ORelationTableView::~ORelationTableView() { + dispose(); +} + +void ORelationTableView::dispose() +{ if ( m_pContainerListener.is() ) m_pContainerListener->dispose(); + OJoinTableView::dispose(); } void ORelationTableView::ReSync() diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx index 94f646154b58..2123aa51f907 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx @@ -38,8 +38,14 @@ OFieldDescGenWin::OFieldDescGenWin( vcl::Window* pParent, OTableDesignHelpBar* p OFieldDescGenWin::~OFieldDescGenWin() { + dispose(); +} + +void OFieldDescGenWin::dispose() +{ boost::scoped_ptr<vcl::Window> aTemp(m_pFieldControl); m_pFieldControl = NULL; + TabPage::dispose(); } void OFieldDescGenWin::Init() diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx index 1af0ffd68876..ab4e453f7c34 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx +++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx @@ -39,6 +39,7 @@ namespace dbaui public: OFieldDescGenWin( vcl::Window* pParent, OTableDesignHelpBar* pHelpBar ); virtual ~OFieldDescGenWin(); + virtual void dispose() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; virtual void LoseFocus() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index d8b907d4183e..1b0f9db0b487 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -253,6 +253,11 @@ void OTableEditorCtrl::ClearModified() OTableEditorCtrl::~OTableEditorCtrl() { + dispose(); +} + +void OTableEditorCtrl::dispose() +{ // Reset the Undo-Manager GetUndoManager().Clear(); @@ -273,6 +278,7 @@ OTableEditorCtrl::~OTableEditorCtrl() delete pTypeCell; delete pDescrCell; delete pHelpTextCell; + OTableRowView::dispose(); } bool OTableEditorCtrl::SetDataPtr( long nRow ) diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx index bfae245eca31..07bcfc596a85 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.hxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx @@ -122,6 +122,7 @@ namespace dbaui public: OTableEditorCtrl(vcl::Window* pParentWin); virtual ~OTableEditorCtrl(); + virtual void dispose() SAL_OVERRIDE; virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol) SAL_OVERRIDE; SfxUndoManager& GetUndoManager() const; diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx index f4348d5ebdfb..d20572bebef3 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx @@ -48,11 +48,6 @@ OTableRowView::OTableRowView(vcl::Window* pParent) } -OTableRowView::~OTableRowView() -{ - -} - void OTableRowView::Init() { EditBrowseBox::Init(); diff --git a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx index a5f2010fb15d..ec756cd53b8a 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx @@ -38,8 +38,14 @@ OTableDesignHelpBar::OTableDesignHelpBar( vcl::Window* pParent ) : OTableDesignHelpBar::~OTableDesignHelpBar() { + dispose(); +} + +void OTableDesignHelpBar::dispose() +{ boost::scoped_ptr<vcl::Window> aTemp(m_pTextWin); m_pTextWin = NULL; + TabPage::dispose(); } void OTableDesignHelpBar::SetHelpText( const OUString& rText ) diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx index 996a84c0e162..9cf37d80df9e 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx @@ -42,7 +42,7 @@ using namespace ::com::sun::star::beans; // class OTableBorderWindow OTableBorderWindow::OTableBorderWindow(vcl::Window* pParent) : Window(pParent,WB_BORDER) - ,m_aHorzSplitter( this ) + ,m_aHorzSplitter( new Splitter(this) ) { ImplInitSettings( true, true, true ); @@ -56,12 +56,17 @@ OTableBorderWindow::OTableBorderWindow(vcl::Window* pParent) : Window(pParent,WB m_pEditorCtrl->SetDescrWin(m_pFieldDescWin); // Splitter einrichten - m_aHorzSplitter.SetSplitHdl( LINK(this, OTableBorderWindow, SplitHdl) ); - m_aHorzSplitter.Show(); + m_aHorzSplitter->SetSplitHdl( LINK(this, OTableBorderWindow, SplitHdl) ); + m_aHorzSplitter->Show(); } OTableBorderWindow::~OTableBorderWindow() { + dispose(); +} + +void OTableBorderWindow::dispose() +{ // Children zerstoeren // ::dbaui::notifySystemWindow(this,m_pFieldDescWin,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); m_pEditorCtrl->Hide(); @@ -75,7 +80,8 @@ OTableBorderWindow::~OTableBorderWindow() boost::scoped_ptr<vcl::Window> aTemp(m_pFieldDescWin); m_pFieldDescWin = NULL; } - + m_aHorzSplitter.disposeAndClear(); + vcl::Window::dispose(); } void OTableBorderWindow::Resize() @@ -86,18 +92,18 @@ void OTableBorderWindow::Resize() Size aOutputSize( GetOutputSize() ); long nOutputWidth = aOutputSize.Width(); long nOutputHeight = aOutputSize.Height(); - long nSplitPos = m_aHorzSplitter.GetSplitPosPixel(); + long nSplitPos = m_aHorzSplitter->GetSplitPosPixel(); // Verschiebebereich Splitter mittleres Drittel des Outputs long nDragPosY = nOutputHeight/3; long nDragSizeHeight = nOutputHeight/3; - m_aHorzSplitter.SetDragRectPixel( Rectangle(Point(0,nDragPosY), Size(nOutputWidth,nDragSizeHeight) ), this ); + m_aHorzSplitter->SetDragRectPixel( Rectangle(Point(0,nDragPosY), Size(nOutputWidth,nDragSizeHeight) ), this ); if( (nSplitPos < nDragPosY) || (nSplitPos > (nDragPosY+nDragSizeHeight)) ) nSplitPos = nDragPosY+nDragSizeHeight-5; // Splitter setzen - m_aHorzSplitter.SetPosSizePixel( Point( 0, nSplitPos ), Size(nOutputWidth, nSplitterHeight)); - m_aHorzSplitter.SetSplitPosPixel( nSplitPos ); + m_aHorzSplitter->SetPosSizePixel( Point( 0, nSplitPos ), Size(nOutputWidth, nSplitterHeight)); + m_aHorzSplitter->SetSplitPosPixel( nSplitPos ); // Fenster setzen m_pEditorCtrl->SetPosSizePixel( Point(0, 0), Size(nOutputWidth , nSplitPos) ); @@ -108,9 +114,9 @@ void OTableBorderWindow::Resize() IMPL_LINK( OTableBorderWindow, SplitHdl, Splitter*, pSplit ) { - if(pSplit == &m_aHorzSplitter) + if(pSplit == m_aHorzSplitter.get()) { - m_aHorzSplitter.SetPosPixel( Point( m_aHorzSplitter.GetPosPixel().X(),m_aHorzSplitter.GetSplitPosPixel() ) ); + m_aHorzSplitter->SetPosPixel( Point( m_aHorzSplitter->GetPosPixel().X(),m_aHorzSplitter->GetSplitPosPixel() ) ); Resize(); } return 0; @@ -190,12 +196,18 @@ OTableDesignView::OTableDesignView( vcl::Window* pParent, OTableDesignView::~OTableDesignView() { + dispose(); +} + +void OTableDesignView::dispose() +{ m_pWin->Hide(); { boost::scoped_ptr<vcl::Window> aTemp(m_pWin); m_pWin = NULL; } + ODataView::dispose(); } void OTableDesignView::initialize() diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx index 1cd013e008cf..3f1ee94f68ce 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx @@ -66,6 +66,11 @@ OTableFieldDescWin::OTableFieldDescWin( vcl::Window* pParent) OTableFieldDescWin::~OTableFieldDescWin() { + dispose(); +} + +void OTableFieldDescWin::dispose() +{ // destroy children m_pHelpBar->Hide(); getGenPage()->Hide(); @@ -83,6 +88,7 @@ OTableFieldDescWin::~OTableFieldDescWin() boost::scoped_ptr<vcl::Window> aTemp(m_pHelpBar); m_pHelpBar = NULL; } + TabPage::dispose(); } void OTableFieldDescWin::Init() diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx index f2092ff35a13..1b17aa8213d4 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx @@ -55,6 +55,7 @@ namespace dbaui public: OTableFieldDescWin( vcl::Window* pParent); virtual ~OTableFieldDescWin(); + virtual void dispose() SAL_OVERRIDE; void Init(); |