[Libreoffice-commits] core.git: forms/source include/svtools include/vcl svtools/source svx/source toolkit/inc toolkit/source vcl/qa vcl/source

Chris Sherlock (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 30 04:10:28 UTC 2021


 forms/source/richtext/richtextcontrol.cxx          |    2 
 forms/source/richtext/richtextvclcontrol.cxx       |    2 
 forms/source/richtext/richtextvclcontrol.hxx       |    2 
 include/svtools/brwbox.hxx                         |    2 
 include/vcl/InterimItemWindow.hxx                  |    3 -
 include/vcl/headbar.hxx                            |    2 
 include/vcl/outdev.hxx                             |    2 
 include/vcl/print.hxx                              |    1 
 include/vcl/rendercontext/SystemTextColorFlags.hxx |   37 +++++++++++++++
 include/vcl/scrbar.hxx                             |    4 -
 include/vcl/tabpage.hxx                            |    2 
 include/vcl/toolkit/button.hxx                     |   18 +++----
 include/vcl/toolkit/combobox.hxx                   |    2 
 include/vcl/toolkit/dialog.hxx                     |    2 
 include/vcl/toolkit/edit.hxx                       |    2 
 include/vcl/toolkit/fixed.hxx                      |   10 ++--
 include/vcl/toolkit/group.hxx                      |    4 -
 include/vcl/toolkit/imgctrl.hxx                    |    2 
 include/vcl/toolkit/lstbox.hxx                     |    2 
 include/vcl/toolkit/spin.hxx                       |    2 
 include/vcl/toolkit/spinfld.hxx                    |    2 
 include/vcl/toolkit/vclmedit.hxx                   |    2 
 include/vcl/window.hxx                             |   15 ------
 svtools/source/brwbox/brwbox2.cxx                  |    2 
 svtools/source/brwbox/editbrowsebox.cxx            |    2 
 svx/source/fmcomp/gridcell.cxx                     |    2 
 toolkit/inc/controls/filectrl.hxx                  |    2 
 toolkit/source/awt/vclxtabpagecontainer.cxx        |    2 
 toolkit/source/awt/vclxwindow.cxx                  |    4 -
 toolkit/source/awt/vclxwindows.cxx                 |    8 +--
 toolkit/source/controls/filectrl.cxx               |    2 
 vcl/qa/cppunit/outdev.cxx                          |   20 ++++++++
 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 +-
 vcl/source/edit/vclmedit.cxx                       |   19 -------
 vcl/source/gdi/print.cxx                           |    5 ++
 vcl/source/outdev/text.cxx                         |   16 ++++++
 vcl/source/toolkit/group.cxx                       |   18 +++----
 vcl/source/treelist/headbar.cxx                    |    4 -
 vcl/source/window/dialog.cxx                       |    2 
 vcl/source/window/tabpage.cxx                      |    2 
 vcl/source/window/window.cxx                       |    2 
 50 files changed, 203 insertions(+), 148 deletions(-)

New commits:
commit a2c8195f465a2e4346169d2b586c34e8fbed253c
Author:     Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Wed May 12 20:01:05 2021 +1000
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Aug 30 06:09:49 2021 +0200

    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 <mike.kaganski at collabora.com>

diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx
index 45e898b8ed13..7aeb8410b568 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -330,7 +330,7 @@ namespace frm
         if ( eTargetUnit != MapUnit::MapPixel )
             aPos = pTargetDevice->PixelToLogic( aPos );
 
-        pControl->Draw( pTargetDevice, aPos, DrawFlags::NoControls );
+        pControl->Draw( pTargetDevice, aPos, SystemTextColorFlags::NoControls );
     }
 
 
diff --git a/forms/source/richtext/richtextvclcontrol.cxx b/forms/source/richtext/richtextvclcontrol.cxx
index 0df141693f54..ff570eb74efa 100644
--- a/forms/source/richtext/richtextvclcontrol.cxx
+++ b/forms/source/richtext/richtextvclcontrol.cxx
@@ -288,7 +288,7 @@ namespace frm
         return bDone || Control::EventNotify(_rNEvt);
     }
 
-    void RichTextControl::Draw( OutputDevice* _pDev, const Point& _rPos, DrawFlags /*_nFlags*/ )
+    void RichTextControl::Draw( OutputDevice* _pDev, const Point& _rPos, SystemTextColorFlags /*_nFlags*/ )
     {
         m_pImpl->Draw( _pDev, _rPos, _pDev->PixelToLogic(GetSizePixel()) );
     }
diff --git a/forms/source/richtext/richtextvclcontrol.hxx b/forms/source/richtext/richtextvclcontrol.hxx
index 58448c34cd11..92d0c047d7ea 100644
--- a/forms/source/richtext/richtextvclcontrol.hxx
+++ b/forms/source/richtext/richtextvclcontrol.hxx
@@ -96,7 +96,7 @@ namespace frm
               EditView& getView();
 
         // Window overridables
