From 49480a1e26925fcd6862fea79b24638b243ba21f Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Fri, 15 May 2015 16:49:22 +0900 Subject: refactor TabBarControl to use RenderContext Change-Id: Ie65fb06bfd5111a2d054018fd846f583606689f4 --- sd/source/ui/view/ViewTabBar.cxx | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx index 72b4301d983f..c32b92ff43ae 100644 --- a/sd/source/ui/view/ViewTabBar.cxx +++ b/sd/source/ui/view/ViewTabBar.cxx @@ -57,20 +57,17 @@ namespace sd { namespace { bool IsEqual (const TabBarButton& rButton1, const TabBarButton& rButton2) { - return ( - (rButton1.ResourceId.is() - && rButton2.ResourceId.is() - && rButton1.ResourceId->compareTo(rButton2.ResourceId)==0) + return ((rButton1.ResourceId.is() + && rButton2.ResourceId.is() + && rButton1.ResourceId->compareTo(rButton2.ResourceId) == 0) || rButton1.ButtonLabel == rButton2.ButtonLabel); } class TabBarControl : public ::TabControl { public: - TabBarControl ( - vcl::Window* pParentWindow, - const ::rtl::Reference& rpViewTabBar); - virtual void Paint (vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect) SAL_OVERRIDE; + TabBarControl (vcl::Window* pParentWindow, const ::rtl::Reference& rpViewTabBar); + virtual void Paint (vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE; virtual void ActivatePage() SAL_OVERRIDE; private: ::rtl::Reference mpViewTabBar; @@ -568,20 +565,21 @@ TabBarControl::TabBarControl ( void TabBarControl::Paint (vcl::RenderContext& rRenderContext, const Rectangle& rRect) { - Color aOriginalFillColor (GetFillColor()); - Color aOriginalLineColor (GetLineColor()); + Color aOriginalFillColor(rRenderContext.GetFillColor()); + Color aOriginalLineColor(rRenderContext.GetLineColor()); // Because the actual window background is transparent--to avoid // flickering due to multiple background paintings by this and by child // windows--we have to paint the background for this control explicitly: // the actual control is not painted over its whole bounding box. - SetFillColor (GetSettings().GetStyleSettings().GetDialogColor()); - SetLineColor (); - DrawRect (rRect); + rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetDialogColor()); + rRenderContext.SetLineColor(); + rRenderContext.DrawRect(rRect); + ::TabControl::Paint(rRenderContext, rRect); - SetFillColor (aOriginalFillColor); - SetLineColor (aOriginalLineColor); + rRenderContext.SetFillColor(aOriginalFillColor); + rRenderContext.SetLineColor(aOriginalLineColor); } void TabBarControl::ActivatePage() -- cgit v1.2.3