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 /sc/source | |
parent | 69e233b75a024de60b677f2226d810cb11fe8f94 (diff) |
refactor TreeListBox to use RenderContext
Change-Id: I901a1f1f9732fb66718dca34c698a851e5b0d87f
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/miscdlgs/solveroptions.cxx | 32 | ||||
-rw-r--r-- | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 6 |
2 files changed, 20 insertions, 18 deletions
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 447c6a0bd887..0ccd11a05daa 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -72,33 +72,35 @@ public: void SetDoubleValue( double fNew ) { mbIsDouble = true; mfDoubleValue = fNew; } void SetIntValue( sal_Int32 nNew ) { mbIsDouble = false; mnIntValue = nNew; } - virtual void Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, + const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; }; -void ScSolverOptionsString::Paint( const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) +void ScSolverOptionsString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::RenderContext& rRenderContext, + const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) { //! move position? (SvxLinguTabPage: aPos.X() += 20) - OUString aNormalStr( GetText() ); + OUString aNormalStr(GetText()); aNormalStr += ":"; - rDev.DrawText( rPos, aNormalStr ); + rRenderContext.DrawText(rPos, aNormalStr); - Point aNewPos( rPos ); - aNewPos.X() += rDev.GetTextWidth( aNormalStr ); - vcl::Font aOldFont( rDev.GetFont() ); - vcl::Font aFont( aOldFont ); - aFont.SetWeight( WEIGHT_BOLD ); + Point aNewPos(rPos); + aNewPos.X() += rRenderContext.GetTextWidth(aNormalStr); + vcl::Font aOldFont(rRenderContext.GetFont()); + vcl::Font aFont(aOldFont); + aFont.SetWeight(WEIGHT_BOLD); - OUString sTxt( ' ' ); - if ( mbIsDouble ) - sTxt += rtl::math::doubleToUString( mfDoubleValue, + OUString sTxt(' '); + if (mbIsDouble) + sTxt += rtl::math::doubleToUString(mfDoubleValue, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, ScGlobal::GetpLocaleData()->getNumDecimalSep()[0], true ); else sTxt += OUString::number(mnIntValue); - rDev.SetFont( aFont ); - rDev.DrawText( aNewPos, sTxt ); + rRenderContext.SetFont(aFont); + rRenderContext.DrawText(aNewPos, sTxt); - rDev.SetFont( aOldFont ); + rRenderContext.SetFont(aOldFont); } ScSolverOptionsDialog::ScSolverOptionsDialog( vcl::Window* pParent, diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 9e23ca6f307e..3ba29ee9f48d 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -251,7 +251,7 @@ public: return; pView->SetHighlighted(false); - mrTree.PaintEntry(p); + mrTree.Invalidate(); } }; @@ -395,7 +395,7 @@ void ScXMLSourceDlg::RepeatElementSelected(SvTreeListEntry& rEntry) // Highlight the entry if not highlighted already. This can happen // when the current entry is a child entry of a repeat element entry. p->SetHighlighted(true); - mpLbTree->PaintEntry(&rEntry); + mpLbTree->Invalidate(); maHighlightedEntries.push_back(&rEntry); } @@ -455,7 +455,7 @@ void ScXMLSourceDlg::SelectAllChildEntries(SvTreeListEntry& rEntry) SelectAllChildEntries(r); // select recursively. SvViewDataEntry* p = mpLbTree->GetViewDataEntry(&r); p->SetHighlighted(true); - mpLbTree->PaintEntry(&r); + mpLbTree->Invalidate(); maHighlightedEntries.push_back(&r); } } |