-        virtual void        Draw( OutputDevice* _pDev, const Point& _rPos, DrawFlags _nFlags ) override;
+        virtual void        Draw( OutputDevice* _pDev, const Point& _rPos, SystemTextColorFlags _nFlags ) override;
 
     protected:
         // Window overridables
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index e7ea12a985f2..1c7d6e5404cc 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -472,7 +472,7 @@ public:
     virtual void    GetFocus() override;
     virtual void    Resize() override;
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    Command( const CommandEvent& rEvt ) override;
     virtual void    StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) override;
 
diff --git a/include/vcl/InterimItemWindow.hxx b/include/vcl/InterimItemWindow.hxx
index 08860c50244a..61c001fd8caa 100644
--- a/include/vcl/InterimItemWindow.hxx
+++ b/include/vcl/InterimItemWindow.hxx
@@ -31,7 +31,8 @@ public:
 
     bool ControlHasFocus() const;
 
-    virtual void Draw(OutputDevice* pDevice, const Point& rPos, DrawFlags nFlags) override;
+    virtual void Draw(OutputDevice* pDevice, const Point& rPos,
+                      SystemTextColorFlags nFlags) override;
 
 protected:
     // bAllowCycleFocusOut of true allows focus to be moved out of the Control
diff --git a/include/vcl/headbar.hxx b/include/vcl/headbar.hxx
index 0cb75d275a33..1f9fc429ae94 100644
--- a/include/vcl/headbar.hxx
+++ b/include/vcl/headbar.hxx
@@ -257,7 +257,7 @@ public:
     virtual void        MouseMove( const MouseEvent& rMEvt ) override;
     virtual void        Tracking( const TrackingEvent& rTEvt ) override;
     virtual void        Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
-    virtual void        Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void        Draw( OutputDevice* pDev, const Point& rPos,SystemTextColorFlags nFlags ) override;
     virtual void        Resize() override;
     virtual void        Command( const CommandEvent& rCEvt ) override;
     virtual void        RequestHelp( const HelpEvent& rHEvt ) override;
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 402b998bc1aa..2cd65db1a81e 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -33,6 +33,7 @@
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
 #include <vcl/rendercontext/AntialiasingFlags.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
 #include <vcl/rendercontext/DrawGridFlags.hxx>
 #include <vcl/rendercontext/DrawImageFlags.hxx>
 #include <vcl/rendercontext/DrawModeFlags.hxx>
@@ -1005,6 +1006,7 @@ public:
                                                     GDIMetaFile&     rMtf );
 
     void                        SetTextColor( const Color& rColor );
+    virtual void                SetSystemTextColor(SystemTextColorFlags nFlags, bool bEnabled);
     const Color&                GetTextColor() const { return maTextColor; }
 
     void                        SetTextFillColor();
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 97a18b19c121..6ffdc077dff6 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -211,6 +211,7 @@ protected:
     vcl::Region                 ClipToDeviceBounds(vcl::Region aRegion) const override;
 
 public:
+    void                        SetSystemTextColor(SystemTextColorFlags, bool) override;
     void                        DrawGradientEx( OutputDevice* pOut, const tools::Rectangle& rRect,
                                     const Gradient& rGradient );
     virtual Bitmap              GetBitmap( const Point& rSrcPt, const Size& rSize ) const override;
diff --git a/include/vcl/rendercontext/SystemTextColorFlags.hxx b/include/vcl/rendercontext/SystemTextColorFlags.hxx
new file mode 100644
index 000000000000..459c219458e9
--- /dev/null
+++ b/include/vcl/rendercontext/SystemTextColorFlags.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <o3tl/typed_flags_set.hxx>
+
+enum class SystemTextColorFlags
+{
+    NONE = 0x0000,
+    Mono = 0x0001,
+    NoControls = 0x0004,
+};
+namespace o3tl
+{
+template <> struct typed_flags<SystemTextColorFlags> : is_typed_flags<SystemTextColorFlags, 0x0005>
+{
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/include/vcl/scrbar.hxx b/include/vcl/scrbar.hxx
index 47bcded8697b..a85df6665f2c 100644
--- a/include/vcl/scrbar.hxx
+++ b/include/vcl/scrbar.hxx
@@ -79,7 +79,7 @@ private:
     SAL_DLLPRIVATE tools::Long         ImplDoAction( bool bCallEndScroll );
     SAL_DLLPRIVATE void         ImplDoMouseAction( const Point& rPos, bool bCallAction = true );
     SAL_DLLPRIVATE void         ImplInvert();
-    SAL_DLLPRIVATE bool         ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFlags);
+    SAL_DLLPRIVATE bool         ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 SystemTextColorFlags);
     SAL_DLLPRIVATE void         ImplDragThumb( const Point& rMousePos );
     SAL_DLLPRIVATE Size         getCurrentCalcSize() const;
     DECL_DLLPRIVATE_LINK( ImplAutoTimerHdl, Timer*, void );
