From a2c8195f465a2e4346169d2b586c34e8fbed253c Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Wed, 12 May 2021 20:01:05 +1000 Subject: tdf#74702 vcl: introduce GetSystemTextColor() Also rename DrawFlags to SystemDrawColorFlags, added a unit test. Change-Id: I3cb74b278e43561d1055b3b55b9730cdbdea51aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113559 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- vcl/source/control/scrbar.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'vcl/source/control/scrbar.cxx') diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 8b812b6e2a01..d929ec00ba9a 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -370,13 +370,13 @@ void ScrollBar::ImplCalc( bool bUpdate ) ImplUpdateRects( bUpdate ); } -void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) +void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) { Point aPos = pDev->LogicToPixel( rPos ); pDev->Push(); pDev->SetMapMode(); - if ( !(nFlags & DrawFlags::Mono) ) + if ( !(nFlags & SystemTextColorFlags::Mono) ) { // DecoView uses the FaceColor... AllSettings aSettings = pDev->GetSettings(); @@ -412,7 +412,7 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) mbCalcSize = true; } -bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags) +bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nSystemTextColorFlags) { ScrollbarValue scrValue; @@ -480,7 +480,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD } else { - if ((nDrawFlags & SCRBAR_DRAW_PAGE1) || (nDrawFlags & SCRBAR_DRAW_PAGE2)) + if ((nSystemTextColorFlags & SCRBAR_DRAW_PAGE1) || (nSystemTextColorFlags & SCRBAR_DRAW_PAGE2)) { ControlPart part1 = bHorz ? ControlPart::TrackHorzLeft : ControlPart::TrackVertUpper; ControlPart part2 = bHorz ? ControlPart::TrackHorzRight : ControlPart::TrackVertLower; @@ -505,13 +505,13 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD } } - if (nDrawFlags & SCRBAR_DRAW_PAGE1) + if (nSystemTextColorFlags & SCRBAR_DRAW_PAGE1) bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part1, aCtrlRegion1, nState1, scrValue, OUString()); - if (nDrawFlags & SCRBAR_DRAW_PAGE2) + if (nSystemTextColorFlags & SCRBAR_DRAW_PAGE2) bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part2, aCtrlRegion2, nState2, scrValue, OUString()); } - if ((nDrawFlags & SCRBAR_DRAW_BTN1) || (nDrawFlags & SCRBAR_DRAW_BTN2)) + if ((nSystemTextColorFlags & SCRBAR_DRAW_BTN1) || (nSystemTextColorFlags & SCRBAR_DRAW_BTN2)) { ControlPart part1 = bHorz ? ControlPart::ButtonLeft : ControlPart::ButtonUp; ControlPart part2 = bHorz ? ControlPart::ButtonRight : ControlPart::ButtonDown; @@ -545,13 +545,13 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD } } - if (nDrawFlags & SCRBAR_DRAW_BTN1) + if (nSystemTextColorFlags & SCRBAR_DRAW_BTN1) bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part1, aCtrlRegion1, nState1, scrValue, OUString()); - if (nDrawFlags & SCRBAR_DRAW_BTN2) + if (nSystemTextColorFlags & SCRBAR_DRAW_BTN2) bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part2, aCtrlRegion2, nState2, scrValue, OUString()); } - if ((nDrawFlags & SCRBAR_DRAW_THUMB) && !maThumbRect.IsEmpty()) + if ((nSystemTextColorFlags & SCRBAR_DRAW_THUMB) && !maThumbRect.IsEmpty()) { ControlState nState = IsEnabled() ? ControlState::ENABLED : ControlState::NONE; tools::Rectangle aCtrlRegion(maThumbRect); -- cgit