diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-26 13:11:07 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 21:35:30 +0100 |
commit | 1139e549240e2a02962360aadca227753d73a78c (patch) | |
tree | 8ae4b59ca081f893400abc2960f0556517db2c21 /extensions | |
parent | b53f7ee341765a7b052b98a58678df25c299c58a (diff) |
vcl: VclPtr conversion in extensions
Change-Id: Ie10e8fcb2bf413606063d4f1caab17bea1bb4d95
Diffstat (limited to 'extensions')
38 files changed, 364 insertions, 227 deletions
diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx index 1cf24b87a2ac..3092133c2cee 100644 --- a/extensions/source/abpilot/abpfinalpage.cxx +++ b/extensions/source/abpilot/abpfinalpage.cxx @@ -64,7 +64,13 @@ namespace abp FinalPage::~FinalPage() { + dispose(); + } + + void FinalPage::dispose() + { delete m_pLocationController; + AddressBookSourcePage::dispose(); } bool FinalPage::isValidName() const diff --git a/extensions/source/abpilot/abpfinalpage.hxx b/extensions/source/abpilot/abpfinalpage.hxx index 821f39f62525..65c40b3ba037 100644 --- a/extensions/source/abpilot/abpfinalpage.hxx +++ b/extensions/source/abpilot/abpfinalpage.hxx @@ -53,6 +53,7 @@ namespace abp public: FinalPage( OAddessBookSourcePilot* _pParent ); virtual ~FinalPage(); + virtual void dispose() SAL_OVERRIDE; protected: // OWizardPage overridables diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx index 45abc6bf7036..6cfda0bd9da4 100644 --- a/extensions/source/abpilot/abspilot.cxx +++ b/extensions/source/abpilot/abspilot.cxx @@ -130,11 +130,6 @@ namespace abp SetHelpId(HID_ABSPILOT); } - OAddessBookSourcePilot::~OAddessBookSourcePilot() - { - } - - OUString OAddessBookSourcePilot::getStateDisplayName( WizardState _nState ) const { sal_uInt16 nResId = 0; diff --git a/extensions/source/abpilot/abspilot.hxx b/extensions/source/abpilot/abspilot.hxx index cd4e818f41c5..5c67bc15b36d 100644 --- a/extensions/source/abpilot/abspilot.hxx +++ b/extensions/source/abpilot/abspilot.hxx @@ -49,8 +49,6 @@ namespace abp OAddessBookSourcePilot( vcl::Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); - /// dtor - virtual ~OAddessBookSourcePilot(); /// get the service factory which was used to create the dialog const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx index 79361869e8b7..099ea23f2053 100644 --- a/extensions/source/abpilot/typeselectionpage.cxx +++ b/extensions/source/abpilot/typeselectionpage.cxx @@ -151,11 +151,17 @@ namespace abp TypeSelectionPage::~TypeSelectionPage() { + dispose(); + } + + void TypeSelectionPage::dispose() + { for ( ::std::vector< ButtonItem >::iterator loop = m_aAllTypes.begin(); loop != m_aAllTypes.end(); ++loop ) { loop->m_bVisible = false; } + AddressBookSourcePage::dispose(); } diff --git a/extensions/source/abpilot/typeselectionpage.hxx b/extensions/source/abpilot/typeselectionpage.hxx index 2e4437e285f8..131d5ea91bb6 100644 --- a/extensions/source/abpilot/typeselectionpage.hxx +++ b/extensions/source/abpilot/typeselectionpage.hxx @@ -66,6 +66,7 @@ namespace abp public: TypeSelectionPage( OAddessBookSourcePilot* _pParent ); virtual ~TypeSelectionPage(); + virtual void dispose() SAL_OVERRIDE; // retrieves the currently selected type AddressSourceType getSelectedType() const; diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx index 72120f8d36ce..1a4713c8d173 100644 --- a/extensions/source/bibliography/bibbeam.cxx +++ b/extensions/source/bibliography/bibbeam.cxx @@ -87,6 +87,7 @@ namespace bib BibGridwin(vcl::Window* pParent, WinBits nStyle = WB_3DLOOK ); virtual ~BibGridwin(); + virtual void dispose() SAL_OVERRIDE; void createGridWin(const Reference< awt::XControlModel > & xDbForm); void disposeGridWin(); @@ -107,9 +108,15 @@ namespace bib BibGridwin::~BibGridwin() { + dispose(); + } + + void BibGridwin::dispose() + { RemoveFromTaskPaneList( this ); disposeGridWin(); + vcl::Window::dispose(); } void BibGridwin::Resize() @@ -195,6 +202,11 @@ namespace bib BibBeamer::~BibBeamer() { + dispose(); + } + + void BibBeamer::dispose() + { if ( isFormConnected() ) disconnectForm(); @@ -215,7 +227,7 @@ namespace bib pDel->disposeGridWin(); delete pDel; } - + BibSplitWindow::dispose(); } void BibBeamer::createToolBar() diff --git a/extensions/source/bibliography/bibbeam.hxx b/extensions/source/bibliography/bibbeam.hxx index bfecf435ecb5..980ebf84b5fa 100644 --- a/extensions/source/bibliography/bibbeam.hxx +++ b/extensions/source/bibliography/bibbeam.hxx @@ -72,6 +72,7 @@ namespace bib BibBeamer(vcl::Window* pParent,BibDataManager* pDatMan, WinBits nStyle = WB_3DLOOK ); virtual ~BibBeamer(); + virtual void dispose() SAL_OVERRIDE; void SetXController(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > &); diff --git a/extensions/source/bibliography/bibcont.cxx b/extensions/source/bibliography/bibcont.cxx index 954700c24277..d13600c89eb7 100644 --- a/extensions/source/bibliography/bibcont.cxx +++ b/extensions/source/bibliography/bibcont.cxx @@ -56,20 +56,11 @@ BibSplitWindow::BibSplitWindow( vcl::Window* pParent, WinBits nStyle ) : SplitWi { } -BibSplitWindow::~BibSplitWindow() -{ -} - BibTabPage::BibTabPage( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription ) : TabPage( pParent, rID, rUIXMLDescription ), BibShortCutHandler( this ) { } -BibTabPage::~BibTabPage() -{ -} - - using namespace osl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -94,12 +85,18 @@ BibWindowContainer::BibWindowContainer( vcl::Window* pParent, BibShortCutHandler BibWindowContainer::~BibWindowContainer() { + dispose(); +} + +void BibWindowContainer::dispose() +{ if( pChild ) { vcl::Window* pDel = GetChild(); pChild = NULL; // prevents GetFocus for child while deleting! delete pDel; } + vcl::Window::dispose(); } void BibWindowContainer::Resize() @@ -132,6 +129,11 @@ BibBookContainer::BibBookContainer(vcl::Window* pParent, WinBits nStyle): BibBookContainer::~BibBookContainer() { + dispose(); +} + +void BibBookContainer::dispose() +{ if( xTopFrameRef.is() ) xTopFrameRef->dispose(); if( xBottomFrameRef.is() ) @@ -152,6 +154,7 @@ BibBookContainer::~BibBookContainer() } CloseBibModul( pBibMod ); + BibSplitWindow::dispose(); } void BibBookContainer::Split() diff --git a/extensions/source/bibliography/bibcont.hxx b/extensions/source/bibliography/bibcont.hxx index af6a78839900..9c26ca05a41e 100644 --- a/extensions/source/bibliography/bibcont.hxx +++ b/extensions/source/bibliography/bibcont.hxx @@ -43,8 +43,9 @@ class BibWindowContainer : public BibWindow //Window public: BibWindowContainer( vcl::Window* pParent, BibShortCutHandler* pChild, WinBits nStyle = WB_3DLOOK); virtual ~BibWindowContainer(); + virtual void dispose() SAL_OVERRIDE; - inline vcl::Window* GetChild(); + inline vcl::Window* GetChild(); virtual void GetFocus() SAL_OVERRIDE; @@ -55,7 +56,7 @@ class BibWindowContainer : public BibWindow //Window inline vcl::Window* BibWindowContainer::GetChild() { - return pChild? pChild->GetWindow() : NULL; + return pChild ? pChild->GetWindow() : NULL; } @@ -86,6 +87,7 @@ class BibBookContainer: public BibSplitWindow BibBookContainer(vcl::Window* pParent, WinBits nStyle = WB_3DLOOK ); virtual ~BibBookContainer(); + virtual void dispose() SAL_OVERRIDE; inline BibWindow* GetTopWin() {return pTopWin;} inline BibWindow* GetBottomWin() {return pBottomWin;} diff --git a/extensions/source/bibliography/bibshortcuthandler.hxx b/extensions/source/bibliography/bibshortcuthandler.hxx index f8c87f395fb5..f109aebfbc5a 100644 --- a/extensions/source/bibliography/bibshortcuthandler.hxx +++ b/extensions/source/bibliography/bibshortcuthandler.hxx @@ -63,14 +63,12 @@ class BibSplitWindow : public SplitWindow, public BibShortCutHandler { public: BibSplitWindow( vcl::Window* pParent,WinBits nStyle = WB_3DLOOK); - virtual ~BibSplitWindow(); }; class BibTabPage : public TabPage, public BibShortCutHandler { public: BibTabPage( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription ); - virtual ~BibTabPage(); }; #endif diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx index 2d715d040d5a..1df84033e093 100644 --- a/extensions/source/bibliography/bibview.cxx +++ b/extensions/source/bibliography/bibview.cxx @@ -60,6 +60,11 @@ namespace bib BibView::~BibView() { + dispose(); + } + + void BibView::dispose() + { BibGeneralPage* pGeneralPage = m_pGeneralPage; m_pGeneralPage = NULL; @@ -97,6 +102,7 @@ namespace bib pGeneralPage->RemoveListeners(); m_xGeneralPage = NULL; + BibWindow::dispose(); } void BibView::UpdatePages() diff --git a/extensions/source/bibliography/bibview.hxx b/extensions/source/bibliography/bibview.hxx index add53d7c2bbe..6ab966dee1c4 100644 --- a/extensions/source/bibliography/bibview.hxx +++ b/extensions/source/bibliography/bibview.hxx @@ -61,6 +61,7 @@ namespace bib public: BibView( vcl::Window* _pParent, BibDataManager* _pDatMan, WinBits nStyle = WB_3DLOOK ); virtual ~BibView(); + virtual void dispose() SAL_OVERRIDE; void UpdatePages(); diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 3829d4fa279c..e63300c5515d 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -364,12 +364,18 @@ BibGeneralPage::BibGeneralPage(vcl::Window* pParent, BibDataManager* pMan): BibGeneralPage::~BibGeneralPage() { + dispose(); +} + +void BibGeneralPage::dispose() +{ if (pDatMan && xPosListener.is()) { uno::Reference< sdbc::XRowSet > xRowSet(pDatMan->getForm(), UNO_QUERY); if(xRowSet.is()) xRowSet->removeRowSetListener(xPosListener); } + BibTabPage::dispose(); } void BibGeneralPage::RemoveListeners() diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx index 9e96c3343f7b..106f7f3416b2 100644 --- a/extensions/source/bibliography/general.hxx +++ b/extensions/source/bibliography/general.hxx @@ -131,6 +131,7 @@ protected: public: BibGeneralPage(vcl::Window* pParent, BibDataManager* pDatMan); virtual ~BibGeneralPage(); + virtual void dispose() SAL_OVERRIDE; inline const OUString& GetErrorString() const; diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index 66ed1ca4bea9..771cbdcff1d5 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -179,10 +179,10 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle): ToolBox(pParent,BibResId(RID_BIB_TOOLBAR)), aImgLst(BibResId( RID_TOOLBAR_IMGLIST )), aBigImgLst(BibResId( RID_TOOLBAR_BIGIMGLIST )), - aFtSource(this,WB_VCENTER), - aLBSource(this,WB_DROPDOWN), - aFtQuery(this,WB_VCENTER), - aEdQuery(this), + aFtSource(new FixedText(this,WB_VCENTER)), + aLBSource(new ListBox(this,WB_DROPDOWN)), + aFtQuery(new FixedText(this,WB_VCENTER)), + aEdQuery(new Edit(this)), nMenuId(0), nSelMenuItem(0), aLayoutManager( aLink ), @@ -198,10 +198,10 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle): SetOutStyle(TOOLBOX_STYLE_FLAT); Size a2Size(GetOutputSizePixel()); a2Size.Width()=100; - aLBSource.SetSizePixel(a2Size); - aLBSource.SetDropDownLineCount(9); - aLBSource.Show(); - aLBSource.SetSelectHdl(LINK( this, BibToolBar, SelHdl)); + aLBSource->SetSizePixel(a2Size); + aLBSource->SetDropDownLineCount(9); + aLBSource->Show(); + aLBSource->SetSelectHdl(LINK( this, BibToolBar, SelHdl)); SvtMiscOptions().AddListenerLink( LINK( this, BibToolBar, OptionsChanged_Impl ) ); Application::AddEventListener( LINK( this, BibToolBar, SettingsChanged_Impl ) ); @@ -211,32 +211,42 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle): SetDropdownClickHdl( LINK( this, BibToolBar, MenuHdl)); - aEdQuery.SetSizePixel(aLBSource.GetSizePixel()); - aEdQuery.Show(); + aEdQuery->SetSizePixel(aLBSource->GetSizePixel()); + aEdQuery->Show(); OUString aStr=GetItemText(TBC_FT_SOURCE); - aFtSource.SetText(aStr); - aFtSource.SetSizePixel(aFtSource.get_preferred_size()); - aFtSource.SetBackground(Wallpaper( COL_TRANSPARENT )); + aFtSource->SetText(aStr); + aFtSource->SetSizePixel(aFtSource->get_preferred_size()); + aFtSource->SetBackground(Wallpaper( COL_TRANSPARENT )); aStr=GetItemText(TBC_FT_QUERY); - aFtQuery.SetText(aStr); - aFtQuery.SetSizePixel(aFtQuery.get_preferred_size()); - aFtQuery.SetBackground(Wallpaper( COL_TRANSPARENT )); + aFtQuery->SetText(aStr); + aFtQuery->SetSizePixel(aFtQuery->get_preferred_size()); + aFtQuery->SetBackground(Wallpaper( COL_TRANSPARENT )); - SetItemWindow(TBC_FT_SOURCE,&aFtSource); - SetItemWindow(TBC_LB_SOURCE,&aLBSource); - SetItemWindow(TBC_FT_QUERY ,&aFtQuery); - SetItemWindow(TBC_ED_QUERY ,&aEdQuery); + SetItemWindow(TBC_FT_SOURCE, aFtSource.get()); + SetItemWindow(TBC_LB_SOURCE, aLBSource.get()); + SetItemWindow(TBC_FT_QUERY , aFtQuery.get()); + SetItemWindow(TBC_ED_QUERY , aEdQuery.get()); ::bib::AddToTaskPaneList( this ); } BibToolBar::~BibToolBar() { + dispose(); +} + +void BibToolBar::dispose() +{ SvtMiscOptions().RemoveListenerLink( LINK( this, BibToolBar, OptionsChanged_Impl ) ); Application::RemoveEventListener( LINK( this, BibToolBar, SettingsChanged_Impl ) ); ::bib::RemoveFromTaskPaneList( this ); + aFtSource.disposeAndClear(); + aFtQuery.disposeAndClear(); + aEdQuery.disposeAndClear(); + aLBSource.disposeAndClear(); + ToolBox::dispose(); } void BibToolBar::InitListener() @@ -308,7 +318,7 @@ void BibToolBar::Select() Sequence<PropertyValue> aPropVal(2); PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray()); pPropertyVal[0].Name="QueryText"; - OUString aSelection = aEdQuery.GetText(); + OUString aSelection = aEdQuery->GetText(); pPropertyVal[0].Value <<= aSelection; pPropertyVal[1].Name="QueryField"; @@ -386,39 +396,39 @@ void BibToolBar::SelectFilterItem(sal_uInt16 nId) void BibToolBar::EnableSourceList(bool bFlag) { - aFtSource.Enable(bFlag); - aLBSource.Enable(bFlag); + aFtSource->Enable(bFlag); + aLBSource->Enable(bFlag); } void BibToolBar::ClearSourceList() { - aLBSource.Clear(); + aLBSource->Clear(); } void BibToolBar::UpdateSourceList(bool bFlag) { - aLBSource.SetUpdateMode(bFlag); + aLBSource->SetUpdateMode(bFlag); } void BibToolBar::InsertSourceEntry(const OUString& aEntry, sal_Int32 nPos) { - aLBSource.InsertEntry(aEntry, nPos); + aLBSource->InsertEntry(aEntry, nPos); } void BibToolBar::SelectSourceEntry(const OUString& aStr) { - aLBSource.SelectEntry(aStr); + aLBSource->SelectEntry(aStr); } void BibToolBar::EnableQuery(bool bFlag) { - aFtQuery.Enable(bFlag); - aEdQuery.Enable(bFlag); + aFtQuery->Enable(bFlag); + aEdQuery->Enable(bFlag); } void BibToolBar::SetQueryString(const OUString& aStr) { - aEdQuery.SetText(aStr); + aEdQuery->SetText(aStr); } @@ -427,7 +437,7 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt ) bool nResult = true; MouseNotifyEvent nSwitch=rNEvt.GetType(); - if(aEdQuery.HasFocus() && nSwitch==MouseNotifyEvent::KEYINPUT) + if(aEdQuery->HasFocus() && nSwitch==MouseNotifyEvent::KEYINPUT) { const vcl::KeyCode& aKeyCode=rNEvt.GetKeyEvent()->GetKeyCode(); sal_uInt16 nKey = aKeyCode.GetCode(); @@ -436,7 +446,7 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt ) Sequence<PropertyValue> aPropVal(2); PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray()); pPropertyVal[0].Name = "QueryText"; - OUString aSelection = aEdQuery.GetText(); + OUString aSelection = aEdQuery->GetText(); pPropertyVal[0].Value <<= aSelection; pPropertyVal[1].Name="QueryField"; pPropertyVal[1].Value <<= aQueryField; @@ -462,7 +472,7 @@ IMPL_LINK( BibToolBar, SendSelHdl, Timer*,/*pT*/) Sequence<PropertyValue> aPropVal(1); PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray()); pPropertyVal[0].Name = "DataSourceName"; - OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource.GetSelectEntry() ) ); + OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource->GetSelectEntry() ) ); OUString aSelection = aEntry; pPropertyVal[0].Value <<= aSelection; SendDispatch(TBC_LB_SOURCE,aPropVal); @@ -490,7 +500,7 @@ IMPL_LINK( BibToolBar, MenuHdl, ToolBox*, /*pToolbox*/) Sequence<PropertyValue> aPropVal(2); PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray()); pPropertyVal[0].Name = "QueryText"; - OUString aSelection = aEdQuery.GetText(); + OUString aSelection = aEdQuery->GetText(); pPropertyVal[0].Value <<= aSelection; pPropertyVal[1].Name="QueryField"; pPropertyVal[1].Value <<= aQueryField; diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx index 177fc0b195df..09e3074afe69 100644 --- a/extensions/source/bibliography/toolbar.hxx +++ b/extensions/source/bibliography/toolbar.hxx @@ -109,20 +109,20 @@ class BibToolBar: public ToolBox private: BibToolBarListenerArr aListenerArr; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xController; + css::uno::Reference< css::frame::XController > xController; Idle aIdle; ImageList aImgLst; ImageList aImgLstHC; ImageList aBigImgLst; ImageList aBigImgLstHC; - FixedText aFtSource; - ListBox aLBSource; - FixedText aFtQuery; - Edit aEdQuery; + VclPtr<FixedText> aFtSource; + VclPtr<ListBox> aLBSource; + VclPtr<FixedText> aFtQuery; + VclPtr<Edit> aEdQuery; PopupMenu aPopupMenu; sal_uInt16 nMenuId; sal_uInt16 nSelMenuItem; - OUString aQueryField; + OUString aQueryField; Link aLayoutManager; sal_Int16 nSymbolsSize; sal_Int16 nOutStyle; @@ -150,6 +150,7 @@ class BibToolBar: public ToolBox BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle = WB_3DLOOK ); virtual ~BibToolBar(); + virtual void dispose() SAL_OVERRIDE; void SetXController(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > &); diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index bd0b335f6af7..069a406c1f52 100644 --- a/extensions/source/propctrlr/browserline.cxx +++ b/extensions/source/propctrlr/browserline.cxx @@ -55,7 +55,7 @@ namespace pcr OBrowserLine::OBrowserLine( const OUString& _rEntryName, vcl::Window* pParent ) :m_sEntryName( _rEntryName ) - ,m_aFtTitle(pParent) + ,m_aFtTitle(new FixedText(pParent)) ,m_pControlWindow( NULL ) ,m_pBrowseButton(NULL) ,m_pAdditionalBrowseButton( NULL ) @@ -66,7 +66,7 @@ namespace pcr ,m_bIndentTitle( false ) ,m_bReadOnly( false ) { - m_aFtTitle.Show(); + m_aFtTitle->Show(); } @@ -123,7 +123,7 @@ namespace pcr vcl::Window* OBrowserLine::GetRefWindow() { - vcl::Window* pRefWindow=&m_aFtTitle; + vcl::Window* pRefWindow = m_aFtTitle.get(); if(m_pBrowseButton) { @@ -139,7 +139,7 @@ namespace pcr void OBrowserLine::SetTabOrder(vcl::Window* pRefWindow, sal_uInt16 nFlags ) { - m_aFtTitle.SetZOrder(pRefWindow,nFlags); + m_aFtTitle->SetZOrder(pRefWindow,nFlags); if ( m_pControlWindow ) m_pControlWindow->SetZOrder( (vcl::Window*)&m_aFtTitle, WINDOW_ZORDER_BEHIND ); @@ -185,7 +185,7 @@ namespace pcr void OBrowserLine::Show(bool bFlag) { - m_aFtTitle.Show(bFlag); + m_aFtTitle->Show(bFlag); if ( m_pControlWindow ) m_pControlWindow->Show( bFlag ); if ( m_pBrowseButton ) @@ -203,7 +203,7 @@ namespace pcr bool OBrowserLine::IsVisible() { - return m_aFtTitle.IsVisible(); + return m_aFtTitle->IsVisible(); } @@ -219,7 +219,7 @@ namespace pcr aTitlePos.X() += aIndent.Width(); aTitleSize.Width() -= aIndent.Width(); } - m_aFtTitle.SetPosSizePixel( aTitlePos, aTitleSize ); + m_aFtTitle->SetPosSizePixel( aTitlePos, aTitleSize ); } sal_Int32 nBrowseButtonSize = m_aOutputSize.Height() - 4; @@ -255,7 +255,7 @@ namespace pcr if ( GetTitle() == _rNewTtile ) return; // #99102# -------------- - m_aFtTitle.SetText( _rNewTtile ); + m_aFtTitle->SetText( _rNewTtile ); if ( m_pControlWindow ) m_pControlWindow->SetAccessibleName( _rNewTtile ); if ( m_pBrowseButton ) @@ -268,7 +268,7 @@ namespace pcr { if( m_pTheParent ) { - OUStringBuffer aText( m_aFtTitle.GetText() ); + OUStringBuffer aText( m_aFtTitle->GetText() ); while( m_pTheParent->GetTextWidth( aText.toString() ) < m_nNameWidth ) aText.append("..........."); @@ -280,14 +280,14 @@ namespace pcr aText.append( OUString(cRTL_mark) ); } - m_aFtTitle.SetText( aText.makeStringAndClear() ); + m_aFtTitle->SetText( aText.makeStringAndClear() ); } } OUString OBrowserLine::GetTitle() const { - OUString sDisplayName = m_aFtTitle.GetText(); + OUString sDisplayName = m_aFtTitle->GetText(); // for Issue 69452 if (AllSettings::GetLayoutRTL()) @@ -341,7 +341,7 @@ namespace pcr void OBrowserLine::implUpdateEnabledDisabled() { - implEnable( &m_aFtTitle, m_nEnableFlags, PropertyLineElement::CompleteLine ); + implEnable( m_aFtTitle.get(), m_nEnableFlags, PropertyLineElement::CompleteLine ); if ( m_pControlWindow ) implEnable( m_pControlWindow, m_nEnableFlags, PropertyLineElement::CompleteLine | PropertyLineElement::InputControl ); diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx index cdc91c712fd0..ff16ae9f549f 100644 --- a/extensions/source/propctrlr/browserline.hxx +++ b/extensions/source/propctrlr/browserline.hxx @@ -50,17 +50,17 @@ namespace pcr class OBrowserLine { private: - OUString m_sEntryName; - FixedText m_aFtTitle; + OUString m_sEntryName; + VclPtr<FixedText> m_aFtTitle; Size m_aOutputSize; Point m_aLinePos; ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > m_xControl; - vcl::Window* m_pControlWindow; + vcl::Window* m_pControlWindow; PushButton* m_pBrowseButton; PushButton* m_pAdditionalBrowseButton; IButtonClickListener* m_pClickListener; - vcl::Window* m_pTheParent; + vcl::Window* m_pTheParent; sal_uInt16 m_nNameWidth; sal_uInt16 m_nEnableFlags; bool m_bIndentTitle; diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index 568a4cb6ee1d..6bb08b040b74 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -345,8 +345,8 @@ namespace pcr OBrowserListBox::OBrowserListBox( vcl::Window* pParent, WinBits nWinStyle) :Control(pParent, nWinStyle| WB_CLIPCHILDREN) - ,m_aLinesPlayground(this,WB_DIALOGCONTROL | WB_CLIPCHILDREN) - ,m_aVScroll(this,WB_VSCROLL|WB_REPEAT|WB_DRAG) + ,m_aLinesPlayground(new vcl::Window(this,WB_DIALOGCONTROL | WB_CLIPCHILDREN)) + ,m_aVScroll(new ScrollBar(this,WB_VSCROLL|WB_REPEAT|WB_DRAG)) ,m_pHelpWindow( new InspectorHelpWindow( this ) ) ,m_pLineListener(NULL) ,m_pControlObserver( NULL ) @@ -362,18 +362,23 @@ namespace pcr aListBox.SetPosSizePixel(Point(0,0),Size(100,100)); m_nRowHeight = aListBox.GetSizePixel().Height()+2; SetBackground( pParent->GetBackground() ); - m_aLinesPlayground.SetBackground( GetBackground() ); + m_aLinesPlayground->SetBackground( GetBackground() ); - m_aLinesPlayground.SetPosPixel(Point(0,0)); - m_aLinesPlayground.SetPaintTransparent(true); - m_aLinesPlayground.Show(); - m_aVScroll.Hide(); - m_aVScroll.SetScrollHdl(LINK(this, OBrowserListBox, ScrollHdl)); + m_aLinesPlayground->SetPosPixel(Point(0,0)); + m_aLinesPlayground->SetPaintTransparent(true); + m_aLinesPlayground->Show(); + m_aVScroll->Hide(); + m_aVScroll->SetScrollHdl(LINK(this, OBrowserListBox, ScrollHdl)); } OBrowserListBox::~OBrowserListBox() { + dispose(); + } + + void OBrowserListBox::dispose() + { OSL_ENSURE( !IsModified(), "OBrowserListBox::~OBrowserListBox: still modified - should have been committed before!" ); // doing the commit here, while we, as well as our owner, as well as some other components, // are already "half dead" (means within their dtor) is potentially dangerous. @@ -384,7 +389,9 @@ namespace pcr Hide(); Clear(); - + m_aLinesPlayground.disposeAndClear(); + m_aVScroll.disposeAndClear(); + Control::dispose(); } @@ -425,7 +432,7 @@ namespace pcr if (m_bIsActive) { // TODO: what's the sense of this? - m_aVScroll.SetThumbPos(100); + m_aVScroll->SetThumbPos(100); MoveThumbTo(0); Resize(); } @@ -452,31 +459,31 @@ namespace pcr aLinesArea.Bottom() -= nHelpWindowHeight; aLinesArea.Bottom() -= aHelpWindowDistance.Height(); } - m_aLinesPlayground.SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() ); + m_aLinesPlayground->SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() ); UpdateVScroll(); bool bNeedScrollbar = m_aLines.size() > (sal_uInt32)CalcVisibleLines(); if ( !bNeedScrollbar ) { - if ( m_aVScroll.IsVisible() ) - m_aVScroll.Hide(); + if ( m_aVScroll->IsVisible() ) + m_aVScroll->Hide(); // scroll to top m_nYOffset = 0; - m_aVScroll.SetThumbPos( 0 ); + m_aVScroll->SetThumbPos( 0 ); } else { - Size aVScrollSize( m_aVScroll.GetSizePixel() ); + Size aVScrollSize( m_aVScroll->GetSizePixel() ); // adjust the playground's width aLinesArea.Right() -= aVScrollSize.Width(); - m_aLinesPlayground.SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() ); + m_aLinesPlayground->SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() ); // position the scrollbar aVScrollSize.Height() = aLinesArea.GetHeight(); Point aVScrollPos( aLinesArea.GetWidth(), 0 ); - m_aVScroll.SetPosSizePixel( aVScrollPos, aVScrollSize ); + m_aVScroll->SetPosSizePixel( aVScrollPos, aVScrollSize ); } for ( sal_uInt16 i = 0; i < m_aLines.size(); ++i ) @@ -489,7 +496,7 @@ namespace pcr // show the scrollbar if ( bNeedScrollbar ) - m_aVScroll.Show(); + m_aVScroll->Show(); // position the help window if ( bPositionHelpWindow ) @@ -543,7 +550,7 @@ namespace pcr sal_uInt16 OBrowserListBox::CalcVisibleLines() { - Size aSize(m_aLinesPlayground.GetOutputSizePixel()); + Size aSize(m_aLinesPlayground->GetOutputSizePixel()); sal_uInt16 nResult = 0; if (0 != m_nRowHeight) nResult = (sal_uInt16) aSize.Height()/m_nRowHeight; @@ -555,18 +562,18 @@ namespace pcr void OBrowserListBox::UpdateVScroll() { sal_uInt16 nLines = CalcVisibleLines(); - m_aVScroll.SetPageSize(nLines-1); - m_aVScroll.SetVisibleSize(nLines-1); + m_aVScroll->SetPageSize(nLines-1); + m_aVScroll->SetVisibleSize(nLines-1); size_t nCount = m_aLines.size(); if (nCount>0) { - m_aVScroll.SetRange(Range(0,nCount-1)); - m_nYOffset = -m_aVScroll.GetThumbPos()*m_nRowHeight; + m_aVScroll->SetRange(Range(0,nCount-1)); + m_nYOffset = -m_aVScroll->GetThumbPos()*m_nRowHeight; } else { - m_aVScroll.SetRange(Range(0,0)); + m_aVScroll->SetRange(Range(0,0)); m_nYOffset = 0; } } @@ -574,7 +581,7 @@ namespace pcr void OBrowserListBox::PositionLine( sal_uInt16 _nIndex ) { - Size aSize(m_aLinesPlayground.GetOutputSizePixel()); + Size aSize(m_aLinesPlayground->GetOutputSizePixel()); Point aPos(0, m_nYOffset); aSize.Height() = m_nRowHeight; @@ -612,7 +619,7 @@ namespace pcr void OBrowserListBox::UpdatePlayGround() { - sal_Int32 nThumbPos = m_aVScroll.GetThumbPos(); + sal_Int32 nThumbPos = m_aVScroll->GetThumbPos(); sal_Int32 nLines = CalcVisibleLines(); sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + nLines); @@ -729,7 +736,7 @@ namespace pcr sal_uInt16 OBrowserListBox::InsertEntry(const OLineDescriptor& _rPropertyData, sal_uInt16 _nPos) { // create a new line - BrowserLinePointer pBrowserLine( new OBrowserLine( _rPropertyData.sName, &m_aLinesPlayground ) ); + BrowserLinePointer pBrowserLine( new OBrowserLine( _rPropertyData.sName, m_aLinesPlayground.get() ) ); // check that the name is unique ListBoxLines::iterator it = m_aLines.begin(); @@ -794,7 +801,7 @@ namespace pcr { if ( _nPos < m_aLines.size() ) { - sal_Int32 nThumbPos = m_aVScroll.GetThumbPos(); + sal_Int32 nThumbPos = m_aVScroll->GetThumbPos(); if (_nPos < nThumbPos) MoveThumbTo(_nPos); @@ -812,19 +819,19 @@ namespace pcr void OBrowserListBox::MoveThumbTo(sal_Int32 _nNewThumbPos) { // disable painting to prevent flicker - m_aLinesPlayground.EnablePaint(false); + m_aLinesPlayground->EnablePaint(false); - sal_Int32 nDelta = _nNewThumbPos - m_aVScroll.GetThumbPos(); + sal_Int32 nDelta = _nNewThumbPos - m_aVScroll->GetThumbPos(); // adjust the scrollbar - m_aVScroll.SetThumbPos(_nNewThumbPos); + m_aVScroll->SetThumbPos(_nNewThumbPos); sal_Int32 nThumbPos = _nNewThumbPos; - m_nYOffset = -m_aVScroll.GetThumbPos() * m_nRowHeight; + m_nYOffset = -m_aVScroll->GetThumbPos() * m_nRowHeight; sal_Int32 nLines = CalcVisibleLines(); sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + nLines); - m_aLinesPlayground.Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN); + m_aLinesPlayground->Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN); if (1 == nDelta) { @@ -841,27 +848,27 @@ namespace pcr UpdatePlayGround(); } - m_aLinesPlayground.EnablePaint(true); - m_aLinesPlayground.Invalidate(INVALIDATE_CHILDREN); + m_aLinesPlayground->EnablePaint(true); + m_aLinesPlayground->Invalidate(INVALIDATE_CHILDREN); } IMPL_LINK(OBrowserListBox, ScrollHdl, ScrollBar*, _pScrollBar ) { - DBG_ASSERT(_pScrollBar == &m_aVScroll, "OBrowserListBox::ScrollHdl: where does this come from?"); + DBG_ASSERT(_pScrollBar == m_aVScroll.get(), "OBrowserListBox::ScrollHdl: where does this come from?"); (void)_pScrollBar; // disable painting to prevent flicker - m_aLinesPlayground.EnablePaint(false); + m_aLinesPlayground->EnablePaint(false); - sal_Int32 nThumbPos = m_aVScroll.GetThumbPos(); + sal_Int32 nThumbPos = m_aVScroll->GetThumbPos(); - sal_Int32 nDelta = m_aVScroll.GetDelta(); + sal_Int32 nDelta = m_aVScroll->GetDelta(); m_nYOffset = -nThumbPos * m_nRowHeight; sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + CalcVisibleLines()); - m_aLinesPlayground.Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN); + m_aLinesPlayground->Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN); if (1 == nDelta) { @@ -872,12 +879,12 @@ namespace pcr { PositionLine((sal_uInt16)nThumbPos); } - else if (nDelta!=0 || m_aVScroll.GetType() == SCROLL_DONTKNOW) + else if (nDelta!=0 || m_aVScroll->GetType() == SCROLL_DONTKNOW) { UpdatePlayGround(); } - m_aLinesPlayground.EnablePaint(true); + m_aLinesPlayground->EnablePaint(true); return 0; } @@ -1129,7 +1136,7 @@ namespace pcr rLine.pLine->SetTitle(_rPropertyData.DisplayName); rLine.xHandler = _rPropertyData.xPropertyHandler; - sal_uInt16 nTextWidth = (sal_uInt16)m_aLinesPlayground.GetTextWidth(_rPropertyData.DisplayName); + sal_uInt16 nTextWidth = (sal_uInt16)m_aLinesPlayground->GetTextWidth(_rPropertyData.DisplayName); if (m_nTheNameSize< nTextWidth) m_nTheNameSize = nTextWidth; @@ -1216,21 +1223,21 @@ namespace pcr break; long nScrollOffset = 0; - if ( m_aVScroll.IsVisible() ) + if ( m_aVScroll->IsVisible() ) { if ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEUP ) - nScrollOffset = -m_aVScroll.GetPageSize(); + nScrollOffset = -m_aVScroll->GetPageSize(); else if ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEDOWN ) - nScrollOffset = m_aVScroll.GetPageSize(); + nScrollOffset = m_aVScroll->GetPageSize(); } if ( nScrollOffset ) { - long nNewThumbPos = m_aVScroll.GetThumbPos() + nScrollOffset; - nNewThumbPos = ::std::max( nNewThumbPos, m_aVScroll.GetRangeMin() ); - nNewThumbPos = ::std::min( nNewThumbPos, m_aVScroll.GetRangeMax() ); - m_aVScroll.DoScroll( nNewThumbPos ); - nNewThumbPos = m_aVScroll.GetThumbPos(); + long nNewThumbPos = m_aVScroll->GetThumbPos() + nScrollOffset; + nNewThumbPos = ::std::max( nNewThumbPos, m_aVScroll->GetRangeMin() ); + nNewThumbPos = ::std::min( nNewThumbPos, m_aVScroll->GetRangeMax() ); + m_aVScroll->DoScroll( nNewThumbPos ); + nNewThumbPos = m_aVScroll->GetThumbPos(); sal_uInt16 nFocusControlPos = 0; sal_uInt16 nActiveControlPos = impl_getControlPos( m_xActiveControl ); @@ -1271,9 +1278,9 @@ namespace pcr ) { // interested in scroll events if we have a scrollbar - if ( m_aVScroll.IsVisible() ) + if ( m_aVScroll->IsVisible() ) { - HandleScrollCommand( *pCommand, NULL, &m_aVScroll ); + HandleScrollCommand( *pCommand, NULL, m_aVScroll.get() ); } } } diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx index 839c8b5538aa..a1ea45939fe6 100644 --- a/extensions/source/propctrlr/browserlistbox.hxx +++ b/extensions/source/propctrlr/browserlistbox.hxx @@ -93,8 +93,8 @@ namespace pcr ,public PcrClient { protected: - Window m_aLinesPlayground; - ScrollBar m_aVScroll; + VclPtr<Window> m_aLinesPlayground; + VclPtr<ScrollBar> m_aVScroll; ::std::unique_ptr< InspectorHelpWindow > m_pHelpWindow; ListBoxLines m_aLines; @@ -125,6 +125,7 @@ namespace pcr OBrowserListBox( vcl::Window* pParent, WinBits nWinStyle = WB_DIALOGCONTROL ); virtual ~OBrowserListBox(); + virtual void dispose() SAL_OVERRIDE; void UpdateAll(); diff --git a/extensions/source/propctrlr/browserpage.cxx b/extensions/source/propctrlr/browserpage.cxx index 2e733a9ed727..2dc6ef62a9dd 100644 --- a/extensions/source/propctrlr/browserpage.cxx +++ b/extensions/source/propctrlr/browserpage.cxx @@ -35,25 +35,31 @@ namespace pcr OBrowserPage::OBrowserPage(vcl::Window* pParent,WinBits nWinStyle) :TabPage(pParent,nWinStyle) - ,m_aListBox(this) + ,m_aListBox(new OBrowserListBox(this)) { - m_aListBox.SetBackground(GetBackground()); - m_aListBox.SetPaintTransparent( true ); - m_aListBox.Show(); + m_aListBox->SetBackground(GetBackground()); + m_aListBox->SetPaintTransparent( true ); + m_aListBox->Show(); } OBrowserPage::~OBrowserPage() { + dispose(); } + void OBrowserPage::dispose() + { + m_aListBox.disposeAndClear(); + TabPage::dispose(); + } void OBrowserPage::Resize() { Size aSize( GetOutputSizePixel() ); aSize.Width() -= LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT; aSize.Height() -= LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM; - m_aListBox.SetPosSizePixel( Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ), aSize ); + m_aListBox->SetPosSizePixel( Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ), aSize ); } @@ -65,19 +71,19 @@ namespace pcr { Window::StateChanged( nType); if (StateChangedType::VISIBLE == nType) - m_aListBox.ActivateListBox(IsVisible()); + m_aListBox->ActivateListBox(IsVisible()); } sal_Int32 OBrowserPage::getMinimumWidth() { - return m_aListBox.GetMinimumWidth() + LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT; + return m_aListBox->GetMinimumWidth() + LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT; } sal_Int32 OBrowserPage::getMinimumHeight() { - return m_aListBox.GetMinimumHeight() + LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM; + return m_aListBox->GetMinimumHeight() + LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM; } diff --git a/extensions/source/propctrlr/browserpage.hxx b/extensions/source/propctrlr/browserpage.hxx index 6ef6ef80bce9..8ce0b50cd8fe 100644 --- a/extensions/source/propctrlr/browserpage.hxx +++ b/extensions/source/propctrlr/browserpage.hxx @@ -34,7 +34,7 @@ namespace pcr class OBrowserPage : public TabPage { private: - OBrowserListBox m_aListBox; + VclPtr<OBrowserListBox> m_aListBox; protected: virtual void Resize() SAL_OVERRIDE; @@ -43,12 +43,13 @@ namespace pcr public: OBrowserPage(vcl::Window* pParent, WinBits nWinStyle = 0); virtual ~OBrowserPage(); + virtual void dispose() SAL_OVERRIDE; sal_Int32 getMinimumWidth(); sal_Int32 getMinimumHeight(); - OBrowserListBox& getListBox() { return m_aListBox; } - const OBrowserListBox& getListBox() const { return m_aListBox; } + OBrowserListBox& getListBox() { return *m_aListBox.get(); } + const OBrowserListBox& getListBox() const { return *m_aListBox.get(); } }; diff --git a/extensions/source/propctrlr/browserview.cxx b/extensions/source/propctrlr/browserview.cxx index 4179cbe8e3ed..7a39ac9092a7 100644 --- a/extensions/source/propctrlr/browserview.cxx +++ b/extensions/source/propctrlr/browserview.cxx @@ -53,6 +53,11 @@ namespace pcr OPropertyBrowserView::~OPropertyBrowserView() { + dispose(); + } + + void OPropertyBrowserView::dispose() + { if(m_pPropBox) { sal_uInt16 nTmpPage = m_pPropBox->GetCurPage(); @@ -61,7 +66,7 @@ namespace pcr boost::scoped_ptr<vcl::Window> aTemp(m_pPropBox); m_pPropBox = NULL; } - + vcl::Window::dispose(); } diff --git a/extensions/source/propctrlr/browserview.hxx b/extensions/source/propctrlr/browserview.hxx index c87dd55b3c0a..249d87c962c0 100644 --- a/extensions/source/propctrlr/browserview.hxx +++ b/extensions/source/propctrlr/browserview.hxx @@ -50,6 +50,7 @@ namespace pcr OPropertyBrowserView( vcl::Window* pParent, WinBits nBits = 0); virtual ~OPropertyBrowserView(); + virtual void dispose() SAL_OVERRIDE; OPropertyEditor& getPropertyBox() { return *m_pPropBox; } diff --git a/extensions/source/propctrlr/inspectorhelpwindow.cxx b/extensions/source/propctrlr/inspectorhelpwindow.cxx index b62010cf6cd9..822b9e60b3dd 100644 --- a/extensions/source/propctrlr/inspectorhelpwindow.cxx +++ b/extensions/source/propctrlr/inspectorhelpwindow.cxx @@ -29,27 +29,38 @@ namespace pcr InspectorHelpWindow::InspectorHelpWindow( vcl::Window* _pParent ) :Window( _pParent, WB_DIALOGCONTROL ) - ,m_aSeparator( this ) - ,m_aHelpText( this, WB_LEFT | WB_READONLY | WB_AUTOVSCROLL ) + ,m_aSeparator( new FixedLine(this) ) + ,m_aHelpText( new MultiLineEdit(this, WB_LEFT | WB_READONLY | WB_AUTOVSCROLL) ) ,m_nMinLines( 3 ) ,m_nMaxLines( 8 ) { SetBackground(); SetPaintTransparent(true); - m_aSeparator.SetText( PcrRes(RID_STR_HELP_SECTION_LABEL).toString() ); - m_aSeparator.SetBackground(); - m_aSeparator.Show(); - - m_aHelpText.SetControlBackground( /*m_aSeparator.GetBackground().GetColor() */); - m_aHelpText.SetBackground(); - m_aHelpText.SetPaintTransparent(true); - m_aHelpText.Show(); + m_aSeparator->SetText( PcrRes(RID_STR_HELP_SECTION_LABEL).toString() ); + m_aSeparator->SetBackground(); + m_aSeparator->Show(); + + m_aHelpText->SetControlBackground( /*m_aSeparator->GetBackground().GetColor() */); + m_aHelpText->SetBackground(); + m_aHelpText->SetPaintTransparent(true); + m_aHelpText->Show(); } + InspectorHelpWindow::~InspectorHelpWindow() + { + dispose(); + } + + void InspectorHelpWindow::dispose() + { + m_aSeparator.disposeAndClear(); + m_aHelpText.disposeAndClear(); + vcl::Window::dispose(); + } void InspectorHelpWindow::SetText( const OUString& _rStr ) { - m_aHelpText.SetText( _rStr ); + m_aHelpText->SetText( _rStr ); } @@ -63,7 +74,7 @@ namespace pcr long InspectorHelpWindow::impl_getHelpTextBorderHeight() { sal_Int32 nTop(0), nBottom(0), nDummy(0); - m_aHelpText.GetBorder( nDummy, nTop, nDummy, nBottom ); + m_aHelpText->GetBorder( nDummy, nTop, nDummy, nBottom ); return nTop + nBottom; } @@ -84,13 +95,13 @@ namespace pcr long InspectorHelpWindow::impl_getMinimalTextWindowHeight() { - return impl_getHelpTextBorderHeight() + m_aHelpText.GetTextHeight() * m_nMinLines; + return impl_getHelpTextBorderHeight() + m_aHelpText->GetTextHeight() * m_nMinLines; } long InspectorHelpWindow::impl_getMaximalTextWindowHeight() { - return impl_getHelpTextBorderHeight() + m_aHelpText.GetTextHeight() * m_nMaxLines; + return impl_getHelpTextBorderHeight() + m_aHelpText->GetTextHeight() * m_nMaxLines; } @@ -100,8 +111,8 @@ namespace pcr long nMinTextWindowHeight = impl_getMinimalTextWindowHeight(); long nMaxTextWindowHeight = impl_getMaximalTextWindowHeight(); - Rectangle aTextRect( Point( 0, 0 ), m_aHelpText.GetOutputSizePixel() ); - aTextRect = m_aHelpText.GetTextRect( aTextRect, m_aHelpText.GetText(), + Rectangle aTextRect( Point( 0, 0 ), m_aHelpText->GetOutputSizePixel() ); + aTextRect = m_aHelpText->GetTextRect( aTextRect, m_aHelpText->GetText(), TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK ); long nActTextWindowHeight = impl_getHelpTextBorderHeight() + aTextRect.GetHeight(); @@ -120,11 +131,11 @@ namespace pcr Rectangle aSeparatorArea( aPlayground ); aSeparatorArea.Bottom() = aSeparatorArea.Top() + LogicToPixel( Size( 0, 8 ), MAP_APPFONT ).Height(); - m_aSeparator.SetPosSizePixel( aSeparatorArea.TopLeft(), aSeparatorArea.GetSize() ); + m_aSeparator->SetPosSizePixel( aSeparatorArea.TopLeft(), aSeparatorArea.GetSize() ); Rectangle aTextArea( aPlayground ); aTextArea.Top() = aSeparatorArea.Bottom() + a3AppFont.Height(); - m_aHelpText.SetPosSizePixel( aTextArea.TopLeft(), aTextArea.GetSize() ); + m_aHelpText->SetPosSizePixel( aTextArea.TopLeft(), aTextArea.GetSize() ); } diff --git a/extensions/source/propctrlr/inspectorhelpwindow.hxx b/extensions/source/propctrlr/inspectorhelpwindow.hxx index 9419a72ec7a9..0159cff96ca6 100644 --- a/extensions/source/propctrlr/inspectorhelpwindow.hxx +++ b/extensions/source/propctrlr/inspectorhelpwindow.hxx @@ -33,14 +33,16 @@ namespace pcr class InspectorHelpWindow : public vcl::Window { private: - FixedLine m_aSeparator; - MultiLineEdit m_aHelpText; + VclPtr<FixedLine> m_aSeparator; + VclPtr<MultiLineEdit> m_aHelpText; sal_Int32 m_nMinLines; sal_Int32 m_nMaxLines; public: InspectorHelpWindow( vcl::Window* _pParent ); + virtual ~InspectorHelpWindow(); + virtual void dispose() SAL_OVERRIDE; virtual void SetText( const OUString& rStr ) SAL_OVERRIDE; diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx index 4a87e124a567..45a59b2c7275 100644 --- a/extensions/source/propctrlr/propertyeditor.cxx +++ b/extensions/source/propctrlr/propertyeditor.cxx @@ -43,7 +43,7 @@ namespace pcr OPropertyEditor::OPropertyEditor( vcl::Window* pParent, WinBits nWinStyle) :Control(pParent, nWinStyle) - ,m_aTabControl( this ) + ,m_aTabControl( new TabControl(this) ) ,m_pListener(NULL) ,m_pObserver(NULL) ,m_nNextId(1) @@ -52,37 +52,44 @@ namespace pcr ,m_nMaxHelpLines( 0 ) { - m_aTabControl.Show(); - m_aTabControl.SetDeactivatePageHdl(LINK(this, OPropertyEditor, OnPageDeactivate)); - m_aTabControl.SetActivatePageHdl(LINK(this, OPropertyEditor, OnPageActivate)); - m_aTabControl.SetBackground(GetBackground()); - m_aTabControl.SetPaintTransparent(true); + m_aTabControl->Show(); + m_aTabControl->SetDeactivatePageHdl(LINK(this, OPropertyEditor, OnPageDeactivate)); + m_aTabControl->SetActivatePageHdl(LINK(this, OPropertyEditor, OnPageActivate)); + m_aTabControl->SetBackground(GetBackground()); + m_aTabControl->SetPaintTransparent(true); } OPropertyEditor::~OPropertyEditor() { + dispose(); + } + + void OPropertyEditor::dispose() + { Hide(); ClearAll(); + m_aTabControl.disposeAndClear(); + Control::dispose(); } void OPropertyEditor::ClearAll() { m_nNextId=1; - sal_uInt16 nCount = m_aTabControl.GetPageCount(); + sal_uInt16 nCount = m_aTabControl->GetPageCount(); for(long i = nCount-1; i >= 0; --i) { - sal_uInt16 nID = m_aTabControl.GetPageId((sal_uInt16)i); - OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID)); + sal_uInt16 nID = m_aTabControl->GetPageId((sal_uInt16)i); + OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID)); if (pPage) { pPage->EnableInput(false); - m_aTabControl.RemovePage(nID); + m_aTabControl->RemovePage(nID); delete pPage; } } - m_aTabControl.Clear(); + m_aTabControl->Clear(); { MapStringToPageId aEmpty; @@ -101,16 +108,16 @@ namespace pcr { sal_Int32 nMinHeight( LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM ); - if ( m_aTabControl.GetPageCount() > 0 ) + if ( m_aTabControl->GetPageCount() > 0 ) { - sal_uInt16 nFirstID = m_aTabControl.GetPageId( 0 ); + sal_uInt16 nFirstID = m_aTabControl->GetPageId( 0 ); // reserve space for the tabs themself - Rectangle aTabArea( m_aTabControl.GetTabBounds( nFirstID ) ); + Rectangle aTabArea( m_aTabControl->GetTabBounds( nFirstID ) ); nMinHeight += aTabArea.GetHeight(); // ask the page how much it requires - OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nFirstID ) ); + OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nFirstID ) ); if ( pPage ) nMinHeight += pPage->getMinimumHeight(); } @@ -123,12 +130,12 @@ namespace pcr sal_Int32 OPropertyEditor::getMinimumWidth() { - sal_uInt16 nCount = m_aTabControl.GetPageCount(); + sal_uInt16 nCount = m_aTabControl->GetPageCount(); sal_Int32 nPageMinWidth = 0; for(long i = nCount-1; i >= 0; --i) { - sal_uInt16 nID = m_aTabControl.GetPageId((sal_uInt16)i); - OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID)); + sal_uInt16 nID = m_aTabControl->GetPageId((sal_uInt16)i); + OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID)); if (pPage) { sal_Int32 nCurPageMinWidth = pPage->getMinimumWidth(); @@ -144,11 +151,11 @@ namespace pcr { // commit all of my pages, if necessary - sal_uInt16 nCount = m_aTabControl.GetPageCount(); + sal_uInt16 nCount = m_aTabControl->GetPageCount(); for ( sal_uInt16 i=0; i<nCount; ++i ) { - sal_uInt16 nID = m_aTabControl.GetPageId( i ); - OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) ); + sal_uInt16 nID = m_aTabControl->GetPageId( i ); + OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nID ) ); if ( pPage && pPage->getListBox().IsModified() ) pPage->getListBox().CommitModified(); @@ -158,7 +165,7 @@ namespace pcr void OPropertyEditor::GetFocus() { - m_aTabControl.GrabFocus(); + m_aTabControl->GrabFocus(); } @@ -167,7 +174,7 @@ namespace pcr OBrowserPage* pPage = NULL; MapStringToPageId::const_iterator aPropertyPageIdPos = m_aPropertyPageIds.find( _rPropertyName ); if ( aPropertyPageIdPos != m_aPropertyPageIds.end() ) - pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( aPropertyPageIdPos->second ) ); + pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( aPropertyPageIdPos->second ) ); return pPage; } @@ -180,7 +187,7 @@ namespace pcr OBrowserPage* OPropertyEditor::getPage( sal_uInt16& _rPageId ) { - return static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( _rPageId ) ); + return static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( _rPageId ) ); } @@ -201,7 +208,7 @@ namespace pcr ); Rectangle aTabArea( aPlayground ); - m_aTabControl.SetPosSizePixel( aTabArea.TopLeft(), aTabArea.GetSize() ); + m_aTabControl->SetPosSizePixel( aTabArea.TopLeft(), aTabArea.GetSize() ); } @@ -210,13 +217,13 @@ namespace pcr // obtain a new id sal_uInt16 nId = m_nNextId++; // insert the id - m_aTabControl.InsertPage(nId, _rText); + m_aTabControl->InsertPage(nId, _rText); // create a new page - OBrowserPage* pPage = new OBrowserPage(&m_aTabControl); + OBrowserPage* pPage = new OBrowserPage(m_aTabControl.get()); pPage->SetText( _rText ); // some knittings - pPage->SetSizePixel(m_aTabControl.GetTabPageSizePixel()); + pPage->SetSizePixel(m_aTabControl->GetTabPageSizePixel()); pPage->getListBox().SetListener(m_pListener); pPage->getListBox().SetObserver(m_pObserver); pPage->getListBox().EnableHelpSection( m_bHasHelpSection ); @@ -224,8 +231,8 @@ namespace pcr pPage->SetHelpId( _rHelpId ); // immediately activate the page - m_aTabControl.SetTabPage(nId, pPage); - m_aTabControl.SetCurPageId(nId); + m_aTabControl->SetTabPage(nId, pPage); + m_aTabControl->SetCurPageId(nId); return nId; } @@ -234,17 +241,17 @@ namespace pcr void OPropertyEditor::SetHelpId( const OString& rHelpId ) { Control::SetHelpId(""); - m_aTabControl.SetHelpId(rHelpId); + m_aTabControl->SetHelpId(rHelpId); } void OPropertyEditor::RemovePage(sal_uInt16 nID) { - OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID)); + OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID)); if (pPage) pPage->EnableInput(false); - m_aTabControl.RemovePage(nID); + m_aTabControl->RemovePage(nID); if (pPage) delete pPage; } @@ -252,14 +259,14 @@ namespace pcr void OPropertyEditor::SetPage(sal_uInt16 nId) { - m_aTabControl.SetCurPageId(nId); + m_aTabControl->SetCurPageId(nId); } sal_uInt16 OPropertyEditor::GetCurPage() { - if(m_aTabControl.GetPageCount()>0) - return m_aTabControl.GetCurPageId(); + if(m_aTabControl->GetPageCount()>0) + return m_aTabControl->GetCurPageId(); else return 0; } @@ -268,11 +275,11 @@ namespace pcr void OPropertyEditor::Update(const ::std::mem_fun_t<void,OBrowserListBox>& _aUpdateFunction) { // forward this to all our pages - sal_uInt16 nCount = m_aTabControl.GetPageCount(); + sal_uInt16 nCount = m_aTabControl->GetPageCount(); for (sal_uInt16 i=0;i<nCount;++i) { - sal_uInt16 nID = m_aTabControl.GetPageId(i); - OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID)); + sal_uInt16 nID = m_aTabControl->GetPageId(i); + OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID)); if (pPage) _aUpdateFunction(&pPage->getListBox()); } @@ -291,11 +298,11 @@ namespace pcr void OPropertyEditor::forEachPage( PageOperation _pOperation, const void* _pArgument ) { - sal_uInt16 nCount = m_aTabControl.GetPageCount(); + sal_uInt16 nCount = m_aTabControl->GetPageCount(); for ( sal_uInt16 i=0; i<nCount; ++i ) { - sal_uInt16 nID = m_aTabControl.GetPageId(i); - OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) ); + sal_uInt16 nID = m_aTabControl->GetPageId(i); + OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nID ) ); if ( !pPage ) continue; (this->*_pOperation)( *pPage, _pArgument ); @@ -437,13 +444,13 @@ namespace pcr { if ( !_bShow ) { - sal_uInt16 nPagePos = m_aTabControl.GetPagePos( _nPageId ); + sal_uInt16 nPagePos = m_aTabControl->GetPagePos( _nPageId ); if ( TAB_PAGE_NOTFOUND == nPagePos ) return; DBG_ASSERT( m_aHiddenPages.find( _nPageId ) == m_aHiddenPages.end(), "OPropertyEditor::ShowPropertyPage: page already hidden!" ); - m_aHiddenPages[ _nPageId ] = HiddenPage( nPagePos, m_aTabControl.GetTabPage( _nPageId ) ); - m_aTabControl.RemovePage( _nPageId ); + m_aHiddenPages[ _nPageId ] = HiddenPage( nPagePos, m_aTabControl->GetTabPage( _nPageId ) ); + m_aTabControl->RemovePage( _nPageId ); } else { @@ -451,9 +458,9 @@ namespace pcr if ( aPagePos == m_aHiddenPages.end() ) return; - aPagePos->second.pPage->SetSizePixel( m_aTabControl.GetTabPageSizePixel() ); - m_aTabControl.InsertPage( aPagePos->first, aPagePos->second.pPage->GetText(), aPagePos->second.nPos ); - m_aTabControl.SetTabPage( aPagePos->first, aPagePos->second.pPage ); + aPagePos->second.pPage->SetSizePixel( m_aTabControl->GetTabPageSizePixel() ); + m_aTabControl->InsertPage( aPagePos->first, aPagePos->second.pPage->GetText(), aPagePos->second.nPos ); + m_aTabControl->SetTabPage( aPagePos->first, aPagePos->second.pPage ); m_aHiddenPages.erase( aPagePos ); } @@ -462,9 +469,9 @@ namespace pcr void OPropertyEditor::EnablePropertyControls( const OUString& _rEntryName, sal_Int16 _nControls, bool _bEnable ) { - for ( sal_uInt16 i = 0; i < m_aTabControl.GetPageCount(); ++i ) + for ( sal_uInt16 i = 0; i < m_aTabControl->GetPageCount(); ++i ) { - OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( m_aTabControl.GetPageId( i ) ) ); + OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( m_aTabControl->GetPageId( i ) ) ); if ( pPage ) pPage->getListBox().EnablePropertyControls( _rEntryName, _nControls, _bEnable ); } @@ -473,9 +480,9 @@ namespace pcr void OPropertyEditor::EnablePropertyLine( const OUString& _rEntryName, bool _bEnable ) { - for ( sal_uInt16 i = 0; i < m_aTabControl.GetPageCount(); ++i ) + for ( sal_uInt16 i = 0; i < m_aTabControl->GetPageCount(); ++i ) { - OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( m_aTabControl.GetPageId( i ) ) ); + OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( m_aTabControl->GetPageId( i ) ) ); if ( pPage ) pPage->getListBox().EnablePropertyLine( _rEntryName, _bEnable ); } @@ -486,7 +493,7 @@ namespace pcr { Reference< XPropertyControl > xControl; // let the current page handle this - OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(m_aTabControl.GetCurPageId())); + OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(m_aTabControl->GetCurPageId())); if (pPage) xControl = pPage->getListBox().GetPropertyControl(rEntryName); return xControl; @@ -505,8 +512,8 @@ namespace pcr { // commit the data on the current (to-be-decativated) tab page // (79404) - sal_Int32 nCurrentId = m_aTabControl.GetCurPageId(); - OBrowserPage* pCurrentPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage((sal_uInt16)nCurrentId)); + sal_Int32 nCurrentId = m_aTabControl->GetCurPageId(); + OBrowserPage* pCurrentPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage((sal_uInt16)nCurrentId)); if ( !pCurrentPage ) return 1L; diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx index 53e48fd10fbf..72f36441dddb 100644 --- a/extensions/source/propctrlr/propertyeditor.hxx +++ b/extensions/source/propctrlr/propertyeditor.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/inspection/XPropertyControl.hpp> #include <vcl/tabctrl.hxx> +#include <vcl/vclptr.hxx> #include <boost/mem_fn.hpp> #include <map> @@ -54,7 +55,7 @@ namespace pcr }; private: - TabControl m_aTabControl; + VclPtr<TabControl> m_aTabControl; IPropertyLineListener* m_pListener; IPropertyControlObserver* m_pObserver; sal_uInt16 m_nNextId; @@ -74,6 +75,7 @@ namespace pcr OPropertyEditor (vcl::Window* pParent, WinBits nWinStyle = WB_DIALOGCONTROL); virtual ~OPropertyEditor(); + virtual void dispose() SAL_OVERRIDE; void EnableUpdate(); void DisableUpdate(); diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx index 79f37b5602b1..a98910a55f39 100644 --- a/extensions/source/propctrlr/selectlabeldialog.cxx +++ b/extensions/source/propctrlr/selectlabeldialog.cxx @@ -145,6 +145,11 @@ namespace pcr OSelectLabelDialog::~OSelectLabelDialog() { + dispose(); + } + + void OSelectLabelDialog::dispose() + { // delete the entry datas of the listbox entries SvTreeListEntry* pLoop = m_pControlTree->First(); while (pLoop) @@ -154,7 +159,7 @@ namespace pcr delete static_cast<Reference< XPropertySet > *>(pData); pLoop = m_pControlTree->Next(pLoop); } - + ModalDialog::dispose(); } sal_Int32 OSelectLabelDialog::InsertEntries(const Reference< XInterface > & _xContainer, SvTreeListEntry* pContainerEntry) diff --git a/extensions/source/propctrlr/selectlabeldialog.hxx b/extensions/source/propctrlr/selectlabeldialog.hxx index abb138248f97..40073fde83a8 100644 --- a/extensions/source/propctrlr/selectlabeldialog.hxx +++ b/extensions/source/propctrlr/selectlabeldialog.hxx @@ -58,6 +58,7 @@ namespace pcr public: OSelectLabelDialog(vcl::Window* pParent, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _xControlModel); virtual ~OSelectLabelDialog(); + virtual void dispose() SAL_OVERRIDE; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetSelected() const { return m_pNoAssignment->IsChecked() ? ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > () : m_xSelectedControl; } diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index bd923405eadd..c4b452c46cd0 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -959,14 +959,16 @@ namespace pcr class OMultilineFloatingEdit : public FloatingWindow { private: - MultiLineEdit m_aImplEdit; + VclPtr<MultiLineEdit> m_aImplEdit; protected: virtual void Resize() SAL_OVERRIDE; public: OMultilineFloatingEdit(vcl::Window* _pParen); - MultiLineEdit& getEdit() { return m_aImplEdit; } + virtual ~OMultilineFloatingEdit(); + virtual void dispose() SAL_OVERRIDE; + MultiLineEdit& getEdit() { return *m_aImplEdit.get(); } protected: virtual bool PreNotify(NotifyEvent& _rNEvt) SAL_OVERRIDE; @@ -975,15 +977,25 @@ namespace pcr OMultilineFloatingEdit::OMultilineFloatingEdit(vcl::Window* _pParent) :FloatingWindow(_pParent, WB_BORDER) - ,m_aImplEdit(this, WB_VSCROLL|WB_IGNORETAB|WB_NOBORDER) + ,m_aImplEdit(new MultiLineEdit(this, WB_VSCROLL|WB_IGNORETAB|WB_NOBORDER)) { - m_aImplEdit.Show(); + m_aImplEdit->Show(); } + OMultilineFloatingEdit::~OMultilineFloatingEdit() + { + dispose(); + } + + void OMultilineFloatingEdit::dispose() + { + m_aImplEdit.disposeAndClear(); + FloatingWindow::dispose(); + } void OMultilineFloatingEdit::Resize() { - m_aImplEdit.SetSizePixel(GetOutputSizePixel()); + m_aImplEdit->SetSizePixel(GetOutputSizePixel()); } @@ -1060,6 +1072,11 @@ namespace pcr DropDownEditControl::~DropDownEditControl() { + dispose(); + } + + void DropDownEditControl::dispose() + { { boost::scoped_ptr<vcl::Window> aTemp(m_pFloatingEdit); m_pFloatingEdit = NULL; @@ -1069,6 +1086,8 @@ namespace pcr boost::scoped_ptr<vcl::Window> aTemp(m_pDropdownButton); m_pDropdownButton = NULL; } + m_pImplEdit.disposeAndClear(); + DropDownEditControl_Base::dispose(); } diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx index 17865f84888a..cf8c473ad8f5 100644 --- a/extensions/source/propctrlr/standardcontrol.hxx +++ b/extensions/source/propctrlr/standardcontrol.hxx @@ -383,6 +383,7 @@ namespace pcr public: DropDownEditControl( vcl::Window* _pParent, WinBits _nStyle ); virtual ~DropDownEditControl(); + virtual void dispose() SAL_OVERRIDE; void setOperationMode( MultiLineOperationMode _eMode ) { m_nOperationMode = _eMode; } MultiLineOperationMode getOperationMode() const { return m_nOperationMode; } diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx index 24fb70112512..64b7e107900d 100644 --- a/extensions/source/propctrlr/taborder.cxx +++ b/extensions/source/propctrlr/taborder.cxx @@ -118,10 +118,15 @@ namespace pcr TabOrderDialog::~TabOrderDialog() { + dispose(); + } + + void TabOrderDialog::dispose() + { m_pLB_Controls->Hide(); // delete pLB_Controls; delete pImageList; - + ModalDialog::dispose(); } diff --git a/extensions/source/propctrlr/taborder.hxx b/extensions/source/propctrlr/taborder.hxx index d70e60cce47f..3685b9cda2e0 100644 --- a/extensions/source/propctrlr/taborder.hxx +++ b/extensions/source/propctrlr/taborder.hxx @@ -102,6 +102,7 @@ namespace pcr ); virtual ~TabOrderDialog(); + virtual void dispose() SAL_OVERRIDE; void SetModified(); }; diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx index 96fb625615c6..faa33e9f0dae 100644 --- a/extensions/source/scanner/grid.cxx +++ b/extensions/source/scanner/grid.cxx @@ -120,6 +120,7 @@ public: GridWindow(vcl::Window* pParent); void Init(double* pXValues, double* pYValues, int nValues, bool bCutValues, const BitmapEx &rMarkerBitmap); virtual ~GridWindow(); + virtual void dispose() SAL_OVERRIDE; void setBoundings( double fMinX, double fMinY, double fMaxX, double fMaxY ); @@ -214,7 +215,13 @@ GridDialog::GridDialog(double* pXValues, double* pYValues, int nValues, vcl::Win GridWindow::~GridWindow() { + dispose(); +} + +void GridWindow::dispose() +{ delete [] m_pNewYValues; + vcl::Window::dispose(); } double GridWindow::findMinX() diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 9a4e50cf5484..2dc49da7b8b0 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -239,7 +239,13 @@ SaneDlg::SaneDlg( vcl::Window* pParent, Sane& rSane, bool bScanEnabled ) : SaneDlg::~SaneDlg() { + dispose(); +} + +void SaneDlg::dispose() +{ mrSane.SetReloadOptionsHdl( maOldLink ); + ModalDialog::dispose(); } namespace { diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx index 57eaa54b0cb3..ac7d664082be 100644 --- a/extensions/source/scanner/sanedlg.hxx +++ b/extensions/source/scanner/sanedlg.hxx @@ -105,6 +105,7 @@ private: public: SaneDlg( vcl::Window*, Sane&, bool ); virtual ~SaneDlg(); + virtual void dispose() SAL_OVERRIDE; virtual short Execute() SAL_OVERRIDE; void UpdateScanArea( bool ); |