@@ -93,7 +93,7 @@ public:
     virtual void Tracking(const TrackingEvent& rTEvt) override;
     virtual void KeyInput(const KeyEvent& rKEvt) override;
     virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
-    virtual void Draw(OutputDevice* pDev, const Point& rPos, DrawFlags nFlags) override;
+    virtual void Draw(OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags) override;
     virtual void Move() override;
     virtual void Resize() override;
     virtual void StateChanged(StateChangedType nType) override;
diff --git a/include/vcl/tabpage.hxx b/include/vcl/tabpage.hxx
index a807165ffeeb..888072cba2ff 100644
--- a/include/vcl/tabpage.hxx
+++ b/include/vcl/tabpage.hxx
@@ -51,7 +51,7 @@ public:
     virtual void    dispose() override;
 
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
 
     virtual void    StateChanged( StateChangedType nStateChange ) override;
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
diff --git a/include/vcl/toolkit/button.hxx b/include/vcl/toolkit/button.hxx
index a9b81b0edb00..b2799f573fee 100644
--- a/include/vcl/toolkit/button.hxx
+++ b/include/vcl/toolkit/button.hxx
@@ -49,7 +49,7 @@ private:
                                     Button (const Button &) = delete;
                                     Button & operator= (const Button &) = delete;
 public:
-    SAL_DLLPRIVATE DrawTextFlags    ImplGetTextStyle( WinBits nWinStyle, DrawFlags nDrawFlags );
+    SAL_DLLPRIVATE DrawTextFlags    ImplGetTextStyle( WinBits nWinStyle, SystemTextColorFlags nSystemTextColorFlags );
     SAL_DLLPRIVATE void             ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, Size& rSize,
                                               sal_Int32 nImageSep,
                                               DrawTextFlags nTextStyle, tools::Rectangle *pSymbolRect=nullptr, bool bAddImageSep = false );
@@ -64,7 +64,7 @@ protected:
     explicit            Button( WindowType nType );
 
     // for drawing RadioButton or CheckButton that has Text and/or Image
-    SAL_DLLPRIVATE void ImplDrawRadioCheck(OutputDevice* pDev, WinBits nWinStyle, DrawFlags nDrawFlags,
+    SAL_DLLPRIVATE void ImplDrawRadioCheck(OutputDevice* pDev, WinBits nWinStyle, SystemTextColorFlags nSystemTextColorFlags,
                                            const Point& rPos, const Size& rSize,
                                            const Size& rImageSize, tools::Rectangle& rStateRect,
                                            tools::Rectangle& rMouseRect);
@@ -135,7 +135,7 @@ public:
     virtual void    KeyInput( const KeyEvent& rKEvt ) override;
     virtual void    KeyUp( const KeyEvent& rKEvt ) override;
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual void    GetFocus() override;
     virtual void    LoseFocus() override;
@@ -186,12 +186,12 @@ protected:
     SAL_DLLPRIVATE void            ImplInitPushButtonData();
     SAL_DLLPRIVATE static WinBits  ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle );
     SAL_DLLPRIVATE void            ImplInitSettings( bool bBackground );
-    SAL_DLLPRIVATE void            ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFlags,
+    SAL_DLLPRIVATE void            ImplDrawPushButtonContent(OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags,
                                                              const tools::Rectangle& rRect, bool bMenuBtnSep,
                                                              DrawButtonFlags nButtonFlags);
     SAL_DLLPRIVATE void            ImplDrawPushButton(vcl::RenderContext& rRenderContext);
     using Button::ImplGetTextStyle;
-    SAL_DLLPRIVATE DrawTextFlags   ImplGetTextStyle( DrawFlags nDrawFlags ) const;
+    SAL_DLLPRIVATE DrawTextFlags   ImplGetTextStyle( SystemTextColorFlags nSystemTextColorFlags ) const;
     SAL_DLLPRIVATE bool            IsSymbol() const { return ( (meSymbol != SymbolType::DONTKNOW) && (meSymbol != SymbolType::IMAGE) ); }
 
                                    PushButton( const PushButton & ) = delete;
@@ -294,7 +294,7 @@ private:
     SAL_DLLPRIVATE void         ImplInitCheckBoxData();
     SAL_DLLPRIVATE static WinBits ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle );
     SAL_DLLPRIVATE void         ImplInitSettings( bool bBackground );
-    SAL_DLLPRIVATE void         ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
+    SAL_DLLPRIVATE void         ImplDraw( OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags,
                                     const Point& rPos, const Size& rSize,
                                     const Size& rImageSize, tools::Rectangle& rStateRect,
                                     tools::Rectangle& rMouseRect );
@@ -327,7 +327,7 @@ public:
     virtual void    KeyInput( const KeyEvent& rKEvt ) override;
     virtual void    KeyUp( const KeyEvent& rKEvt ) override;
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual void    GetFocus() override;
     virtual void    LoseFocus() override;
