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/source/bibliography | |
parent | b53f7ee341765a7b052b98a58678df25c299c58a (diff) |
vcl: VclPtr conversion in extensions
Change-Id: Ie10e8fcb2bf413606063d4f1caab17bea1bb4d95
Diffstat (limited to 'extensions/source/bibliography')
-rw-r--r-- | extensions/source/bibliography/bibbeam.cxx | 14 | ||||
-rw-r--r-- | extensions/source/bibliography/bibbeam.hxx | 1 | ||||
-rw-r--r-- | extensions/source/bibliography/bibcont.cxx | 21 | ||||
-rw-r--r-- | extensions/source/bibliography/bibcont.hxx | 6 | ||||
-rw-r--r-- | extensions/source/bibliography/bibshortcuthandler.hxx | 2 | ||||
-rw-r--r-- | extensions/source/bibliography/bibview.cxx | 6 | ||||
-rw-r--r-- | extensions/source/bibliography/bibview.hxx | 1 | ||||
-rw-r--r-- | extensions/source/bibliography/general.cxx | 6 | ||||
-rw-r--r-- | extensions/source/bibliography/general.hxx | 1 | ||||
-rw-r--r-- | extensions/source/bibliography/toolbar.cxx | 78 | ||||
-rw-r--r-- | extensions/source/bibliography/toolbar.hxx | 13 |
11 files changed, 95 insertions, 54 deletions
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 > &); |