diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-19 13:54:12 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 12:10:43 +0100 |
commit | 820576af4fd6441a752742b43d804e9837839925 (patch) | |
tree | 205b0a04d1bd5063ad3005b9679c1facea2ca2c8 /svtools/source/toolpanel | |
parent | make vclwidget clang plugin find OutputDevice (diff) | |
download | core-820576af4fd6441a752742b43d804e9837839925.tar.gz core-820576af4fd6441a752742b43d804e9837839925.zip |
start wrapping OutputDevice in VclPtr
Change-Id: If3ecbb0599b50d50ce6b3997ca7892200c332ffe
Diffstat (limited to 'svtools/source/toolpanel')
-rw-r--r-- | svtools/source/toolpanel/paneltabbar.cxx | 24 | ||||
-rw-r--r-- | svtools/source/toolpanel/toolpaneldrawer.hxx | 2 |
2 files changed, 13 insertions, 13 deletions
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 1cb90ccf4973..467793a8b61a 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -415,7 +415,7 @@ namespace svt TabAlignment m_eTabAlignment; IToolPanelDeck& m_rPanelDeck; - VirtualDevice m_aRenderDevice; + ScopedVclPtr<VirtualDevice> m_aRenderDevice; PTabBarRenderer m_pRenderer; ::boost::optional< size_t > m_aHoveredItem; @@ -499,7 +499,7 @@ namespace svt ,m_aNormalizer() ,m_eTabAlignment( i_eAlignment ) ,m_rPanelDeck( i_rPanelDeck ) - ,m_aRenderDevice( i_rTabBar ) + ,m_aRenderDevice( new VirtualDevice(i_rTabBar) ) ,m_pRenderer() ,m_aHoveredItem() ,m_aFocusedItem() @@ -511,19 +511,19 @@ namespace svt ,m_nScrollPosition( 0 ) { #ifdef WNT - if ( m_aRenderDevice.IsNativeControlSupported( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL ) ) + if ( m_aRenderDevice->IsNativeControlSupported( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL ) ) // this mode requires the NWF framework to be able to render those items onto a virtual // device. For some frameworks (some GTK themes, in particular), this is known to fail. // So, be on the safe side for the moment. m_pRenderer.reset( new NWFTabItemRenderer( m_aRenderDevice ) ); else #endif - if ( m_aRenderDevice.IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) - m_pRenderer.reset( new NWFToolboxItemRenderer( m_aRenderDevice ) ); + if ( m_aRenderDevice->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) + m_pRenderer.reset( new NWFToolboxItemRenderer( *m_aRenderDevice.get() ) ); else - m_pRenderer.reset( new VCLItemRenderer( m_aRenderDevice ) ); + m_pRenderer.reset( new VCLItemRenderer( *m_aRenderDevice.get() ) ); - m_aRenderDevice.SetLineColor(); + m_aRenderDevice->SetLineColor(); m_rPanelDeck.AddListener( *this ); @@ -710,7 +710,7 @@ namespace svt void PanelTabBar_Impl::CopyFromRenderDevice( const Rectangle& i_rLogicalRect ) const { - BitmapEx aBitmap( m_aRenderDevice.GetBitmapEx( + BitmapEx aBitmap( m_aRenderDevice->GetBitmapEx( i_rLogicalRect.TopLeft(), Size( i_rLogicalRect.GetSize().Width(), @@ -833,7 +833,7 @@ namespace svt const Size aLogicalOutputSize( m_aNormalizer.getReferenceSize() ); // forward actual output size to our render device - m_aRenderDevice.SetOutputSizePixel( aLogicalOutputSize ); + m_aRenderDevice->SetOutputSizePixel( aLogicalOutputSize ); // re-calculate the size of the scroll buttons and of the items m_aGeometry.relayout( aLogicalOutputSize, m_aItems ); @@ -1050,10 +1050,10 @@ namespace svt // background const Rectangle aNormalizedPaintArea( m_pImpl->m_aNormalizer.getNormalized( i_rRect, m_pImpl->m_eTabAlignment ) ); - m_pImpl->m_aRenderDevice.Push( PushFlags::CLIPREGION ); - m_pImpl->m_aRenderDevice.SetClipRegion(vcl::Region(aNormalizedPaintArea)); + m_pImpl->m_aRenderDevice->Push( PushFlags::CLIPREGION ); + m_pImpl->m_aRenderDevice->SetClipRegion(vcl::Region(aNormalizedPaintArea)); m_pImpl->m_pRenderer->renderBackground(); - m_pImpl->m_aRenderDevice.Pop(); + m_pImpl->m_aRenderDevice->Pop(); m_pImpl->CopyFromRenderDevice( aNormalizedPaintArea ); // ensure the items really paint into their own playground only diff --git a/svtools/source/toolpanel/toolpaneldrawer.hxx b/svtools/source/toolpanel/toolpaneldrawer.hxx index 1f66263d0dea..b13a12e34629 100644 --- a/svtools/source/toolpanel/toolpaneldrawer.hxx +++ b/svtools/source/toolpanel/toolpaneldrawer.hxx @@ -97,7 +97,7 @@ namespace svt using Window::Paint; private: - ::std::unique_ptr< VirtualDevice > m_pPaintDevice; + ScopedVclPtr< VirtualDevice > m_pPaintDevice; VclPtr<DrawerVisualization> m_aVisualization; bool m_bFocused; bool m_bExpanded; |