@@ -387,7 +387,7 @@ private:
     SAL_DLLPRIVATE WinBits  ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nStyle );
     SAL_DLLPRIVATE void     ImplInitSettings( bool bBackground );
     SAL_DLLPRIVATE void     ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext);
-    SAL_DLLPRIVATE void     ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
+    SAL_DLLPRIVATE void     ImplDraw( OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags,
                               const Point& rPos, const Size& rSize,
                               const Size& rImageSize, tools::Rectangle& rStateRect,
                               tools::Rectangle& rMouseRect );
@@ -431,7 +431,7 @@ public:
     virtual void    KeyInput( const KeyEvent& rKEvt ) override;
     virtual void    KeyUp( const KeyEvent& rKEvt ) override;
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual void    GetFocus() override;
     virtual void    LoseFocus() override;
diff --git a/include/vcl/toolkit/combobox.hxx b/include/vcl/toolkit/combobox.hxx
index 105c5dcb0c95..143c2989e42d 100644
--- a/include/vcl/toolkit/combobox.hxx
+++ b/include/vcl/toolkit/combobox.hxx
@@ -58,7 +58,7 @@ public:
     virtual         ~ComboBox() override;
     virtual void    dispose() override;
 
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos,SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual bool    EventNotify( NotifyEvent& rNEvt ) override;
     virtual void    StateChanged( StateChangedType nType ) override;
diff --git a/include/vcl/toolkit/dialog.hxx b/include/vcl/toolkit/dialog.hxx
index 3a5a1650bdc7..cec7ddbe67b3 100644
--- a/include/vcl/toolkit/dialog.hxx
+++ b/include/vcl/toolkit/dialog.hxx
@@ -93,7 +93,7 @@ public:
 protected:
     explicit        Dialog( WindowType nType );
     explicit        Dialog( vcl::Window* pParent, std::u16string_view rID, const OUString& rUIXMLDescription);
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    settingOptimalLayoutSize(Window *pBox) override;
 
 protected:
diff --git a/include/vcl/toolkit/edit.hxx b/include/vcl/toolkit/edit.hxx
index b622c4bc2e65..f59d12f9d9fd 100644
--- a/include/vcl/toolkit/edit.hxx
+++ b/include/vcl/toolkit/edit.hxx
@@ -154,7 +154,7 @@ public:
     virtual void        KeyInput( const KeyEvent& rKEvt ) override;
     virtual void        Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
     virtual void        Resize() override;
-    virtual void        Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void        Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void        GetFocus() override;
     virtual void        LoseFocus() override;
     virtual void        Tracking( const TrackingEvent& rTEvt ) override;
diff --git a/include/vcl/toolkit/fixed.hxx b/include/vcl/toolkit/fixed.hxx
index 5e0cc38f5dba..afa0004f7ec8 100644
--- a/include/vcl/toolkit/fixed.hxx
+++ b/include/vcl/toolkit/fixed.hxx
@@ -39,7 +39,7 @@ private:
     using Window::ImplInit;
     SAL_DLLPRIVATE void    ImplInit( vcl::Window* pParent, WinBits nStyle );
     SAL_DLLPRIVATE static WinBits ImplInitStyle( WinBits nStyle );
-    SAL_DLLPRIVATE void    ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
+    SAL_DLLPRIVATE void    ImplDraw( OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags,
                               const Point& rPos, const Size& rSize, bool bFillLayout = false ) const;
 public:
     SAL_DLLPRIVATE static DrawTextFlags ImplGetTextStyle( WinBits nWinBits );
@@ -60,7 +60,7 @@ public:
     virtual void    ApplySettings(vcl::RenderContext& rRenderContext) override;
 
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual void    StateChanged( StateChangedType nType ) override;
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
@@ -106,7 +106,7 @@ public:
     virtual void    ApplySettings(vcl::RenderContext&) override;
 
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual void    StateChanged( StateChangedType nType ) override;
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
@@ -132,7 +132,7 @@ public:
     virtual void    ApplySettings(vcl::RenderContext&) override;
 
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual void    StateChanged( StateChangedType nType ) override;
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
@@ -160,7 +160,7 @@ public:
     virtual void    ApplySettings(vcl::RenderContext&) override;
 
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual void    StateChanged( StateChangedType nType ) override;
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
diff --git a/include/vcl/toolkit/group.hxx b/include/vcl/toolkit/group.hxx
index d6088b884cd1..81e595ec2da5 100644
--- a/include/vcl/toolkit/group.hxx
+++ b/include/vcl/toolkit/group.hxx
@@ -35,7 +35,7 @@ private:
     SAL_DLLPRIVATE void     ImplInit( vcl::Window* pParent, WinBits nStyle );
     SAL_DLLPRIVATE static WinBits ImplInitStyle( WinBits nStyle );
     SAL_DLLPRIVATE void     ImplInitSettings( bool bBackground );
