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/InterimItemWindow.cxx | 5 ++-- vcl/source/control/button.cxx | 50 ++++++++++++++++---------------- vcl/source/control/combobox.cxx | 4 +-- vcl/source/control/edit.cxx | 4 +-- vcl/source/control/fixed.cxx | 18 ++++++------ vcl/source/control/imgctrl.cxx | 2 +- vcl/source/control/listbox.cxx | 4 +-- vcl/source/control/scrbar.cxx | 20 ++++++------- vcl/source/control/spinbtn.cxx | 4 +-- vcl/source/control/spinfld.cxx | 6 ++-- 10 files changed, 59 insertions(+), 58 deletions(-) (limited to 'vcl/source/control') diff --git a/vcl/source/control/InterimItemWindow.cxx b/vcl/source/control/InterimItemWindow.cxx index 3817e01893f1..462370e65cd4 100644 --- a/vcl/source/control/InterimItemWindow.cxx +++ b/vcl/source/control/InterimItemWindow.cxx @@ -161,14 +161,15 @@ bool InterimItemWindow::ChildKeyInput(const KeyEvent& rKEvt) return true; } -void InterimItemWindow::Draw(OutputDevice* pDevice, const Point& rPos, DrawFlags /*nFlags*/) +void InterimItemWindow::Draw(OutputDevice* pDevice, const Point& rPos, + SystemTextColorFlags /*nFlags*/) { m_xContainer->draw(*pDevice, rPos, GetSizePixel()); } void InterimItemWindow::ImplPaintToDevice(::OutputDevice* pTargetOutDev, const Point& rPos) { - Draw(pTargetOutDev, rPos, DrawFlags::NONE); + Draw(pTargetOutDev, rPos, SystemTextColorFlags::NONE); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index a9d34103555c..f741ddb133d1 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -188,7 +188,7 @@ void Button::ImplSetSeparatorX( tools::Long nX ) mpButtonData->mnSeparatorX = nX; } -DrawTextFlags Button::ImplGetTextStyle( WinBits nWinStyle, DrawFlags nDrawFlags ) +DrawTextFlags Button::ImplGetTextStyle( WinBits nWinStyle, SystemTextColorFlags nSystemTextColorFlags ) { const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); DrawTextFlags nTextStyle = FixedText::ImplGetTextStyle(nWinStyle & ~WB_DEFBUTTON); @@ -196,7 +196,7 @@ DrawTextFlags Button::ImplGetTextStyle( WinBits nWinStyle, DrawFlags nDrawFlags if (!IsEnabled()) nTextStyle |= DrawTextFlags::Disable; - if ((nDrawFlags & DrawFlags::Mono) || + if ((nSystemTextColorFlags & SystemTextColorFlags::Mono) || (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono)) { nTextStyle |= DrawTextFlags::Mono; @@ -747,14 +747,14 @@ bool PushButton::ImplHitTestPushButton( vcl::Window const * pDev, return aTestRect.IsInside( rPos ); } -DrawTextFlags PushButton::ImplGetTextStyle( DrawFlags nDrawFlags ) const +DrawTextFlags PushButton::ImplGetTextStyle( SystemTextColorFlags nSystemTextColorFlags ) const { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); DrawTextFlags nTextStyle = DrawTextFlags::Mnemonic | DrawTextFlags::MultiLine | DrawTextFlags::EndEllipsis; if ( ( rStyleSettings.GetOptions() & StyleSettingsOptions::Mono ) || - ( nDrawFlags & DrawFlags::Mono ) ) + ( nSystemTextColorFlags & SystemTextColorFlags::Mono ) ) nTextStyle |= DrawTextFlags::Mono; if ( GetStyle() & WB_WORDBREAK ) @@ -782,14 +782,14 @@ DrawTextFlags PushButton::ImplGetTextStyle( DrawFlags nDrawFlags ) const return nTextStyle; } -void PushButton::ImplDrawPushButtonContent(OutputDevice *pDev, DrawFlags nDrawFlags, +void PushButton::ImplDrawPushButtonContent(OutputDevice *pDev, SystemTextColorFlags nSystemTextColorFlags, const tools::Rectangle &rRect, bool bMenuBtnSep, DrawButtonFlags nButtonFlags) { const StyleSettings &rStyleSettings = GetSettings().GetStyleSettings(); tools::Rectangle aInRect = rRect; Color aColor; - DrawTextFlags nTextStyle = ImplGetTextStyle(nDrawFlags); + DrawTextFlags nTextStyle = ImplGetTextStyle(nSystemTextColorFlags); DrawSymbolFlags nStyle; if (aInRect.Right() < aInRect.Left() || aInRect.Bottom() < aInRect.Top()) @@ -798,7 +798,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice *pDev, DrawFlags nDrawFl pDev->Push(PushFlags::CLIPREGION); pDev->IntersectClipRegion(aInRect); - if (nDrawFlags & DrawFlags::Mono) + if (nSystemTextColorFlags & SystemTextColorFlags::Mono) aColor = COL_BLACK; else if (IsControlForeground()) @@ -1087,7 +1087,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) } // draw content using the same aInRect as non-native VCL would do - ImplDrawPushButtonContent(&rRenderContext, DrawFlags::NONE, + ImplDrawPushButtonContent(&rRenderContext, SystemTextColorFlags::NONE, aInRect, bDrawMenuSep, nButtonStyle); if (HasFocus()) @@ -1114,7 +1114,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) } // draw content - ImplDrawPushButtonContent(&rRenderContext, DrawFlags::NONE, aInRect, bDrawMenuSep, nButtonStyle); + ImplDrawPushButtonContent(&rRenderContext, SystemTextColorFlags::NONE, aInRect, bDrawMenuSep, nButtonStyle); if (HasFocus()) { @@ -1355,7 +1355,7 @@ void PushButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangl } void PushButton::Draw( OutputDevice* pDev, const Point& rPos, - DrawFlags nFlags ) + SystemTextColorFlags nFlags ) { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = GetSizePixel(); @@ -1365,7 +1365,7 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, pDev->Push(); pDev->SetMapMode(); pDev->SetFont( aFont ); - if ( nFlags & DrawFlags::Mono ) + if ( nFlags & SystemTextColorFlags::Mono ) { pDev->SetTextColor( COL_BLACK ); } @@ -1387,7 +1387,7 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, DecorationView aDecoView( pDev ); DrawButtonFlags nButtonStyle = DrawButtonFlags::NONE; - if ( nFlags & DrawFlags::Mono ) + if ( nFlags & SystemTextColorFlags::Mono ) nButtonStyle |= DrawButtonFlags::Mono; if ( IsChecked() ) nButtonStyle |= DrawButtonFlags::Checked; @@ -1641,7 +1641,7 @@ Size PushButton::CalcMinimumSize() const if (!PushButton::GetText().isEmpty()) { Size textSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), - PushButton::GetText(), ImplGetTextStyle( DrawFlags::NONE ) ).GetSize(); + PushButton::GetText(), ImplGetTextStyle( SystemTextColorFlags::NONE ) ).GetSize(); tools::Long nTextHeight = textSize.Height() * 1.15; @@ -2029,12 +2029,12 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext) } // for drawing RadioButton or CheckButton that has Text and/or Image -void Button::ImplDrawRadioCheck(OutputDevice* pDev, WinBits nWinStyle, DrawFlags nDrawFlags, +void Button::ImplDrawRadioCheck(OutputDevice* pDev, WinBits nWinStyle, SystemTextColorFlags nSystemTextColorFlags, const Point& rPos, const Size& rSize, const Size& rImageSize, tools::Rectangle& rStateRect, tools::Rectangle& rMouseRect) { - DrawTextFlags nTextStyle = Button::ImplGetTextStyle( nWinStyle, nDrawFlags ); + DrawTextFlags nTextStyle = Button::ImplGetTextStyle( nWinStyle, nSystemTextColorFlags ); const tools::Long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() ); Size aSize( rSize ); @@ -2085,7 +2085,7 @@ void Button::ImplDrawRadioCheck(OutputDevice* pDev, WinBits nWinStyle, DrawFlags rMouseRect.SetBottom( rStateRect.Bottom() ); } -void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, +void RadioButton::ImplDraw( OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags, const Point& rPos, const Size& rSize, const Size& rImageSize, tools::Rectangle& rStateRect, tools::Rectangle& rMouseRect ) @@ -2101,7 +2101,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, { if (!aText.isEmpty() || HasImage()) { - Button::ImplDrawRadioCheck(pDev, nWinStyle, nDrawFlags, + Button::ImplDrawRadioCheck(pDev, nWinStyle, nSystemTextColorFlags, rPos, rSize, rImageSize, rStateRect, rMouseRect); } @@ -2180,7 +2180,7 @@ void RadioButton::ImplDrawRadioButton(vcl::RenderContext& rRenderContext) aImageSize.setHeight( CalcZoom(aImageSize.Height()) ); // Draw control text - ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel(), + ImplDraw(&rRenderContext, SystemTextColorFlags::NONE, Point(), GetOutputSizePixel(), aImageSize, maStateRect, maMouseRect); if (!maImage && HasFocus()) @@ -2444,7 +2444,7 @@ void RadioButton::Paint( vcl::RenderContext& rRenderContext, const tools::Rectan } void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, - DrawFlags nFlags ) + SystemTextColorFlags nFlags ) { if ( !maImage ) { @@ -2477,7 +2477,7 @@ void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, pDev->Push(); pDev->SetMapMode(); pDev->SetFont( aFont ); - if ( nFlags & DrawFlags::Mono ) + if ( nFlags & SystemTextColorFlags::Mono ) pDev->SetTextColor( COL_BLACK ); else pDev->SetTextColor( GetTextColor() ); @@ -3085,7 +3085,7 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) rRenderContext.DrawImage(maStateRect.TopLeft(), aImage); } -void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, +void CheckBox::ImplDraw( OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags, const Point& rPos, const Size& rSize, const Size& rImageSize, tools::Rectangle& rStateRect, tools::Rectangle& rMouseRect ) @@ -3098,7 +3098,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, if (!aText.isEmpty() || HasImage()) { - Button::ImplDrawRadioCheck(pDev, nWinStyle, nDrawFlags, + Button::ImplDrawRadioCheck(pDev, nWinStyle, nSystemTextColorFlags, rPos, rSize, rImageSize, rStateRect, rMouseRect); } @@ -3134,7 +3134,7 @@ void CheckBox::ImplDrawCheckBox(vcl::RenderContext& rRenderContext) HideFocus(); - ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel(), + ImplDraw(&rRenderContext, SystemTextColorFlags::NONE, Point(), GetOutputSizePixel(), aImageSize, maStateRect, maMouseRect); ImplDrawCheckBoxState(rRenderContext); @@ -3270,7 +3270,7 @@ void CheckBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& } void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, - DrawFlags nFlags ) + SystemTextColorFlags nFlags ) { MapMode aResMapMode( MapUnit::Map100thMM ); Point aPos = pDev->LogicToPixel( rPos ); @@ -3304,7 +3304,7 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, pDev->Push(); pDev->SetMapMode(); pDev->SetFont( aFont ); - if ( nFlags & DrawFlags::Mono ) + if ( nFlags & SystemTextColorFlags::Mono ) pDev->SetTextColor( COL_BLACK ); else pDev->SetTextColor( GetTextColor() ); diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 5fc86dd6d4f9..de3de3d6e1f7 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1147,7 +1147,7 @@ void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines } } -void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) +void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) { GetMainWindow()->ApplySettings(*pDev); @@ -1202,7 +1202,7 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) else nTextStyle |= DrawTextFlags::Left; - if ( nFlags & DrawFlags::Mono ) + if ( nFlags & SystemTextColorFlags::Mono ) { pDev->SetTextColor( COL_BLACK ); } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 958b26e54dde..05d898655c95 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1738,7 +1738,7 @@ void Edit::Resize() } } -void Edit::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) +void Edit::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) { ApplySettings(*pDev); @@ -1771,7 +1771,7 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) } // Content - if ( nFlags & DrawFlags::Mono ) + if ( nFlags & SystemTextColorFlags::Mono ) pDev->SetTextColor( COL_BLACK ); else { diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index a3de935a07db..a927f27af407 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -130,7 +130,7 @@ DrawTextFlags FixedText::ImplGetTextStyle( WinBits nWinStyle ) return nTextStyle; } -void FixedText::ImplDraw(OutputDevice* pDev, DrawFlags nDrawFlags, +void FixedText::ImplDraw(OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags, const Point& rPos, const Size& rSize, bool bFillLayout) const { @@ -150,7 +150,7 @@ void FixedText::ImplDraw(OutputDevice* pDev, DrawFlags nDrawFlags, } if ( !IsEnabled() ) nTextStyle |= DrawTextFlags::Disable; - if ( (nDrawFlags & DrawFlags::Mono) || + if ( (nSystemTextColorFlags & SystemTextColorFlags::Mono) || (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) ) nTextStyle |= DrawTextFlags::Mono; @@ -195,11 +195,11 @@ void FixedText::ApplySettings(vcl::RenderContext& rRenderContext) void FixedText::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) { - ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel()); + ImplDraw(&rRenderContext, SystemTextColorFlags::NONE, Point(), GetOutputSizePixel()); } void FixedText::Draw( OutputDevice* pDev, const Point& rPos, - DrawFlags nFlags ) + SystemTextColorFlags nFlags ) { ApplySettings(*pDev); @@ -210,7 +210,7 @@ void FixedText::Draw( OutputDevice* pDev, const Point& rPos, pDev->Push(); pDev->SetMapMode(); pDev->SetFont( aFont ); - if ( nFlags & DrawFlags::Mono ) + if ( nFlags & SystemTextColorFlags::Mono ) pDev->SetTextColor( COL_BLACK ); else pDev->SetTextColor( GetTextColor() ); @@ -351,7 +351,7 @@ Size FixedText::GetOptimalSize() const void FixedText::FillLayoutData() const { mxLayoutData.emplace(); - ImplDraw(const_cast(this)->GetOutDev(), DrawFlags::NONE, Point(), GetOutputSizePixel(), true); + ImplDraw(const_cast(this)->GetOutDev(), SystemTextColorFlags::NONE, Point(), GetOutputSizePixel(), true); //const_cast(this)->Invalidate(); } @@ -589,7 +589,7 @@ void FixedLine::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle ImplDraw(rRenderContext); } -void FixedLine::Draw( OutputDevice*, const Point&, DrawFlags ) +void FixedLine::Draw( OutputDevice*, const Point&, SystemTextColorFlags ) { } @@ -726,7 +726,7 @@ void FixedBitmap::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang } void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos, - DrawFlags ) + SystemTextColorFlags ) { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = GetSizePixel(); @@ -873,7 +873,7 @@ Size FixedImage::GetOptimalSize() const } void FixedImage::Draw( OutputDevice* pDev, const Point& rPos, - DrawFlags ) + SystemTextColorFlags ) { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = GetSizePixel(); diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx index b904b73c66e8..414824b29d82 100644 --- a/vcl/source/control/imgctrl.cxx +++ b/vcl/source/control/imgctrl.cxx @@ -149,7 +149,7 @@ void ImageControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan } -void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags ) +void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags ) { const Point aPos = pDev->LogicToPixel( rPos ); const Size aSize = GetSizePixel(); diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index ee53bf4e9858..c8c8b0c8d63e 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -314,7 +314,7 @@ void ListBox::ApplySettings(vcl::RenderContext& rRenderContext) rRenderContext.SetBackground(); } -void ListBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) +void ListBox::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) { mpImplLB->GetMainWindow()->ApplySettings(*pDev); @@ -347,7 +347,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) } // Content - if ( nFlags & DrawFlags::Mono ) + if ( nFlags & SystemTextColorFlags::Mono ) { pDev->SetTextColor( COL_BLACK ); } 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); diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx index 4e0689ecbfe1..f99bf61393fb 100644 --- a/vcl/source/control/spinbtn.cxx +++ b/vcl/source/control/spinbtn.cxx @@ -120,14 +120,14 @@ void SpinButton::Resize() Invalidate(); } -void SpinButton::Draw(OutputDevice* pDev, const Point& rPos, DrawFlags nFlags) +void SpinButton::Draw(OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags) { Point aPos = pDev->LogicToPixel(rPos); Size aSize = GetSizePixel(); pDev->Push(); pDev->SetMapMode(); - if ( !(nFlags & DrawFlags::Mono) ) + if ( !(nFlags & SystemTextColorFlags::Mono) ) { // DecoView uses the FaceColor... AllSettings aSettings = pDev->GetSettings(); diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index 7fef46a9e469..c52ed79e7657 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -953,12 +953,12 @@ IMPL_LINK( SpinField, ImplTimeout, Timer*, pTimer, void ) } } -void SpinField::Draw(OutputDevice* pDev, const Point& rPos, DrawFlags nFlags) +void SpinField::Draw(OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags) { Edit::Draw(pDev, rPos, nFlags); WinBits nFieldStyle = GetStyle(); - if ( (nFlags & DrawFlags::NoControls ) || !( nFieldStyle & (WB_SPIN|WB_DROPDOWN) ) ) + if ( (nFlags & SystemTextColorFlags::NoControls ) || !( nFieldStyle & (WB_SPIN|WB_DROPDOWN) ) ) return; Point aPos = pDev->LogicToPixel( rPos ); @@ -976,7 +976,7 @@ void SpinField::Draw(OutputDevice* pDev, const Point& rPos, DrawFlags nFlags) aDown.Move(aPos.X(), aPos.Y()); Color aButtonTextColor; - if (nFlags & DrawFlags::Mono) + if (nFlags & SystemTextColorFlags::Mono) aButtonTextColor = COL_BLACK; else aButtonTextColor = GetSettings().GetStyleSettings().GetButtonTextColor(); -- cgit