diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-16 12:17:44 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 11:20:46 +0100 |
commit | c72fac269626cd4c2c3f62a6eed69e47b59256a4 (patch) | |
tree | d36dd1a09731cb07254ae4a09036b2d64a59de44 /dbaccess | |
parent | de6b9148eb64dfa4b31c87c1ac46fda0821645e3 (diff) |
vclwidget: convert lots more sites to use VclPtr
seems there was a lot of shared_ptr usage floating around...
Change-Id: Icd05243170eb8493709275fc36bf986fc194b781
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/control/RelationControl.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/textconnectionsettings.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/textconnectionsettings.hxx | 4 |
5 files changed, 12 insertions, 11 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 5c0189f5d561..bebc01fe2e71 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -248,11 +248,9 @@ void OAppDetailPageHelper::dispose() { m_pLists[i]->clearCurrentSelection(); m_pLists[i]->Hide(); - boost::scoped_ptr<DBTreeListBox> aTemp(m_pLists[i]); m_pLists[i]->clearCurrentSelection(); // why a second time? - m_pLists[i] = NULL; + m_pLists[i].disposeAndClear(); } - } m_aFL.disposeAndClear(); m_aTBPreview.disposeAndClear(); @@ -369,7 +367,7 @@ void OAppDetailPageHelper::describeCurrentSelectionForControl( const Control& _r void OAppDetailPageHelper::describeCurrentSelectionForType( const ElementType _eType, Sequence< NamedDatabaseObject >& _out_rSelectedObjects ) { OSL_ENSURE( _eType < E_ELEMENT_TYPE_COUNT, "OAppDetailPageHelper::describeCurrentSelectionForType: invalid type!" ); - DBTreeListBox* pList = ( _eType < E_ELEMENT_TYPE_COUNT ) ? m_pLists[ _eType ] : NULL; + DBTreeListBox* pList = ( _eType < E_ELEMENT_TYPE_COUNT ) ? m_pLists[ _eType ].get() : NULL; OSL_ENSURE( pList, "OAppDetailPageHelper::describeCurrentSelectionForType: " "You really should ensure this type has already been viewed before!" ); if ( !pList ) @@ -586,7 +584,7 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon } if ( !m_pLists[E_TABLE]->GetEntryCount() ) { - static_cast<OTableTreeListBox*>(m_pLists[E_TABLE])->UpdateTableList(_xConnection); + static_cast<OTableTreeListBox*>(m_pLists[E_TABLE].get())->UpdateTableList(_xConnection); SvTreeListEntry* pEntry = m_pLists[E_TABLE]->First(); if ( pEntry ) @@ -1226,7 +1224,7 @@ void OAppDetailPageHelper::DataChanged( const DataChangedEvent& rDCEvt ) ImplInitSettings(); if ( m_pLists[ E_TABLE ] ) { - OTableTreeListBox* pTableTree = dynamic_cast< OTableTreeListBox* >( m_pLists[ E_TABLE ] ); + OTableTreeListBox* pTableTree = dynamic_cast< OTableTreeListBox* >( m_pLists[ E_TABLE ].get() ); OSL_ENSURE( pTableTree != NULL, "OAppDetailPageHelper::DataChanged: a tree list for tables which is no TableTreeList?" ); if ( pTableTree ) pTableTree->notifyHiContrastChanged(); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx index 90de8ea493d1..9240fb94e0b5 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx @@ -77,7 +77,7 @@ namespace dbaui // Combines general functionality. class OAppDetailPageHelper : public vcl::Window { - DBTreeListBox* m_pLists[ELEMENT_COUNT]; + VclPtr<DBTreeListBox> m_pLists[ELEMENT_COUNT]; OAppBorderWindow& m_rBorderWin; VclPtr<FixedLine> m_aFL; VclPtr<ToolBox> m_aTBPreview; @@ -194,7 +194,7 @@ namespace dbaui inline DBTreeListBox* getCurrentView() const { ElementType eType = getElementType(); - return (eType != E_NONE ) ? m_pLists[static_cast<sal_Int32>(eType)] : NULL; + return (eType != E_NONE ) ? m_pLists[static_cast<sal_Int32>(eType)].get() : NULL; } /// select all entries in the visible control diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 293812655582..d5b9cda3ddd7 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -59,7 +59,7 @@ namespace dbaui { friend class OTableListBoxControl; - ::std::unique_ptr< ::svt::ListBoxControl> m_pListCell; + VclPtr< ::svt::ListBoxControl> m_pListCell; TTableConnectionData::value_type m_pConnData; OTableListBoxControl* m_pBoxControl; long m_nDataPos; @@ -101,6 +101,8 @@ namespace dbaui void lateInit(); protected: + virtual ~ORelationControl() { disposeOnce(); } + virtual void dispose() SAL_OVERRIDE { m_pListCell.disposeAndClear(); ORelationControl_Base::dispose(); } virtual void Resize() SAL_OVERRIDE; virtual Size GetOptimalSize() const SAL_OVERRIDE; virtual bool PreNotify(NotifyEvent& rNEvt ) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/textconnectionsettings.cxx b/dbaccess/source/ui/dlg/textconnectionsettings.cxx index 77c515e672ca..0fd69e95b937 100644 --- a/dbaccess/source/ui/dlg/textconnectionsettings.cxx +++ b/dbaccess/source/ui/dlg/textconnectionsettings.cxx @@ -47,6 +47,7 @@ namespace dbaui void TextConnectionSettingsDialog::dispose() { m_pOK.clear(); + m_pTextConnectionHelper.disposeAndClear(); ModalDialog::dispose(); } diff --git a/dbaccess/source/ui/inc/textconnectionsettings.hxx b/dbaccess/source/ui/inc/textconnectionsettings.hxx index fdd5a9489121..89bcfc354e9c 100644 --- a/dbaccess/source/ui/inc/textconnectionsettings.hxx +++ b/dbaccess/source/ui/inc/textconnectionsettings.hxx @@ -49,8 +49,8 @@ namespace dbaui virtual short Execute() SAL_OVERRIDE; private: - ::std::unique_ptr< OTextConnectionHelper > m_pTextConnectionHelper; - VclPtr<OKButton> m_pOK; + VclPtr<OTextConnectionHelper> m_pTextConnectionHelper; + VclPtr<OKButton> m_pOK; SfxItemSet& m_rItems; private: |