-    SAL_DLLPRIVATE void     ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
+    SAL_DLLPRIVATE void     ImplDraw( OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags,
                                       const Point& rPos, const Size& rSize, bool bLayout = false );
 
     virtual void    FillLayoutData() const override;
@@ -48,7 +48,7 @@ public:
     explicit        GroupBox( vcl::Window* pParent, WinBits nStyle );
 
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual void    StateChanged( StateChangedType nType ) override;
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
diff --git a/include/vcl/toolkit/imgctrl.hxx b/include/vcl/toolkit/imgctrl.hxx
index 9dea3430d237..20b1863a0071 100644
--- a/include/vcl/toolkit/imgctrl.hxx
+++ b/include/vcl/toolkit/imgctrl.hxx
@@ -40,7 +40,7 @@ public:
     ::sal_Int16     GetScaleMode() const { return mnScaleMode; }
 
     virtual void    Resize() override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos,SystemTextColorFlags nFlags ) override;
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
     virtual void    GetFocus() override;
     virtual void    LoseFocus() override;
diff --git a/include/vcl/toolkit/lstbox.hxx b/include/vcl/toolkit/lstbox.hxx
index 7cba7c132b1e..e3bcc1297082 100644
--- a/include/vcl/toolkit/lstbox.hxx
+++ b/include/vcl/toolkit/lstbox.hxx
@@ -124,7 +124,7 @@ public:
     virtual void        dispose() override;
 
     virtual void        ApplySettings(vcl::RenderContext& rRenderContext) override;
-    virtual void        Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void        Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void        Resize() override;
     virtual bool        PreNotify( NotifyEvent& rNEvt ) override;
     virtual void        StateChanged( StateChangedType nType ) override;
diff --git a/include/vcl/toolkit/spin.hxx b/include/vcl/toolkit/spin.hxx
index ad9162073cc7..bc1e14109fda 100644
--- a/include/vcl/toolkit/spin.hxx
+++ b/include/vcl/toolkit/spin.hxx
@@ -60,7 +60,7 @@ public:
 
     virtual void    Resize() override;
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
     virtual void    MouseButtonDown( const MouseEvent& rMEvt ) override;
     virtual void    MouseButtonUp( const MouseEvent& rMEvt ) override;
     virtual void    MouseMove( const MouseEvent& rMEvt ) override;
diff --git a/include/vcl/toolkit/spinfld.hxx b/include/vcl/toolkit/spinfld.hxx
index 78a52883cb16..f6de1202a45d 100644
--- a/include/vcl/toolkit/spinfld.hxx
+++ b/include/vcl/toolkit/spinfld.hxx
@@ -45,7 +45,7 @@ public:
     virtual void    MouseButtonUp( const MouseEvent& rMEvt ) override;
     virtual void    MouseMove( const MouseEvent& rMEvt ) override;
     virtual void    Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
-    virtual void    Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    virtual void    Draw( OutputDevice* pDev, const Point& rPos,SystemTextColorFlags nFlags ) override;
     virtual void    Resize() override;
     virtual void    StateChanged( StateChangedType nType ) override;
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
diff --git a/include/vcl/toolkit/vclmedit.hxx b/include/vcl/toolkit/vclmedit.hxx
index e5e32244c32b..3a7c4e274f2c 100644
--- a/include/vcl/toolkit/vclmedit.hxx
+++ b/include/vcl/toolkit/vclmedit.hxx
@@ -153,7 +153,7 @@ public:
     Size            CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
     void            GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
 
-    void            Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    void            Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
 
     void            DisableSelectionOnFocus();
 
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 8d918161c2e0..834f6a2d205c 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -327,19 +327,6 @@ namespace o3tl
     template<> struct typed_flags<GetFocusFlags> : is_typed_flags<GetFocusFlags, 0x077f> {};
 }
 
-
-// Flags for Draw()
-enum class DrawFlags
-{
-    NONE                = 0x0000,
-    Mono                = 0x0001,
-    NoControls          = 0x0004,
-};
-namespace o3tl
-{
-    template<> struct typed_flags<DrawFlags> : is_typed_flags<DrawFlags, 0x0005> {};
-}
-
 // DialogControl-Flags
 enum class DialogControlFlags
 {
@@ -758,7 +745,7 @@ public:
 
     void                                Erase(vcl::RenderContext& rRenderContext);
 
-    virtual void                        Draw( ::OutputDevice* pDev, const Point& rPos, DrawFlags nFlags );
+    virtual void                        Draw( ::OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags );
     virtual void                        Move();
     virtual void                        Resize();
     virtual void                        Activate();
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index ea1472c05f6a..c3c76bf65e5e 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -630,7 +630,7 @@ void BrowseBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
     }
 }
 
-void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags )
+void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags )
 {
     // we need pixel coordinates
     Size aRealSize = GetSizePixel();
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index 60946af94032..90b970615eb7 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -1196,7 +1196,7 @@ namespace svt
                                aBoxSize);
         pCheckBoxPaint->SetPosSizePixel(aRect.TopLeft(), aRect.GetSize());
 
