From ce8cfbd3b90f11c3f2edc88a0dab625aabb6293d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 12 Jan 2015 15:16:05 +0200 Subject: svtools: apply vcl::window refcounting changes Change-Id: I308f045eaf5c50de26175a2f00f8b0791cdd8ab9 Conflicts: svtools/source/control/tabbar.cxx --- svtools/source/toolpanel/toolpaneldeck.cxx | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'svtools/source/toolpanel/toolpaneldeck.cxx') diff --git a/svtools/source/toolpanel/toolpaneldeck.cxx b/svtools/source/toolpanel/toolpaneldeck.cxx index af00abb8c204..c5a733c5efcd 100644 --- a/svtools/source/toolpanel/toolpaneldeck.cxx +++ b/svtools/source/toolpanel/toolpaneldeck.cxx @@ -30,6 +30,7 @@ #include #include +#include #include @@ -68,15 +69,15 @@ namespace svt public: ToolPanelDeck_Impl( ToolPanelDeck& i_rDeck ) :m_rDeck( i_rDeck ) - ,m_aPanelAnchor( &i_rDeck, WB_DIALOGCONTROL | WB_CHILDDLGCTRL ) + ,m_aPanelAnchor( new vcl::Window(&i_rDeck, WB_DIALOGCONTROL | WB_CHILDDLGCTRL) ) ,m_aPanels() ,m_pDummyPanel( new DummyPanel ) ,m_pLayouter() ,m_bInDtor( false ) { m_aPanels.AddListener( *this ); - m_aPanelAnchor.Show(); - m_aPanelAnchor.SetAccessibleRole( AccessibleRole::PANEL ); + m_aPanelAnchor->Show(); + m_aPanelAnchor->SetAccessibleRole( AccessibleRole::PANEL ); } virtual ~ToolPanelDeck_Impl() @@ -87,7 +88,7 @@ namespace svt PDeckLayouter GetLayouter() const { return m_pLayouter; } void SetLayouter( const PDeckLayouter& i_pNewLayouter ); - vcl::Window& GetPanelWindowAnchor() { return m_aPanelAnchor; } + vcl::Window& GetPanelWindowAnchor() { return *m_aPanelAnchor.get(); } bool IsDead() const { return m_bInDtor; } @@ -130,7 +131,7 @@ namespace svt private: ToolPanelDeck& m_rDeck; - vcl::Window m_aPanelAnchor; + VclPtr m_aPanelAnchor; ToolPanelCollection m_aPanels; PToolPanel m_pDummyPanel; PanelDeckListeners m_aListeners; @@ -210,11 +211,11 @@ namespace svt { aPlaygroundArea = m_pLayouter->Layout( aDeckPlayground ); } - m_aPanelAnchor.SetPosSizePixel( aPlaygroundArea.TopLeft(), aPlaygroundArea.GetSize() ); + m_aPanelAnchor->SetPosSizePixel( aPlaygroundArea.TopLeft(), aPlaygroundArea.GetSize() ); // position the active panel const PToolPanel pActive( GetActiveOrDummyPanel_Impl() ); - pActive->SetSizePixel( m_aPanelAnchor.GetOutputSizePixel() ); + pActive->SetSizePixel( m_aPanelAnchor->GetOutputSizePixel() ); } @@ -261,7 +262,7 @@ namespace svt case ACTION_TOGGLE_FOCUS: { PToolPanel pActivePanel( GetActiveOrDummyPanel_Impl() ); - if ( !m_aPanelAnchor.HasChildPathFocus() ) + if ( !m_aPanelAnchor->HasChildPathFocus() ) pActivePanel->GrabFocus(); else GetLayouter()->SetFocusToPanelSelector(); @@ -313,11 +314,11 @@ namespace svt // position and show the new panel const PToolPanel pNewActive( !i_rNewActive ? m_pDummyPanel : m_aPanels.GetPanel( *i_rNewActive ) ); - pNewActive->Activate( m_aPanelAnchor ); + pNewActive->Activate( *m_aPanelAnchor.get() ); pNewActive->GrabFocus(); // resize the panel (cannot guarantee it has ever been resized before - pNewActive->SetSizePixel( m_aPanelAnchor.GetOutputSizePixel() ); + pNewActive->SetSizePixel( m_aPanelAnchor->GetOutputSizePixel() ); // multiplex to our own listeners m_aListeners.ActivePanelChanged( i_rOldActive, i_rNewActive ); @@ -352,6 +353,11 @@ namespace svt ToolPanelDeck::~ToolPanelDeck() + { + dispose(); + } + + void ToolPanelDeck::dispose() { m_pImpl->NotifyDying(); GetLayouter()->Destroy(); @@ -362,6 +368,7 @@ namespace svt PToolPanel pPanel( GetPanel( i ) ); pPanel->Dispose(); } + Control::dispose(); } -- cgit