diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-11 09:41:13 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-11 10:03:29 +0900 |
commit | 25a0bd7b909fb8c87387d1413060f6c4ba5a51bd (patch) | |
tree | 69d3cdabb9c74ef29dd6e031156e09121e0eba39 /svx/source/dialog/fontlb.cxx | |
parent | 69e233b75a024de60b677f2226d810cb11fe8f94 (diff) |
refactor TreeListBox to use RenderContext
Change-Id: I901a1f1f9732fb66718dca34c698a851e5b0d87f
Diffstat (limited to 'svx/source/dialog/fontlb.cxx')
-rw-r--r-- | svx/source/dialog/fontlb.cxx | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx index d36bc4291d44..6b7d1ada0859 100644 --- a/svx/source/dialog/fontlb.cxx +++ b/svx/source/dialog/fontlb.cxx @@ -37,36 +37,35 @@ SvLBoxFontString::SvLBoxFontString( maFont( rFont ), mbUseColor( pColor != NULL ) { - SetText( rString ); - if( pColor ) - maFont.SetColor( *pColor ); + SetText(rString); + if(pColor) + maFont.SetColor(*pColor); } SvLBoxFontString::~SvLBoxFontString() { } - SvLBoxItem* SvLBoxFontString::Create() const { return new SvLBoxFontString; } -void SvLBoxFontString::Paint( - const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) +void SvLBoxFontString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, + const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) { - vcl::Font aOldFont( rDev.GetFont() ); - vcl::Font aNewFont( maFont ); + rRenderContext.Push(PushFlags::FONT); + vcl::Font aNewFont(maFont); bool bSel = pView->IsSelected(); - if( !mbUseColor || bSel ) // selection always gets highlight color + if (!mbUseColor || bSel) // selection always gets highlight color { - const StyleSettings& rSett = Application::GetSettings().GetStyleSettings(); - aNewFont.SetColor( bSel ? rSett.GetHighlightTextColor() : rSett.GetFieldTextColor() ); + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + aNewFont.SetColor(bSel ? rStyleSettings.GetHighlightTextColor() : rStyleSettings.GetFieldTextColor()); } - rDev.SetFont( aNewFont ); - SvLBoxString::Paint(rPos, rDev, pView, pEntry); - rDev.SetFont( aOldFont ); + rRenderContext.SetFont(aNewFont); + SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, pEntry); + rRenderContext.Pop(); } void SvLBoxFontString::InitViewData( SvTreeListBox* pView, SvTreeListEntry* pEntry, SvViewDataItem* pViewData ) |