-        pCheckBoxPaint->Draw(GetDataWindow().GetOutDev(), aRect.TopLeft(), DrawFlags::NONE);
+        pCheckBoxPaint->Draw(GetDataWindow().GetOutDev(), aRect.TopLeft(), SystemTextColorFlags::NONE);
     }
 
     void EditBrowseBox::AsynchGetFocus()
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index afa6504f1c32..f5eb27fbf2b8 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -948,7 +948,7 @@ void DbCellControl::AlignControl(sal_Int16 nAlignment)
 void DbCellControl::PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect)
 {
     m_pPainter->SetSizePixel(rRect.GetSize());
-    m_pPainter->Draw(&rDev, rRect.TopLeft(), DrawFlags::NONE);
+    m_pPainter->Draw(&rDev, rRect.TopLeft(), SystemTextColorFlags::NONE);
 }
 
 void DbCellControl::PaintFieldToCell( OutputDevice& _rDev, const tools::Rectangle& _rRect, const Reference< XColumn >& _rxField, const Reference< XNumberFormatter >& _rxFormatter )
diff --git a/toolkit/inc/controls/filectrl.hxx b/toolkit/inc/controls/filectrl.hxx
index 9c98a10c2335..1330d0ce7cb5 100644
--- a/toolkit/inc/controls/filectrl.hxx
+++ b/toolkit/inc/controls/filectrl.hxx
@@ -58,7 +58,7 @@ public:
     Edit&           GetEdit() { return *maEdit; }
     PushButton&     GetButton() { return *maButton; }
 
-    void            Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override;
+    void            Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
 
     void            SetText( const OUString& rStr ) override;
     OUString        GetText() const override;
diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx
index 42751be785cf..e5b74a7f5443 100644
--- a/toolkit/source/awt/vclxtabpagecontainer.cxx
+++ b/toolkit/source/awt/vclxtabpagecontainer.cxx
@@ -65,7 +65,7 @@ void SAL_CALL VCLXTabPageContainer::draw( sal_Int32 nX, sal_Int32 nY )
         {
             ::Point aPos( nX, nY );
             aPos  = pDev->PixelToLogic( aPos );
-            pTabPage->Draw( pDev, aPos, DrawFlags::NONE );
+            pTabPage->Draw( pDev, aPos, SystemTextColorFlags::NONE );
         }
     }
 
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 28eb6942fe6c..1292bcea88c0 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -2243,7 +2243,7 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY )
     {
         Point aPos( nX, nY );
         aPos = pDev->PixelToLogic( aPos );
-        pTabPage->Draw( pDev, aPos, DrawFlags::NONE );
+        pTabPage->Draw( pDev, aPos, SystemTextColorFlags::NONE );
         return;
     }
 
@@ -2298,7 +2298,7 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY )
                            || ( pPDFExport != nullptr );
         if ( bDrawSimple )
         {
-            pWindow->Draw( pDev, aP, DrawFlags::NoControls );
+            pWindow->Draw( pDev, aP, SystemTextColorFlags::NoControls );
         }
         else
         {
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index a8535b0fd258..6c786a5991ab 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2391,7 +2391,7 @@ void SAL_CALL VCLXDialog::draw( sal_Int32 nX, sal_Int32 nY )
             pDev = pWindow->GetParent()->GetOutDev();
 
         Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
-        pWindow->Draw( pDev, aPos, DrawFlags::NoControls );
+        pWindow->Draw( pDev, aPos, SystemTextColorFlags::NoControls );
     }
 }
 
@@ -2512,7 +2512,7 @@ void SAL_CALL VCLXMultiPage::draw( sal_Int32 nX, sal_Int32 nY )
             pDev = pWindow->GetParent()->GetOutDev();
 
         Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
-        pWindow->Draw( pDev, aPos, DrawFlags::NoControls );
+        pWindow->Draw( pDev, aPos, SystemTextColorFlags::NoControls );
     }
 }
 
@@ -2757,7 +2757,7 @@ void SAL_CALL VCLXTabPage::draw( sal_Int32 nX, sal_Int32 nY )
             pDev = pWindow->GetParent()->GetOutDev();
 
         Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
-        pWindow->Draw( pDev, aPos, DrawFlags::NoControls );
+        pWindow->Draw( pDev, aPos, SystemTextColorFlags::NoControls );
     }
 }
 
@@ -6245,7 +6245,7 @@ void SAL_CALL VCLXFrame::draw( sal_Int32 nX, sal_Int32 nY )
             pDev = pWindow->GetParent()->GetOutDev();
 
         Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
-        pWindow->Draw( pDev, aPos, DrawFlags::NoControls );
+        pWindow->Draw( pDev, aPos, SystemTextColorFlags::NoControls );
     }
 }
 
