diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-15 16:49:22 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-15 17:10:23 +0900 |
commit | 49480a1e26925fcd6862fea79b24638b243ba21f (patch) | |
tree | 3098070b47820ec16ec2ac7fc000eb50c8a77e93 /sd | |
parent | a18d743fbcad62111667b60a61284eff5ca0835a (diff) |
refactor TabBarControl to use RenderContext
Change-Id: Ie65fb06bfd5111a2d054018fd846f583606689f4
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/ViewTabBar.cxx | 28 |
1 files changed, 13 insertions, 15 deletions
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<ViewTabBar>& rpViewTabBar); - virtual void Paint (vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect) SAL_OVERRIDE; + TabBarControl (vcl::Window* pParentWindow, const ::rtl::Reference<ViewTabBar>& rpViewTabBar); + virtual void Paint (vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE; virtual void ActivatePage() SAL_OVERRIDE; private: ::rtl::Reference<ViewTabBar> 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() |