diff --git a/toolkit/source/controls/filectrl.cxx b/toolkit/source/controls/filectrl.cxx
index e2bc14ed0311..0827f9127d47 100644
--- a/toolkit/source/controls/filectrl.cxx
+++ b/toolkit/source/controls/filectrl.cxx
@@ -188,7 +188,7 @@ void FileControl::SetEditModifyHdl( const Link<Edit&,void>& rLink )
     maEdit->SetModifyHdl(rLink);
 }
 
-void FileControl::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags )
+void FileControl::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags )
 {
     WinBits nOldEditStyle = GetEdit().GetStyle();
     if ( GetStyle() & WB_BORDER )
diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx
index ed84ae7ac456..bc70ba11ac25 100644
--- a/vcl/qa/cppunit/outdev.cxx
+++ b/vcl/qa/cppunit/outdev.cxx
@@ -48,6 +48,7 @@ public:
     void testDefaultFillColor();
     void testTransparentFillColor();
     void testFillColor();
+    void testSystemTextColor();
 
     CPPUNIT_TEST_SUITE(VclOutdevTest);
     CPPUNIT_TEST(testVirtualDevice);
@@ -69,6 +70,7 @@ public:
     CPPUNIT_TEST(testDefaultFillColor);
     CPPUNIT_TEST(testTransparentFillColor);
     CPPUNIT_TEST(testFillColor);
+    CPPUNIT_TEST(testSystemTextColor);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -529,6 +531,24 @@ void VclOutdevTest::testFillColor()
     CPPUNIT_ASSERT_EQUAL(COL_RED, rColor);
 }
 
+void VclOutdevTest::testSystemTextColor()
+{
+    {
+        ScopedVclPtrInstance<VirtualDevice> pVDev;
+
+        pVDev->SetSystemTextColor(SystemTextColorFlags::NONE, true);
+        CPPUNIT_ASSERT_EQUAL(COL_BLACK, pVDev->GetTextColor());
+        pVDev->SetSystemTextColor(SystemTextColorFlags::Mono, false);
+        CPPUNIT_ASSERT_EQUAL(COL_BLACK, pVDev->GetTextColor());
+    }
+
+    {
+        ScopedVclPtrInstance<Printer> pPrinter;
+        pPrinter->SetSystemTextColor(SystemTextColorFlags::NONE, true);
+        CPPUNIT_ASSERT_EQUAL(COL_BLACK, pPrinter->GetTextColor());
+    }
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(VclOutdevTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
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<FixedText*>(this)->GetOutDev(), DrawFlags::NONE, Point(), GetOutputSizePixel(), true);
+    ImplDraw(const_cast<FixedText*>(this)->GetOutDev(), SystemTextColorFlags::NONE, Point(), GetOutputSizePixel(), true);
     //const_cast<FixedText*>(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();
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 18fad279898b..03ed860bdaca 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -1257,7 +1257,7 @@ void VclMultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt )
         Control::DataChanged( rDCEvt );
 }
 
-void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags )
+void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags )
 {
     ImplInitSettings(true);
 
@@ -1266,7 +1266,6 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nF
 
     vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetDrawPixelFont(pDev);
     aFont.SetTransparent( true );
-    OutDevType eOutDevType = pDev->GetOutDevType();
 
     pDev->Push();
     pDev->SetMapMode();
@@ -1293,21 +1292,7 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nF
         }
     }
 
-    // contents
-    if ( ( nFlags & DrawFlags::Mono ) || ( eOutDevType == OUTDEV_PRINTER ) )
-        pDev->SetTextColor( COL_BLACK );
-    else
-    {
-        if ( !IsEnabled() )
-        {
-            const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-            pDev->SetTextColor( rStyleSettings.GetDisableColor() );
-        }
-        else
-        {
-            pDev->SetTextColor( GetTextColor() );
-        }
-    }
+    pDev->SetSystemTextColor(nFlags, IsEnabled());
 
     OUString aText = GetText();
     Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() );
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 90b74a3f6d92..84a2a27a92b2 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1750,4 +1750,9 @@ css::awt::DeviceInfo Printer::GetDeviceInfo() const
     return aInfo;
 }
 
+void Printer::SetSystemTextColor(SystemTextColorFlags, bool)
+{
+    SetTextColor(COL_BLACK);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index b8cc324e14e9..f8ef45e59ea0 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -2399,4 +2399,20 @@ bool OutputDevice::GetTextOutline( tools::PolyPolygon& rPolyPoly, const OUString
     return true;
 }
 
+void OutputDevice::SetSystemTextColor(SystemTextColorFlags nFlags, bool bEnabled)
+{
+    if (nFlags & SystemTextColorFlags::Mono)
+    {
+        SetTextColor(COL_BLACK);
+    }
+    else
+    {
+        if (!bEnabled)
+        {
+            const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+            SetTextColor(rStyleSettings.GetDisableColor());
+        }
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/toolkit/group.cxx b/vcl/source/toolkit/group.cxx
index 9b6099c3e285..b33da711fae3 100644
--- a/vcl/source/toolkit/group.cxx
+++ b/vcl/source/toolkit/group.cxx
@@ -87,7 +87,7 @@ GroupBox::GroupBox( vcl::Window* pParent, WinBits nStyle ) :
     ImplInit( pParent, nStyle );
 }
 
-void GroupBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
+void GroupBox::ImplDraw( OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags,
                          const Point& rPos, const Size& rSize, bool bLayout )
 {
     tools::Long                    nTop;
@@ -101,11 +101,11 @@ void GroupBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
         nTextStyle &= ~DrawTextFlags::Mnemonic;
     if ( !IsEnabled() )
         nTextStyle |= DrawTextFlags::Disable;
-    if ( (nDrawFlags & DrawFlags::Mono) ||
+    if ( (nSystemTextColorFlags & SystemTextColorFlags::Mono) ||
          (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) )
     {
         nTextStyle |= DrawTextFlags::Mono;
-        nDrawFlags |= DrawFlags::Mono;
+        nSystemTextColorFlags |= SystemTextColorFlags::Mono;
     }
 
     if (aText.isEmpty())
@@ -125,7 +125,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
 
     if( ! bLayout )
     {
-        if ( nDrawFlags & DrawFlags::Mono )
+        if ( nSystemTextColorFlags & SystemTextColorFlags::Mono )
             pDev->SetLineColor( COL_BLACK );
         else
             pDev->SetLineColor( rStyleSettings.GetShadowColor() );
@@ -144,7 +144,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
         bool bIsPrinter = OUTDEV_PRINTER == pDev->GetOutDevType();
         // if we're drawing onto a printer, spare the 3D effect #i46986#
 
-        if ( !bIsPrinter && !(nDrawFlags & DrawFlags::Mono) )
+        if ( !bIsPrinter && !(nSystemTextColorFlags & SystemTextColorFlags::Mono) )
         {
             pDev->SetLineColor( rStyleSettings.GetLightColor() );
             if (aText.isEmpty())
@@ -168,16 +168,16 @@ void GroupBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
 void GroupBox::FillLayoutData() const
 {
     mxLayoutData.emplace();
-    const_cast<GroupBox*>(this)->ImplDraw( const_cast<GroupBox*>(this)->GetOutDev(), DrawFlags::NONE, Point(), GetOutputSizePixel(), true );
+    const_cast<GroupBox*>(this)->ImplDraw( const_cast<GroupBox*>(this)->GetOutDev(), SystemTextColorFlags::NONE, Point(), GetOutputSizePixel(), true );
 }
 
 void GroupBox::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& )
 {
-    ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel());
+    ImplDraw(&rRenderContext, SystemTextColorFlags::NONE, Point(), GetOutputSizePixel());
 }
 
 void GroupBox::Draw( OutputDevice* pDev, const Point& rPos,
-                     DrawFlags nFlags )
+                     SystemTextColorFlags nFlags )
 {
     Point       aPos  = pDev->LogicToPixel( rPos );
     Size        aSize = GetSizePixel();
@@ -186,7 +186,7 @@ void GroupBox::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/treelist/headbar.cxx b/vcl/source/treelist/headbar.cxx
index 91cb86cc73ca..ae0928231f96 100644
--- a/vcl/source/treelist/headbar.cxx
+++ b/vcl/source/treelist/headbar.cxx
@@ -875,7 +875,7 @@ void HeaderBar::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
 }
 
 void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos,
-                      DrawFlags nFlags )
+                      SystemTextColorFlags nFlags )
 {
     Point       aPos  = pDev->LogicToPixel( rPos );
     Size        aSize = GetSizePixel();
@@ -885,7 +885,7 @@ void HeaderBar::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/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 50717d9da058..1a4d179e1809 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1320,7 +1320,7 @@ void Dialog::GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
     aImplWin->GetBorder( rLeftBorder, rTopBorder, rRightBorder, rBottomBorder );
 }
 
-void Dialog::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags )
+void Dialog::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags )
 {
     Point aPos = pDev->LogicToPixel( rPos );
     Size aSize = GetSizePixel();
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index 784c2366bf48..08e0eebbe0a5 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -162,7 +162,7 @@ void TabPage::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle&
             aControlValue, OUString() );
 }
 
-void TabPage::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags )
+void TabPage::Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags )
 {
     Point aPos = pDev->LogicToPixel( rPos );
     Size aSize = GetSizePixel();
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index bfeb09d64068..3f4f76479483 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1816,7 +1816,7 @@ void Window::KeyUp( const KeyEvent& rKEvt )
         mpWindowImpl->mbKeyUp = true;
 }
 
-void Window::Draw( OutputDevice*, const Point&, DrawFlags )
+void Window::Draw( OutputDevice*, const Point&, SystemTextColorFlags )
 {
 }
 


More information about the Libreoffice-commits mailing list