accessibility/inc/pch/precompiled_acc.hxx                  |   10 +
 basctl/inc/pch/precompiled_basctl.hxx                      |   12 +
 basic/inc/pch/precompiled_sb.hxx                           |   10 +
 basic/source/runtime/inputbox.cxx                          |    2 
 canvas/source/cairo/cairo_canvashelper_text.cxx            |   12 -
 canvas/source/cairo/cairo_textlayout.cxx                   |   10 -
 canvas/source/vcl/canvashelper.cxx                         |   12 -
 canvas/source/vcl/canvashelper_texturefill.cxx             |    8 -
 canvas/source/vcl/spritecanvashelper.cxx                   |    2 
 canvas/source/vcl/spritehelper.cxx                         |    2 
 canvas/source/vcl/textlayout.cxx                           |   10 -
 chart2/inc/pch/precompiled_chartcontroller.hxx             |   21 ++-
 chart2/inc/pch/precompiled_chartcore.hxx                   |    9 -
 cppcanvas/source/inc/implrenderer.hxx                      |    2 
 cppcanvas/source/inc/outdevstate.hxx                       |    7 -
 cppcanvas/source/mtfrenderer/implrenderer.cxx              |   54 ++++----
 cui/inc/pch/precompiled_cui.hxx                            |   33 ++++-
 cui/source/dialogs/hangulhanjadlg.cxx                      |    2 
 cui/source/tabpages/grfpage.cxx                            |    2 
 cui/source/tabpages/numfmt.cxx                             |    2 
 dbaccess/inc/pch/precompiled_dbu.hxx                       |   11 -
 dbaccess/source/ui/browser/dataview.cxx                    |    2 
 dbaccess/source/ui/tabledesign/TEditControl.cxx            |    2 
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx        |    2 
 drawinglayer/inc/wmfemfhelper.hxx                          |   16 +-
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |    8 -
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx    |    6 
 drawinglayer/source/processor2d/vclprocessor2d.cxx         |   12 -
 drawinglayer/source/tools/wmfemfhelper.cxx                 |   48 +++----
 editeng/source/editeng/impedit.cxx                         |    4 
 editeng/source/editeng/impedit2.cxx                        |    2 
 editeng/source/editeng/impedit3.cxx                        |   20 +--
 editeng/source/outliner/outliner.cxx                       |    6 
 emfio/inc/mtftools.hxx                                     |   10 -
 emfio/source/reader/emfreader.cxx                          |    4 
 emfio/source/reader/mtftools.cxx                           |   12 -
 emfio/source/reader/wmfreader.cxx                          |    4 
 filter/source/svg/svgwriter.cxx                            |   22 +--
 filter/source/svg/svgwriter.hxx                            |   10 -
 forms/source/richtext/richtextimplcontrol.cxx              |    4 
 framework/inc/pch/precompiled_fwk.hxx                      |   14 +-
 include/sfx2/LokControlHandler.hxx                         |    2 
 include/vcl/metaact.hxx                                    |   20 +--
 include/vcl/outdev.hxx                                     |   12 -
 include/vcl/pdfwriter.hxx                                  |    2 
 include/vcl/rendercontext/State.hxx                        |   83 ++++++++-----
 oox/inc/pch/precompiled_oox.hxx                            |   19 ++
 reportdesign/inc/pch/precompiled_rpt.hxx                   |   25 +++
 reportdesign/inc/pch/precompiled_rptui.hxx                 |   22 ++-
 reportdesign/source/ui/inc/ColorChanger.hxx                |    2 
 reportdesign/source/ui/report/StartMarker.cxx              |    4 
 sc/source/ui/cctrl/dpcontrol.cxx                           |    2 
 sc/source/ui/dbgui/csvcontrol.cxx                          |    2 
 sc/source/ui/docshell/docsh4.cxx                           |    4 
 sc/source/ui/miscdlgs/autofmt.cxx                          |    4 
 sc/source/ui/view/tabsplit.cxx                             |    2 
 sd/inc/pch/precompiled_sdui.hxx                            |   22 ++-
 sd/source/ui/animations/CustomAnimationList.cxx            |    2 
 sd/source/ui/dlg/animobjs.cxx                              |    2 
 sd/source/ui/view/drviewsh.cxx                             |    2 
 sfx2/source/appl/newhelp.cxx                               |    2 
 sfx2/source/control/recentdocsview.cxx                     |    2 
 sfx2/source/control/thumbnailview.cxx                      |    2 
 sfx2/source/dialog/StyleList.cxx                           |    4 
 sfx2/source/dialog/titledockwin.cxx                        |    2 
 sfx2/source/view/lokcharthelper.cxx                        |    4 
 slideshow/inc/pch/precompiled_slideshow.hxx                |   26 ++--
 solenv/clang-format/excludelist                            |    1 
 starmath/inc/pch/precompiled_sm.hxx                        |   24 ++-
 starmath/source/ElementsDockingWindow.cxx                  |    6 
 starmath/source/dialog.cxx                                 |    2 
 starmath/source/document.cxx                               |   12 -
 starmath/source/node.cxx                                   |    2 
 starmath/source/rect.cxx                                   |    4 
 starmath/source/tmpdevice.cxx                              |    4 
 starmath/source/visitors.cxx                               |    8 -
 svtools/source/brwbox/brwbox2.cxx                          |    8 -
 svtools/source/control/ctrlbox.cxx                         |    4 
 svtools/source/control/ruler.cxx                           |    2 
 svtools/source/control/scriptedtext.cxx                    |    4 
 svtools/source/control/tabbar.cxx                          |    2 
 svtools/source/table/gridtablerenderer.cxx                 |   10 -
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx    |    2 
 svx/source/dialog/_bmpmask.cxx                             |    2 
 svx/source/dialog/connctrl.cxx                             |    2 
 svx/source/dialog/contwnd.cxx                              |    4 
 svx/source/dialog/dlgctrl.cxx                              |    4 
 svx/source/dialog/fntctrl.cxx                              |    2 
 svx/source/dialog/measctrl.cxx                             |    6 
 svx/source/dialog/pagectrl.cxx                             |    4 
 svx/source/dialog/paraprev.cxx                             |    2 
 svx/source/dialog/rubydialog.cxx                           |    2 
 svx/source/dialog/weldeditview.cxx                         |    2 
 svx/source/form/filtnav.cxx                                |    8 -
 svx/source/sdr/contact/objectcontactofpageview.cxx         |    4 
 svx/source/styles/CommonStylePreviewRenderer.cxx           |    2 
 svx/source/tbxctrls/StylesPreviewWindow.cxx                |    3 
 svx/source/tbxctrls/layctrl.cxx                            |    4 
 svx/source/tbxctrls/tbcontrl.cxx                           |    4 
 svx/source/tbxctrls/tbxcolorupdate.cxx                     |    2 
 sw/inc/pch/precompiled_msword.hxx                          |   33 ++---
 sw/inc/pch/precompiled_swui.hxx                            |   19 ++
 sw/inc/pch/precompiled_vbaswobj.hxx                        |   22 ++-
 sw/source/core/doc/notxtfrm.cxx                            |    2 
 sw/source/core/draw/dflyobj.cxx                            |    2 
 sw/source/core/inc/txtfrm.hxx                              |    2 
 sw/source/core/layout/layact.cxx                           |    2 
 sw/source/core/layout/paintfrm.cxx                         |   16 +-
 sw/source/core/text/EnhancedPDFExportHelper.cxx            |    2 
 sw/source/core/text/inftxt.cxx                             |   18 +-
 sw/source/core/text/itradj.cxx                             |    4 
 sw/source/core/text/porlin.cxx                             |    2 
 sw/source/core/text/portxt.cxx                             |    2 
 sw/source/core/text/txtfrm.cxx                             |    6 
 sw/source/core/txtnode/fntcache.cxx                        |    6 
 sw/source/core/txtnode/fntcap.cxx                          |    4 
 sw/source/core/txtnode/swfont.cxx                          |    2 
 sw/source/core/view/vdraw.cxx                              |    2 
 sw/source/core/view/viewsh.cxx                             |    4 
 sw/source/core/view/vprint.cxx                             |    2 
 sw/source/filter/ww8/ww8par3.cxx                           |    2 
 sw/source/ui/chrdlg/drpcps.cxx                             |    2 
 sw/source/ui/table/autoformatpreview.cxx                   |    4 
 sw/source/uibase/docvw/AnnotationWin2.cxx                  |   10 -
 sw/source/uibase/docvw/PostItMgr.cxx                       |    2 
 sw/source/uibase/docvw/SidebarTxtControl.cxx               |    2 
 sw/source/uibase/frmdlg/colex.cxx                          |    4 
 sw/source/uibase/utlui/unotools.cxx                        |    2 
 vbahelper/inc/pch/precompiled_msforms.hxx                  |    9 +
 vcl/backendtest/VisualBackendTest.cxx                      |    2 
 vcl/inc/pdf/pdfwriter_impl.hxx                             |    6 
 vcl/qa/cppunit/outdev.cxx                                  |   21 +--
 vcl/qa/cppunit/svm/svmtest.cxx                             |    6 
 vcl/source/app/help.cxx                                    |    4 
 vcl/source/control/button.cxx                              |   10 -
 vcl/source/control/ctrl.cxx                                |    4 
 vcl/source/control/edit.cxx                                |    6 
 vcl/source/control/fixed.cxx                               |    2 
 vcl/source/control/imivctl1.cxx                            |    4 
 vcl/source/control/scrbar.cxx                              |    4 
 vcl/source/edit/texteng.cxx                                |    4 
 vcl/source/filter/ieps/ieps.cxx                            |    2 
 vcl/source/filter/imet/ios2met.cxx                         |    6 
 vcl/source/filter/svm/SvmConverter.cxx                     |   14 +-
 vcl/source/filter/svm/SvmReader.cxx                        |    4 
 vcl/source/filter/wmf/emfwr.cxx                            |    8 -
 vcl/source/filter/wmf/wmfwr.cxx                            |   24 +--
 vcl/source/filter/wmf/wmfwr.hxx                            |    2 
 vcl/source/gdi/gdimetafiletools.cxx                        |   14 +-
 vcl/source/gdi/gdimtf.cxx                                  |   12 -
 vcl/source/gdi/graph.cxx                                   |    4 
 vcl/source/gdi/metaact.cxx                                 |    8 -
 vcl/source/gdi/mtfxmldump.cxx                              |   44 +++---
 vcl/source/gdi/pdfwriter.cxx                               |    2 
 vcl/source/gdi/pdfwriter_impl.cxx                          |    4 
 vcl/source/gdi/print.cxx                                   |    6 
 vcl/source/gdi/print2.cxx                                  |    2 
 vcl/source/gdi/textlayout.cxx                              |    8 -
 vcl/source/gdi/virdev.cxx                                  |    2 
 vcl/source/graphic/GraphicObject.cxx                       |    4 
 vcl/source/graphic/GraphicObject2.cxx                      |    2 
 vcl/source/outdev/bitmap.cxx                               |    2 
 vcl/source/outdev/gradient.cxx                             |    8 -
 vcl/source/outdev/hatch.cxx                                |    4 
 vcl/source/outdev/outdev.cxx                               |    4 
 vcl/source/outdev/rect.cxx                                 |    2 
 vcl/source/outdev/stack.cxx                                |   64 +++++-----
 vcl/source/outdev/text.cxx                                 |   20 +--
 vcl/source/outdev/textline.cxx                             |    6 
 vcl/source/outdev/transparent.cxx                          |    8 -
 vcl/source/outdev/wallpaper.cxx                            |    4 
 vcl/source/treelist/headbar.cxx                            |    2 
 vcl/source/treelist/svimpbox.cxx                           |    2 
 vcl/source/window/decoview.cxx                             |    6 
 vcl/source/window/menubarwindow.cxx                        |    4 
 vcl/source/window/menufloatingwindow.cxx                   |    4 
 vcl/source/window/paint.cxx                                |   32 ++---
 vcl/source/window/status.cxx                               |    4 
 vcl/source/window/toolbox.cxx                              |    6 
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx             |    4 
 vcl/workben/vcldemo.cxx                                    |    8 -
 writerfilter/source/dmapper/SdtHelper.cxx                  |    2 
 182 files changed, 840 insertions(+), 658 deletions(-)

New commits:
commit 4dd6af856d574ad66ebb4b822a36ba70af9945e2
Author:     Chris Sherlock <chris.sherloc...@gmail.com>
AuthorDate: Fri Sep 3 02:19:33 2021 +1000
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue Sep 28 08:20:32 2021 +0200

    vcl: rename OutDevState to Stack
    
    I have moved the header file to include/vcl/rendercontext as this will
    eventually be part of the RenderContext split from OutputDevice.
    
    State and associated enums have also been moved to the vcl namespace. I
    have also moved ComplexTextLayoutFlags into the vcl::text namespace.
    
    Change-Id: I0abbf560e75b45a272854b267e948c240cd69091
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/accessibility/inc/pch/precompiled_acc.hxx 
b/accessibility/inc/pch/precompiled_acc.hxx
index 00b8a7fd98a0..661e6e4149ef 100644
--- a/accessibility/inc/pch/precompiled_acc.hxx
+++ b/accessibility/inc/pch/precompiled_acc.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-05-14 22:14:17 using:
+ Generated on 2021-09-12 11:50:46 using:
  ./bin/update_pch accessibility acc --cutoff=4 --exclude:system 
--include:module --include:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -42,6 +42,7 @@
 #include <map>
 #include <math.h>
 #include <memory>
+#include <mutex>
 #include <new>
 #include <numeric>
 #include <optional>
@@ -117,7 +118,6 @@
 #include <vcl/menu.hxx>
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/outdev.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/quickselectionengine.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
@@ -129,7 +129,10 @@
 #include <vcl/rendercontext/GetDefaultFontFlags.hxx>
 #include <vcl/rendercontext/ImplMapRes.hxx>
 #include <vcl/rendercontext/InvertFlags.hxx>
+#include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
 #include <vcl/salgtype.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <vcl/scopedbitmapaccess.hxx>
@@ -165,6 +168,8 @@
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/range/b2drange.hxx>
 #include <basegfx/range/basicrange.hxx>
+#include <basegfx/tuple/Tuple2D.hxx>
+#include <basegfx/tuple/Tuple3D.hxx>
 #include <basegfx/tuple/b2dtuple.hxx>
 #include <basegfx/tuple/b2ituple.hxx>
 #include <basegfx/tuple/b3dtuple.hxx>
@@ -183,6 +188,7 @@
 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
 #include <com/sun/star/accessibility/XAccessibleContext2.hpp>
+#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
 #include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
 #include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp>
diff --git a/basctl/inc/pch/precompiled_basctl.hxx 
b/basctl/inc/pch/precompiled_basctl.hxx
index 50164e694ce2..c05c18d8f7a9 100644
--- a/basctl/inc/pch/precompiled_basctl.hxx
+++ b/basctl/inc/pch/precompiled_basctl.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-08-22 14:51:38 using:
+ Generated on 2021-09-28 06:05:45 using:
  ./bin/update_pch basctl basctl --cutoff=3 --exclude:system --include:module 
--exclude:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -136,7 +136,6 @@
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/metric.hxx>
 #include <vcl/outdev.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/prntypes.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
@@ -148,7 +147,10 @@
 #include <vcl/rendercontext/GetDefaultFontFlags.hxx>
 #include <vcl/rendercontext/ImplMapRes.hxx>
 #include <vcl/rendercontext/InvertFlags.hxx>
+#include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
 #include <vcl/salgtype.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <vcl/scopedbitmapaccess.hxx>
@@ -263,13 +265,17 @@
 #include <com/sun/star/frame/XToolbarController.hpp>
 #include <com/sun/star/graphic/XPrimitive2D.hpp>
 #include <com/sun/star/i18n/Calendar2.hpp>
+#include <com/sun/star/i18n/DirectionProperty.hpp>
 #include <com/sun/star/i18n/ForbiddenCharacters.hpp>
+#include <com/sun/star/i18n/KCharacterType.hpp>
 #include <com/sun/star/i18n/LanguageCountryInfo.hpp>
 #include <com/sun/star/i18n/LocaleDataItem2.hpp>
 #include <com/sun/star/i18n/LocaleItem.hpp>
 #include <com/sun/star/i18n/NativeNumberXmlAttributes.hpp>
+#include <com/sun/star/i18n/ParseResult.hpp>
 #include <com/sun/star/i18n/TransliterationModules.hpp>
 #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
+#include <com/sun/star/i18n/UnicodeScript.hpp>
 #include <com/sun/star/i18n/WordType.hpp>
 #include <com/sun/star/i18n/XNumberFormatCode.hpp>
 #include <com/sun/star/i18n/reservedWords.hpp>
@@ -322,6 +328,7 @@
 #include <com/sun/star/view/PrintableState.hpp>
 #include <comphelper/accessiblecomponenthelper.hxx>
 #include <comphelper/accessiblecontexthelper.hxx>
+#include <comphelper/accessibleeventnotifier.hxx>
 #include <comphelper/broadcasthelper.hxx>
 #include <comphelper/comphelperdllapi.h>
 #include <comphelper/interfacecontainer2.hxx>
@@ -526,6 +533,7 @@
 #include <uno/lbnames.h>
 #include <uno/sequence2.h>
 #include <unotools/calendarwrapper.hxx>
+#include <unotools/charclass.hxx>
 #include <unotools/configitem.hxx>
 #include <unotools/fontdefs.hxx>
 #include <unotools/localedatawrapper.hxx>
diff --git a/basic/inc/pch/precompiled_sb.hxx b/basic/inc/pch/precompiled_sb.hxx
index 450e386e5f19..d327c88c5f58 100644
--- a/basic/inc/pch/precompiled_sb.hxx
+++ b/basic/inc/pch/precompiled_sb.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-05-14 22:14:54 using:
+ Generated on 2021-09-12 11:49:52 using:
  ./bin/update_pch basic sb --cutoff=2 --exclude:system --exclude:module 
--include:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -40,10 +40,12 @@
 #include <osl/thread.h>
 #include <osl/time.h>
 #include <rtl/character.hxx>
+#include <rtl/math.h>
 #include <rtl/math.hxx>
 #include <rtl/string.hxx>
 #include <rtl/textenc.h>
 #include <rtl/ustrbuf.hxx>
+#include <rtl/ustring.h>
 #include <rtl/ustring.hxx>
 #include <sal/log.hxx>
 #include <sal/saldllapi.h>
@@ -58,7 +60,6 @@
 #include <vcl/mapmod.hxx>
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/outdev.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
 #include <vcl/rendercontext/AntialiasingFlags.hxx>
@@ -69,7 +70,10 @@
 #include <vcl/rendercontext/GetDefaultFontFlags.hxx>
 #include <vcl/rendercontext/ImplMapRes.hxx>
 #include <vcl/rendercontext/InvertFlags.hxx>
+#include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/svapp.hxx>
@@ -84,6 +88,7 @@
 #include <basegfx/vector/b2enums.hxx>
 #include <com/sun/star/awt/DeviceInfo.hpp>
 #include <com/sun/star/drawing/LineCap.hpp>
+#include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/uno/Reference.hxx>
@@ -97,6 +102,7 @@
 #include <o3tl/float_int_conversion.hxx>
 #include <o3tl/safeint.hxx>
 #include <svl/SfxBroadcaster.hxx>
+#include <svl/numformat.hxx>
 #include <svl/zforlist.hxx>
 #include <tools/color.hxx>
 #include <tools/debug.hxx>
diff --git a/basic/source/runtime/inputbox.cxx 
b/basic/source/runtime/inputbox.cxx
index e409b1352bfd..36d604298bad 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -78,7 +78,7 @@ void SvRTLInputBox::PositionDialog(tools::Long nXTwips, 
tools::Long nYTwips)
     {
         Point aDlgPosApp( nXTwips, nYTwips );
         OutputDevice* pDefaultDevice = Application::GetDefaultDevice();
-        pDefaultDevice->Push(PushFlags::MAPMODE);
+        pDefaultDevice->Push(vcl::PushFlags::MAPMODE);
         pDefaultDevice->SetMapMode(MapMode( MapUnit::MapAppFont));
         aDlgPosApp = pDefaultDevice->LogicToPixel(aDlgPosApp, 
MapMode(MapUnit::MapTwip));
         pDefaultDevice->Pop();
diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx 
b/canvas/source/cairo/cairo_canvashelper_text.cxx
index 2763800d5283..c5f387e27c60 100644
--- a/canvas/source/cairo/cairo_canvashelper_text.cxx
+++ b/canvas/source/cairo/cairo_canvashelper_text.cxx
@@ -226,21 +226,21 @@ namespace cairocanvas
                 return uno::Reference< rendering::XCachedPrimitive >(nullptr); 
// no output necessary
 
                 // change text direction and layout mode
-            ComplexTextLayoutFlags 
nLayoutMode(ComplexTextLayoutFlags::Default);
+            vcl::text::ComplexTextLayoutFlags 
nLayoutMode(vcl::text::ComplexTextLayoutFlags::Default);
             switch( textDirection )
             {
                 case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
                 case rendering::TextDirection::STRONG_LEFT_TO_RIGHT:
-                    nLayoutMode |= ComplexTextLayoutFlags::BiDiStrong;
-                    nLayoutMode |= ComplexTextLayoutFlags::TextOriginLeft;
+                    nLayoutMode |= 
vcl::text::ComplexTextLayoutFlags::BiDiStrong;
+                    nLayoutMode |= 
vcl::text::ComplexTextLayoutFlags::TextOriginLeft;
                     break;
 
                 case rendering::TextDirection::WEAK_RIGHT_TO_LEFT:
-                    nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl;
+                    nLayoutMode |= vcl::text::ComplexTextLayoutFlags::BiDiRtl;
                     [[fallthrough]];
                 case rendering::TextDirection::STRONG_RIGHT_TO_LEFT:
-                    nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | 
ComplexTextLayoutFlags::BiDiStrong;
-                    nLayoutMode |= ComplexTextLayoutFlags::TextOriginRight;
+                    nLayoutMode |= vcl::text::ComplexTextLayoutFlags::BiDiRtl 
| vcl::text::ComplexTextLayoutFlags::BiDiStrong;
+                    nLayoutMode |= 
vcl::text::ComplexTextLayoutFlags::TextOriginRight;
                     break;
             }
 
diff --git a/canvas/source/cairo/cairo_textlayout.cxx 
b/canvas/source/cairo/cairo_textlayout.cxx
index 6a1bfc27eece..9952d33d343c 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -46,19 +46,19 @@ namespace cairocanvas
                               sal_Int8      nTextDirection )
         {
             // TODO(P3): avoid if already correctly set
-            ComplexTextLayoutFlags nLayoutMode = 
ComplexTextLayoutFlags::Default;
+            vcl::text::ComplexTextLayoutFlags nLayoutMode = 
vcl::text::ComplexTextLayoutFlags::Default;
             switch( nTextDirection )
             {
                 case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
                     break;
                 case rendering::TextDirection::STRONG_LEFT_TO_RIGHT:
-                    nLayoutMode = ComplexTextLayoutFlags::BiDiStrong;
+                    nLayoutMode = 
vcl::text::ComplexTextLayoutFlags::BiDiStrong;
                     break;
                 case rendering::TextDirection::WEAK_RIGHT_TO_LEFT:
-                    nLayoutMode = ComplexTextLayoutFlags::BiDiRtl;
+                    nLayoutMode = vcl::text::ComplexTextLayoutFlags::BiDiRtl;
                     break;
                 case rendering::TextDirection::STRONG_RIGHT_TO_LEFT:
-                    nLayoutMode = ComplexTextLayoutFlags::BiDiRtl | 
ComplexTextLayoutFlags::BiDiStrong;
+                    nLayoutMode = vcl::text::ComplexTextLayoutFlags::BiDiRtl | 
vcl::text::ComplexTextLayoutFlags::BiDiStrong;
                     break;
                 default:
                     break;
@@ -66,7 +66,7 @@ namespace cairocanvas
 
             // set calculated layout mode. Origin is always the left edge,
             // as required at the API spec
-            rOutDev.SetLayoutMode( nLayoutMode | 
ComplexTextLayoutFlags::TextOriginLeft );
+            rOutDev.SetLayoutMode( nLayoutMode | 
vcl::text::ComplexTextLayoutFlags::TextOriginLeft );
         }
     }
 
diff --git a/canvas/source/vcl/canvashelper.cxx 
b/canvas/source/vcl/canvashelper.cxx
index 04fd39b95e70..69ef1922de5a 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -565,21 +565,21 @@ namespace vclcanvas
                 return uno::Reference< rendering::XCachedPrimitive >(nullptr); 
// no output necessary
 
             // change text direction and layout mode
-            ComplexTextLayoutFlags 
nLayoutMode(ComplexTextLayoutFlags::Default);
+            vcl::text::ComplexTextLayoutFlags 
nLayoutMode(vcl::text::ComplexTextLayoutFlags::Default);
             switch( textDirection )
             {
                 case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
                 case rendering::TextDirection::STRONG_LEFT_TO_RIGHT:
-                    nLayoutMode |= ComplexTextLayoutFlags::BiDiStrong;
-                    nLayoutMode |= ComplexTextLayoutFlags::TextOriginLeft;
+                    nLayoutMode |= 
vcl::text::ComplexTextLayoutFlags::BiDiStrong;
+                    nLayoutMode |= 
vcl::text::ComplexTextLayoutFlags::TextOriginLeft;
                     break;
 
                 case rendering::TextDirection::WEAK_RIGHT_TO_LEFT:
-                    nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl;
+                    nLayoutMode |= vcl::text::ComplexTextLayoutFlags::BiDiRtl;
                     [[fallthrough]];
                 case rendering::TextDirection::STRONG_RIGHT_TO_LEFT:
-                    nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | 
ComplexTextLayoutFlags::BiDiStrong;
-                    nLayoutMode |= ComplexTextLayoutFlags::TextOriginRight;
+                    nLayoutMode |= vcl::text::ComplexTextLayoutFlags::BiDiRtl 
| vcl::text::ComplexTextLayoutFlags::BiDiStrong;
+                    nLayoutMode |= 
vcl::text::ComplexTextLayoutFlags::TextOriginRight;
                     break;
             }
 
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx 
b/canvas/source/vcl/canvashelper_texturefill.cxx
index b397ffcb7d2e..f181fe30669b 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -526,7 +526,7 @@ namespace vclcanvas
                 // poly-polygons, and don't have to output the gradient
                 // twice for XOR
 
-                rOutDev.Push( PushFlags::CLIPREGION );
+                rOutDev.Push( vcl::PushFlags::CLIPREGION );
                 rOutDev.IntersectClipRegion( aPolygonDeviceRectOrig );
                 doGradientFill( rOutDev,
                                 rValues,
@@ -550,7 +550,7 @@ namespace vclcanvas
             {
                 const vcl::Region aPolyClipRegion( rPoly );
 
-                rOutDev.Push( PushFlags::CLIPREGION );
+                rOutDev.Push( vcl::PushFlags::CLIPREGION );
                 rOutDev.IntersectClipRegion( aPolyClipRegion );
 
                 doGradientFill( rOutDev,
@@ -1030,7 +1030,7 @@ namespace vclcanvas
                         {
                             const vcl::Region aPolyClipRegion( aPolyPoly );
 
-                            rOutDev.Push( PushFlags::CLIPREGION );
+                            rOutDev.Push( vcl::PushFlags::CLIPREGION );
                             rOutDev.IntersectClipRegion( aPolyClipRegion );
 
                             textureFill( rOutDev,
@@ -1047,7 +1047,7 @@ namespace vclcanvas
                             if( mp2ndOutDevProvider )
                             {
                                 OutputDevice& r2ndOutDev( 
mp2ndOutDevProvider->getOutDev() );
-                                r2ndOutDev.Push( PushFlags::CLIPREGION );
+                                r2ndOutDev.Push( vcl::PushFlags::CLIPREGION );
 
                                 r2ndOutDev.IntersectClipRegion( 
aPolyClipRegion );
                                 textureFill( r2ndOutDev,
diff --git a/canvas/source/vcl/spritecanvashelper.cxx 
b/canvas/source/vcl/spritecanvashelper.cxx
index 37a425e7a486..2eb622431e63 100644
--- a/canvas/source/vcl/spritecanvashelper.cxx
+++ b/canvas/source/vcl/spritecanvashelper.cxx
@@ -406,7 +406,7 @@ namespace vclcanvas
             // repaint uncovered areas from sprite. Need to actually
             // clip here, since we're only repainting _parts_ of the
             // sprite
-            rOutDev.Push( PushFlags::CLIPREGION );
+            rOutDev.Push( vcl::PushFlags::CLIPREGION );
 
             for( const auto& rArea : aUnscrollableAreas )
                 opaqueUpdateSpriteArea( aFirst->second.getSprite(),
diff --git a/canvas/source/vcl/spritehelper.cxx 
b/canvas/source/vcl/spritehelper.cxx
index 89cc33d7a2d4..01ed44b9be98 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -149,7 +149,7 @@ namespace vclcanvas
 
         ::basegfx::B2DHomMatrix aTransform( getTransformation() );
 
-        rTargetSurface.Push( PushFlags::CLIPREGION );
+        rTargetSurface.Push( vcl::PushFlags::CLIPREGION );
 
         // apply clip (if any)
         if( getClip().is() )
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index eee17aefe460..cb5fb09d2d83 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -50,19 +50,19 @@ namespace vclcanvas
                               sal_Int8      nTextDirection )
         {
             // TODO(P3): avoid if already correctly set
-            ComplexTextLayoutFlags nLayoutMode = 
ComplexTextLayoutFlags::Default;
+            vcl::text::ComplexTextLayoutFlags nLayoutMode = 
vcl::text::ComplexTextLayoutFlags::Default;
             switch( nTextDirection )
             {
                 case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
                     break;
                 case rendering::TextDirection::STRONG_LEFT_TO_RIGHT:
-                    nLayoutMode = ComplexTextLayoutFlags::BiDiStrong;
+                    nLayoutMode = 
vcl::text::ComplexTextLayoutFlags::BiDiStrong;
                     break;
                 case rendering::TextDirection::WEAK_RIGHT_TO_LEFT:
-                    nLayoutMode = ComplexTextLayoutFlags::BiDiRtl;
+                    nLayoutMode = vcl::text::ComplexTextLayoutFlags::BiDiRtl;
                     break;
                 case rendering::TextDirection::STRONG_RIGHT_TO_LEFT:
-                    nLayoutMode = ComplexTextLayoutFlags::BiDiRtl | 
ComplexTextLayoutFlags::BiDiStrong;
+                    nLayoutMode = vcl::text::ComplexTextLayoutFlags::BiDiRtl | 
vcl::text::ComplexTextLayoutFlags::BiDiStrong;
                     break;
                 default:
                     break;
@@ -70,7 +70,7 @@ namespace vclcanvas
 
             // set calculated layout mode. Origin is always the left edge,
             // as required at the API spec
-            rOutDev.SetLayoutMode( nLayoutMode | 
ComplexTextLayoutFlags::TextOriginLeft );
+            rOutDev.SetLayoutMode( nLayoutMode | 
vcl::text::ComplexTextLayoutFlags::TextOriginLeft );
         }
     }
 
diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx 
b/chart2/inc/pch/precompiled_chartcontroller.hxx
index 36a2756f7ac7..aeac1b600cba 100644
--- a/chart2/inc/pch/precompiled_chartcontroller.hxx
+++ b/chart2/inc/pch/precompiled_chartcontroller.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-07-28 20:46:09 using:
+ Generated on 2021-09-28 05:28:39 using:
  ./bin/update_pch chart2 chartcontroller --cutoff=6 --exclude:system 
--include:module --include:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -40,12 +40,14 @@
 #include <map>
 #include <math.h>
 #include <memory>
+#include <mutex>
 #include <new>
 #include <numeric>
 #include <optional>
 #include <ostream>
 #include <set>
 #include <stddef.h>
+#include <stdexcept>
 #include <string.h>
 #include <string>
 #include <string_view>
@@ -123,7 +125,6 @@
 #include <vcl/mapmod.hxx>
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/outdev.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
 #include <vcl/rendercontext/AntialiasingFlags.hxx>
@@ -134,7 +135,10 @@
 #include <vcl/rendercontext/GetDefaultFontFlags.hxx>
 #include <vcl/rendercontext/ImplMapRes.hxx>
 #include <vcl/rendercontext/InvertFlags.hxx>
+#include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <vcl/scopedbitmapaccess.hxx>
 #include <vcl/settings.hxx>
@@ -227,13 +231,17 @@
 #include <com/sun/star/graphic/XPrimitive2D.hpp>
 #include <com/sun/star/i18n/Calendar2.hpp>
 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
+#include <com/sun/star/i18n/DirectionProperty.hpp>
 #include <com/sun/star/i18n/ForbiddenCharacters.hpp>
+#include <com/sun/star/i18n/KCharacterType.hpp>
 #include <com/sun/star/i18n/LanguageCountryInfo.hpp>
 #include <com/sun/star/i18n/LocaleDataItem2.hpp>
 #include <com/sun/star/i18n/LocaleItem.hpp>
 #include <com/sun/star/i18n/NativeNumberXmlAttributes.hpp>
+#include <com/sun/star/i18n/ParseResult.hpp>
 #include <com/sun/star/i18n/TransliterationModules.hpp>
 #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
+#include <com/sun/star/i18n/UnicodeScript.hpp>
 #include <com/sun/star/i18n/WordType.hpp>
 #include <com/sun/star/i18n/reservedWords.hpp>
 #include <com/sun/star/lang/DisposedException.hpp>
@@ -267,6 +275,7 @@
 #include <com/sun/star/uno/genfunc.hxx>
 #include <com/sun/star/util/Date.hpp>
 #include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/NumberFormat.hpp>
 #include <com/sun/star/util/Time.hpp>
 #include <com/sun/star/util/XModifyBroadcaster.hpp>
 #include <com/sun/star/util/XUpdatable.hpp>
@@ -274,6 +283,7 @@
 #include <comphelper/broadcasthelper.hxx>
 #include <comphelper/comphelperdllapi.h>
 #include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multicontainer2.hxx>
 #include <comphelper/propagg.hxx>
 #include <comphelper/proparrhlp.hxx>
 #include <comphelper/propertycontainer.hxx>
@@ -294,7 +304,6 @@
 #include <cppuhelper/implbase_ex_post.hxx>
 #include <cppuhelper/implbase_ex_pre.hxx>
 #include <cppuhelper/interfacecontainer.h>
-#include <cppuhelper/interfacecontainer.hxx>
 #include <cppuhelper/propshlp.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/weak.hxx>
@@ -315,6 +324,8 @@
 #include <editeng/forbiddencharacterstable.hxx>
 #include <editeng/macros.hxx>
 #include <editeng/outliner.hxx>
+#include <editeng/outlobj.hxx>
+#include <editeng/overflowingtxt.hxx>
 #include <editeng/paragraphdata.hxx>
 #include <editeng/svxenum.hxx>
 #include <editeng/svxfont.hxx>
@@ -348,6 +359,8 @@
 #include <svl/itemset.hxx>
 #include <svl/languageoptions.hxx>
 #include <svl/lstner.hxx>
+#include <svl/nfkeytab.hxx>
+#include <svl/ondemand.hxx>
 #include <svl/poolitem.hxx>
 #include <svl/setitem.hxx>
 #include <svl/stritem.hxx>
@@ -440,11 +453,13 @@
 #include <uno/data.h>
 #include <uno/sequence2.h>
 #include <unotools/calendarwrapper.hxx>
+#include <unotools/charclass.hxx>
 #include <unotools/eventlisteneradapter.hxx>
 #include <unotools/fontdefs.hxx>
 #include <unotools/localedatawrapper.hxx>
 #include <unotools/nativenumberwrapper.hxx>
 #include <unotools/options.hxx>
+#include <unotools/resmgr.hxx>
 #include <unotools/syslocale.hxx>
 #include <unotools/transliterationwrapper.hxx>
 #include <unotools/unotoolsdllapi.h>
diff --git a/chart2/inc/pch/precompiled_chartcore.hxx 
b/chart2/inc/pch/precompiled_chartcore.hxx
index 3b9a214021a3..f7a6e5ffc744 100644
--- a/chart2/inc/pch/precompiled_chartcore.hxx
+++ b/chart2/inc/pch/precompiled_chartcore.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-07-28 20:46:13 using:
+ Generated on 2021-09-12 11:51:16 using:
  ./bin/update_pch chart2 chartcore --cutoff=3 --exclude:system 
--exclude:module --include:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -78,7 +78,6 @@
 #include <vcl/mapmod.hxx>
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/outdev.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
 #include <vcl/rendercontext/AntialiasingFlags.hxx>
@@ -89,7 +88,10 @@
 #include <vcl/rendercontext/GetDefaultFontFlags.hxx>
 #include <vcl/rendercontext/ImplMapRes.hxx>
 #include <vcl/rendercontext/InvertFlags.hxx>
+#include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/svapp.hxx>
@@ -102,7 +104,6 @@
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/range/b2drange.hxx>
-#include <basegfx/range/b2irectangle.hxx>
 #include <basegfx/tuple/b2dtuple.hxx>
 #include <basegfx/tuple/b2ituple.hxx>
 #include <basegfx/vector/b2enums.hxx>
@@ -235,6 +236,7 @@
 #include <svl/intitem.hxx>
 #include <svl/itemset.hxx>
 #include <svl/lstner.hxx>
+#include <svl/numformat.hxx>
 #include <svl/poolitem.hxx>
 #include <svl/svldllapi.h>
 #include <svl/typedwhich.hxx>
@@ -263,6 +265,7 @@
 #include <tools/weakbase.h>
 #include <unotools/fontdefs.hxx>
 #include <unotools/options.hxx>
+#include <unotools/resmgr.hxx>
 #include <unotools/saveopt.hxx>
 #include <unotools/unotoolsdllapi.h>
 #endif // PCH_LEVEL >= 3
diff --git a/cppcanvas/source/inc/implrenderer.hxx 
b/cppcanvas/source/inc/implrenderer.hxx
index 4b432f898260..93b68f9410ad 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -63,7 +63,7 @@ namespace cppcanvas::internal
         public:
             OutDevState& getState();
             const OutDevState& getState() const;
-            void pushState(PushFlags nFlags);
+            void pushState(vcl::PushFlags nFlags);
             void popState();
             void clearStateStack();
         private:
diff --git a/cppcanvas/source/inc/outdevstate.hxx 
b/cppcanvas/source/inc/outdevstate.hxx
index 16cc3c4ff25a..275b7b4314de 100644
--- a/cppcanvas/source/inc/outdevstate.hxx
+++ b/cppcanvas/source/inc/outdevstate.hxx
@@ -30,8 +30,7 @@
 #include <tools/fontenum.hxx>
 #include <tools/gen.hxx>
 #include <vcl/fntstyle.hxx>
-#include <vcl/outdevstate.hxx>
-
+#include <vcl/rendercontext/State.hxx>
 
 namespace cppcanvas::internal
     {
@@ -55,7 +54,7 @@ namespace cppcanvas::internal
                 fontRotation(0.0),
 
                 textEmphasisMark(FontEmphasisMark::NONE),
-                pushFlags(PushFlags::ALL),
+                pushFlags(vcl::PushFlags::ALL),
                 
textDirection(css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT),
                 textAlignment(0), // TODO(Q2): Synchronize with implrenderer
                                   // and possibly new rendering::TextAlignment
@@ -99,7 +98,7 @@ namespace cppcanvas::internal
             double                                                             
      fontRotation;
 
             FontEmphasisMark                                                   
      textEmphasisMark;
-            PushFlags                                                          
      pushFlags;
+            vcl::PushFlags                                                     
           pushFlags;
             sal_Int8                                                           
      textDirection;
             sal_Int8                                                           
      textAlignment;
             FontRelief                                                         
      textReliefStyle;
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx 
b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 64ac3a164c86..14ecdebdaddd 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -250,7 +250,7 @@ namespace cppcanvas::internal
             return m_aStates.back();
         }
 
-        void VectorOfOutDevStates::pushState(PushFlags nFlags)
+        void VectorOfOutDevStates::pushState(vcl::PushFlags nFlags)
         {
             m_aStates.push_back( getState() );
             getState().pushFlags = nFlags;
@@ -258,7 +258,7 @@ namespace cppcanvas::internal
 
         void VectorOfOutDevStates::popState()
         {
-            if( getState().pushFlags != PushFlags::ALL )
+            if( getState().pushFlags != vcl::PushFlags::ALL )
             {
                 // a state is pushed which is incomplete, i.e. does not
                 // restore everything to the previous stack level when
@@ -277,19 +277,19 @@ namespace cppcanvas::internal
 
                 const OutDevState& rNewState( getState() );
 
-                if( aCalculatedNewState.pushFlags & PushFlags::LINECOLOR )
+                if( aCalculatedNewState.pushFlags & vcl::PushFlags::LINECOLOR )
                 {
                     aCalculatedNewState.lineColor      = rNewState.lineColor;
                     aCalculatedNewState.isLineColorSet = 
rNewState.isLineColorSet;
                 }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::FILLCOLOR )
+                if( aCalculatedNewState.pushFlags & vcl::PushFlags::FILLCOLOR )
                 {
                     aCalculatedNewState.fillColor      = rNewState.fillColor;
                     aCalculatedNewState.isFillColorSet = 
rNewState.isFillColorSet;
                 }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::FONT )
+                if( aCalculatedNewState.pushFlags & vcl::PushFlags::FONT )
                 {
                     aCalculatedNewState.xFont                   = 
rNewState.xFont;
                     aCalculatedNewState.fontRotation            = 
rNewState.fontRotation;
@@ -303,17 +303,17 @@ namespace cppcanvas::internal
                     aCalculatedNewState.isTextOutlineModeSet    = 
rNewState.isTextOutlineModeSet;
                 }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::TEXTCOLOR )
+                if( aCalculatedNewState.pushFlags & vcl::PushFlags::TEXTCOLOR )
                 {
                     aCalculatedNewState.textColor = rNewState.textColor;
                 }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::MAPMODE )
+                if( aCalculatedNewState.pushFlags & vcl::PushFlags::MAPMODE )
                 {
                     aCalculatedNewState.mapModeTransform = 
rNewState.mapModeTransform;
                 }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::CLIPREGION )
+                if( aCalculatedNewState.pushFlags & vcl::PushFlags::CLIPREGION 
)
                 {
                     aCalculatedNewState.clip        = rNewState.clip;
                     aCalculatedNewState.clipRect    = rNewState.clipRect;
@@ -321,46 +321,46 @@ namespace cppcanvas::internal
                 }
 
                 // TODO(F2): Raster ops NYI
-                // if( (aCalculatedNewState.pushFlags & PushFlags::RASTEROP) )
+                // if( (aCalculatedNewState.pushFlags & 
vcl::PushFlags::RASTEROP) )
                 // {
                 // }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::TEXTFILLCOLOR )
+                if( aCalculatedNewState.pushFlags & 
vcl::PushFlags::TEXTFILLCOLOR )
                 {
                     aCalculatedNewState.textFillColor      = 
rNewState.textFillColor;
                     aCalculatedNewState.isTextFillColorSet = 
rNewState.isTextFillColorSet;
                 }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::TEXTALIGN )
+                if( aCalculatedNewState.pushFlags & vcl::PushFlags::TEXTALIGN )
                 {
                     aCalculatedNewState.textReferencePoint = 
rNewState.textReferencePoint;
                 }
 
                 // TODO(F1): Refpoint handling NYI
-                // if( (aCalculatedNewState.pushFlags & PushFlags::REFPOINT) )
+                // if( (aCalculatedNewState.pushFlags & 
vcl::PushFlags::REFPOINT) )
                 // {
                 // }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::TEXTLINECOLOR )
+                if( aCalculatedNewState.pushFlags & 
vcl::PushFlags::TEXTLINECOLOR )
                 {
                     aCalculatedNewState.textLineColor      = 
rNewState.textLineColor;
                     aCalculatedNewState.isTextLineColorSet = 
rNewState.isTextLineColorSet;
                 }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::OVERLINECOLOR )
+                if( aCalculatedNewState.pushFlags & 
vcl::PushFlags::OVERLINECOLOR )
                 {
                     aCalculatedNewState.textOverlineColor = 
rNewState.textOverlineColor;
                     aCalculatedNewState.isTextOverlineColorSet = 
rNewState.isTextOverlineColorSet;
                 }
 
-                if( aCalculatedNewState.pushFlags & PushFlags::TEXTLAYOUTMODE )
+                if( aCalculatedNewState.pushFlags & 
vcl::PushFlags::TEXTLAYOUTMODE )
                 {
                     aCalculatedNewState.textAlignment = 
rNewState.textAlignment;
                     aCalculatedNewState.textDirection = 
rNewState.textDirection;
                 }
 
                 // TODO(F2): Text language handling NYI
-                // if( (aCalculatedNewState.pushFlags & 
PushFlags::TEXTLANGUAGE) )
+                // if( (aCalculatedNewState.pushFlags & 
vcl::PushFlags::TEXTLANGUAGE) )
                 // {
                 // }
 
@@ -715,7 +715,7 @@ namespace cppcanvas::internal
             // cannot currently use native canvas gradients, as a
             // finite step size is given (this funny feature is not
             // supported by the XCanvas API)
-            rParms.mrStates.pushState(PushFlags::ALL);
+            rParms.mrStates.pushState(vcl::PushFlags::ALL);
 
             if( !bIsPolygonRectangle )
             {
@@ -1521,22 +1521,22 @@ namespace cppcanvas::internal
                     case MetaActionType::LAYOUTMODE:
                     {
                         // TODO(F2): A lot is missing here
-                        ComplexTextLayoutFlags nLayoutMode = 
static_cast<MetaLayoutModeAction*>(pCurrAct)->GetLayoutMode();
+                        vcl::text::ComplexTextLayoutFlags nLayoutMode = 
static_cast<MetaLayoutModeAction*>(pCurrAct)->GetLayoutMode();
                         ::cppcanvas::internal::OutDevState& rState = 
rStates.getState();
 
-                        ComplexTextLayoutFlags nBidiLayoutMode = nLayoutMode & 
(ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::BiDiStrong);
-                        if( nBidiLayoutMode == ComplexTextLayoutFlags::Default)
+                        vcl::text::ComplexTextLayoutFlags nBidiLayoutMode = 
nLayoutMode & 
(vcl::text::ComplexTextLayoutFlags::BiDiRtl|vcl::text::ComplexTextLayoutFlags::BiDiStrong);
+                        if( nBidiLayoutMode == 
vcl::text::ComplexTextLayoutFlags::Default)
                                 rState.textDirection = 
rendering::TextDirection::WEAK_LEFT_TO_RIGHT;
-                        else if( nBidiLayoutMode == 
ComplexTextLayoutFlags::BiDiStrong)
+                        else if( nBidiLayoutMode == 
vcl::text::ComplexTextLayoutFlags::BiDiStrong)
                                 rState.textDirection = 
rendering::TextDirection::STRONG_LEFT_TO_RIGHT;
-                        else if( nBidiLayoutMode == 
ComplexTextLayoutFlags::BiDiRtl)
+                        else if( nBidiLayoutMode == 
vcl::text::ComplexTextLayoutFlags::BiDiRtl)
                                 rState.textDirection = 
rendering::TextDirection::WEAK_RIGHT_TO_LEFT;
-                        else if( nBidiLayoutMode == 
(ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::BiDiStrong))
+                        else if( nBidiLayoutMode == 
(vcl::text::ComplexTextLayoutFlags::BiDiRtl | 
vcl::text::ComplexTextLayoutFlags::BiDiStrong))
                                 rState.textDirection = 
rendering::TextDirection::STRONG_RIGHT_TO_LEFT;
 
                         rState.textAlignment = 0; // TODO(F2): 
rendering::TextAlignment::LEFT_ALIGNED;
-                        if( (nLayoutMode & (ComplexTextLayoutFlags::BiDiRtl | 
ComplexTextLayoutFlags::TextOriginRight) )
-                            && !(nLayoutMode & 
ComplexTextLayoutFlags::TextOriginLeft ) )
+                        if( (nLayoutMode & 
(vcl::text::ComplexTextLayoutFlags::BiDiRtl | 
vcl::text::ComplexTextLayoutFlags::TextOriginRight) )
+                            && !(nLayoutMode & 
vcl::text::ComplexTextLayoutFlags::TextOriginLeft ) )
                         {
                             rState.textAlignment = 1; // TODO(F2): 
rendering::TextAlignment::RIGHT_ALIGNED;
                         }
@@ -1595,7 +1595,7 @@ namespace cppcanvas::internal
                         // Setup local transform, such that the
                         // metafile renders itself into the given
                         // output rectangle
-                        rStates.pushState(PushFlags::ALL);
+                        rStates.pushState(vcl::PushFlags::ALL);
 
                         rVDev.Push();
                         rVDev.SetMapMode( rSubstitute.GetPrefMapMode() );
@@ -2529,7 +2529,7 @@ namespace cppcanvas::internal
                     {
                         MetaTextRectAction* pAct = 
static_cast<MetaTextRectAction*>(pCurrAct);
 
-                        rStates.pushState(PushFlags::ALL);
+                        rStates.pushState(vcl::PushFlags::ALL);
 
                         // use the VDev to break up the text rect
                         // action into readily formatted lines
diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx
index d2c8659c9fa6..ddc40646e39d 100644
--- a/cui/inc/pch/precompiled_cui.hxx
+++ b/cui/inc/pch/precompiled_cui.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-05-14 22:15:22 using:
+ Generated on 2021-09-28 05:29:25 using:
  ./bin/update_pch cui cui --cutoff=8 --exclude:system --include:module 
--exclude:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -41,12 +41,14 @@
 #include <map>
 #include <math.h>
 #include <memory>
+#include <mutex>
 #include <new>
 #include <numeric>
 #include <optional>
 #include <ostream>
 #include <set>
 #include <stddef.h>
+#include <stdexcept>
 #include <string.h>
 #include <string>
 #include <string_view>
@@ -84,6 +86,7 @@
 #include <rtl/stringutils.hxx>
 #include <rtl/textcvt.h>
 #include <rtl/textenc.h>
+#include <rtl/ustrbuf.h>
 #include <rtl/ustrbuf.hxx>
 #include <rtl/ustring.h>
 #include <rtl/ustring.hxx>
@@ -129,7 +132,6 @@
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/metric.hxx>
 #include <vcl/outdev.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
 #include <vcl/rendercontext/AntialiasingFlags.hxx>
@@ -140,7 +142,10 @@
 #include <vcl/rendercontext/GetDefaultFontFlags.hxx>
 #include <vcl/rendercontext/ImplMapRes.hxx>
 #include <vcl/rendercontext/InvertFlags.hxx>
+#include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
 #include <vcl/salctype.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <vcl/scopedbitmapaccess.hxx>
@@ -173,6 +178,8 @@
 #include <basegfx/range/b2drange.hxx>
 #include <basegfx/range/b2drectangle.hxx>
 #include <basegfx/range/basicrange.hxx>
+#include <basegfx/tuple/Tuple2D.hxx>
+#include <basegfx/tuple/Tuple3D.hxx>
 #include <basegfx/tuple/b2dtuple.hxx>
 #include <basegfx/tuple/b2ituple.hxx>
 #include <basegfx/tuple/b3dtuple.hxx>
@@ -209,11 +216,21 @@
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/frame/XTerminateListener.hpp>
 #include <com/sun/star/graphic/XPrimitive2D.hpp>
+#include <com/sun/star/i18n/Calendar2.hpp>
+#include <com/sun/star/i18n/DirectionProperty.hpp>
 #include <com/sun/star/i18n/ForbiddenCharacters.hpp>
+#include <com/sun/star/i18n/KCharacterType.hpp>
+#include <com/sun/star/i18n/LanguageCountryInfo.hpp>
+#include <com/sun/star/i18n/LocaleDataItem2.hpp>
+#include <com/sun/star/i18n/LocaleItem.hpp>
+#include <com/sun/star/i18n/NativeNumberXmlAttributes.hpp>
+#include <com/sun/star/i18n/ParseResult.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/i18n/TransliterationModules.hpp>
 #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
+#include <com/sun/star/i18n/UnicodeScript.hpp>
 #include <com/sun/star/i18n/WordType.hpp>
+#include <com/sun/star/i18n/reservedWords.hpp>
 #include <com/sun/star/lang/EventObject.hpp>
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -249,6 +266,7 @@
 #include <com/sun/star/util/SearchOptions2.hpp>
 #include <com/sun/star/util/Time.hpp>
 #include <comphelper/comphelperdllapi.h>
+#include <comphelper/dispatchcommand.hxx>
 #include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
@@ -274,11 +292,14 @@
 #include <editeng/flditem.hxx>
 #include <editeng/forbiddencharacterstable.hxx>
 #include <editeng/outliner.hxx>
+#include <editeng/outlobj.hxx>
+#include <editeng/overflowingtxt.hxx>
 #include <editeng/paragraphdata.hxx>
 #include <editeng/svxenum.hxx>
 #include <editeng/svxfont.hxx>
 #include <i18nlangtag/lang.h>
 #include <i18nlangtag/languagetag.hxx>
+#include <i18nutil/i18nutildllapi.h>
 #include <i18nutil/searchopt.hxx>
 #include <i18nutil/transliteration.hxx>
 #include <o3tl/cow_wrapper.hxx>
@@ -307,6 +328,7 @@
 #include <sot/formats.hxx>
 #include <sot/sotdllapi.h>
 #include <svl/SfxBroadcaster.hxx>
+#include <svl/cjkoptions.hxx>
 #include <svl/custritm.hxx>
 #include <svl/eitem.hxx>
 #include <svl/hint.hxx>
@@ -317,14 +339,15 @@
 #include <svl/lstner.hxx>
 #include <svl/macitem.hxx>
 #include <svl/poolitem.hxx>
+#include <svl/setitem.hxx>
 #include <svl/stritem.hxx>
 #include <svl/style.hxx>
 #include <svl/stylesheetuser.hxx>
 #include <svl/svldllapi.h>
 #include <svl/typedwhich.hxx>
 #include <svl/undo.hxx>
+#include <svl/whichranges.hxx>
 #include <svtools/colorcfg.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
 #include <svtools/svtdllapi.h>
 #include <svtools/unitconv.hxx>
 #include <svtools/valueset.hxx>
@@ -408,10 +431,12 @@
 #include <uno/any2.h>
 #include <uno/data.h>
 #include <uno/sequence2.h>
-#include <unotools/configitem.hxx>
+#include <unotools/charclass.hxx>
 #include <unotools/fontdefs.hxx>
 #include <unotools/options.hxx>
 #include <unotools/pathoptions.hxx>
+#include <unotools/resmgr.hxx>
+#include <unotools/syslocale.hxx>
 #include <unotools/unotoolsdllapi.h>
 #endif // PCH_LEVEL >= 3
 #if PCH_LEVEL >= 4
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx 
b/cui/source/dialogs/hangulhanjadlg.cxx
index 05d921dca867..ec46262284c5 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -69,7 +69,7 @@ namespace svx
             FontSwitch( OutputDevice& _rDev, const vcl::Font& _rTemporaryFont )
                 :m_rDev( _rDev )
             {
-                m_rDev.Push( PushFlags::FONT );
+                m_rDev.Push( vcl::PushFlags::FONT );
                 m_rDev.SetFont( _rTemporaryFont );
             }
             ~FontSwitch() COVERITY_NOEXCEPT_FALSE
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 644859790e32..726b09647bc1 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -703,7 +703,7 @@ void SvxCropExample::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 
 void SvxCropExample::Paint(vcl::RenderContext& rRenderContext, const 
::tools::Rectangle&)
 {
-    rRenderContext.Push(PushFlags::MAPMODE);
+    rRenderContext.Push(vcl::PushFlags::MAPMODE);
     rRenderContext.SetMapMode(m_aMapMode);
 
     // Win BG
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 3c384aa8590c..a04aaf767afd 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -132,7 +132,7 @@ void SvxNumberPreview::NotifyChange( const OUString& 
rPrevStr,
 
 void SvxNumberPreview::Paint(vcl::RenderContext& rRenderContext, const 
::tools::Rectangle&)
 {
-    rRenderContext.Push(PushFlags::ALL);
+    rRenderContext.Push(vcl::PushFlags::ALL);
 
     svtools::ColorConfig aColorConfig;
     
rRenderContext.SetTextColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
diff --git a/dbaccess/inc/pch/precompiled_dbu.hxx 
b/dbaccess/inc/pch/precompiled_dbu.hxx
index 00d2edff1c4b..9bfc030bc5ab 100644
--- a/dbaccess/inc/pch/precompiled_dbu.hxx
+++ b/dbaccess/inc/pch/precompiled_dbu.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-05-14 22:15:31 using:
+ Generated on 2021-09-12 11:51:31 using:
  ./bin/update_pch dbaccess dbu --cutoff=12 --exclude:system --exclude:module 
--exclude:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -32,6 +32,7 @@
 #include <limits>
 #include <map>
 #include <memory>
+#include <mutex>
 #include <new>
 #include <optional>
 #include <ostream>
@@ -87,7 +88,6 @@
 #include <vcl/mapmod.hxx>
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/outdev.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
 #include <vcl/rendercontext/AntialiasingFlags.hxx>
@@ -98,7 +98,10 @@
 #include <vcl/rendercontext/GetDefaultFontFlags.hxx>
 #include <vcl/rendercontext/ImplMapRes.hxx>
 #include <vcl/rendercontext/InvertFlags.hxx>
+#include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/svapp.hxx>
@@ -143,7 +146,6 @@
 #include <com/sun/star/frame/XTerminateListener.hpp>
 #include <com/sun/star/frame/XTitle.hpp>
 #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/lang/EventObject.hpp>
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
@@ -172,7 +174,6 @@
 #include <com/sun/star/util/URL.hpp>
 #include <com/sun/star/util/XNumberFormatter.hpp>
 #include <comphelper/comphelperdllapi.h>
-#include <comphelper/interfacecontainer2.hxx>
 #include <comphelper/namedvaluecollection.hxx>
 #include <comphelper/sequence.hxx>
 #include <comphelper/types.hxx>
@@ -220,11 +221,11 @@
 #include <uno/data.h>
 #include <unotools/eventlisteneradapter.hxx>
 #include <unotools/fontdefs.hxx>
+#include <unotools/resmgr.hxx>
 #include <unotools/sharedunocomponent.hxx>
 #include <unotools/unotoolsdllapi.h>
 #endif // PCH_LEVEL >= 3
 #if PCH_LEVEL >= 4
-#include <ConnectionLineData.hxx>
 #include <FieldDescriptions.hxx>
 #include <IClipBoardTest.hxx>
 #include <QEnumTypes.hxx>
diff --git a/dbaccess/source/ui/browser/dataview.cxx 
b/dbaccess/source/ui/browser/dataview.cxx
index b48a3f0adb17..74ceea688ba1 100644
--- a/dbaccess/source/ui/browser/dataview.cxx
+++ b/dbaccess/source/ui/browser/dataview.cxx
@@ -70,7 +70,7 @@ namespace dbaui
     {
         // draw the background
         {
-            rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+            rRenderContext.Push(vcl::PushFlags::LINECOLOR | 
vcl::PushFlags::FILLCOLOR);
             rRenderContext.SetLineColor(COL_TRANSPARENT);
             
rRenderContext.SetFillColor(GetSettings().GetStyleSettings().GetFaceColor());
             rRenderContext.DrawRect(_rRect);
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx 
b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index a89397ccb2a5..8fa367060361 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -302,7 +302,7 @@ void OTableEditorCtrl::PaintCell(OutputDevice& rDev, const 
tools::Rectangle& rRe
 {
     const OUString aText( GetCellText( m_nCurrentPos, nColumnId ));
 
-    rDev.Push( PushFlags::CLIPREGION );
+    rDev.Push( vcl::PushFlags::CLIPREGION );
     rDev.SetClipRegion(vcl::Region(rRect));
     rDev.DrawText( rRect, aText, DrawTextFlags::Left | DrawTextFlags::VCenter 
);
     rDev.Pop();
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx 
b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 840b59968cf3..ceccee017442 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -504,7 +504,7 @@ void ExtensionBox_Impl::DrawRow(vcl::RenderContext& 
rRenderContext, const tools:
     {
         aPos = rRect.TopLeft() + Point( ICON_OFFSET + nMaxTitleWidth + 
(2*SPACE_BETWEEN), TOP_OFFSET );
 
-        rRenderContext.Push(PushFlags::FONT | PushFlags::TEXTCOLOR | 
PushFlags::TEXTFILLCOLOR);
+        rRenderContext.Push(vcl::PushFlags::FONT | vcl::PushFlags::TEXTCOLOR | 
vcl::PushFlags::TEXTFILLCOLOR);
         rRenderContext.SetTextColor(rStyleSettings.GetLinkColor());
         rRenderContext.SetTextFillColor(rStyleSettings.GetFieldColor());
         vcl::Font aFont = rRenderContext.GetFont();
diff --git a/drawinglayer/inc/wmfemfhelper.hxx 
b/drawinglayer/inc/wmfemfhelper.hxx
index d24ab2fd02c7..4a6bbe81228c 100644
--- a/drawinglayer/inc/wmfemfhelper.hxx
+++ b/drawinglayer/inc/wmfemfhelper.hxx
@@ -23,7 +23,7 @@
 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
 #include <vcl/font.hxx>
 #include <rtl/ref.hxx>
-#include <vcl/outdevstate.hxx>
+#include <vcl/rendercontext/State.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <memory>
@@ -100,9 +100,9 @@ namespace wmfemfhelper
         /// font, etc.
         vcl::Font               maFont;
         RasterOp                maRasterOp;
-        ComplexTextLayoutFlags   mnLayoutMode;
+        vcl::text::ComplexTextLayoutFlags   mnLayoutMode;
         LanguageType            maLanguageType;
-        PushFlags               mnPushFlags;
+        vcl::PushFlags               mnPushFlags;
 
         /// contains all active markers
         bool                    mbLineColor : 1;
@@ -167,14 +167,14 @@ namespace wmfemfhelper
         bool isRasterOpForceBlack() const { return RasterOp::N0 == maRasterOp; 
}
         bool isRasterOpActive() const { return isRasterOpInvert() || 
isRasterOpForceBlack(); }
 
-        ComplexTextLayoutFlags getLayoutMode() const { return mnLayoutMode; }
-        void setLayoutMode(ComplexTextLayoutFlags nNew) { if (nNew != 
mnLayoutMode) mnLayoutMode = nNew; }
+        vcl::text::ComplexTextLayoutFlags getLayoutMode() const { return 
mnLayoutMode; }
+        void setLayoutMode(vcl::text::ComplexTextLayoutFlags nNew) { if (nNew 
!= mnLayoutMode) mnLayoutMode = nNew; }
 
         LanguageType getLanguageType() const { return maLanguageType; }
         void setLanguageType(LanguageType aNew) { if (aNew != maLanguageType) 
maLanguageType = aNew; }
 
-        PushFlags getPushFlags() const { return mnPushFlags; }
-        void setPushFlags(PushFlags nNew) { if (nNew != mnPushFlags) 
mnPushFlags = nNew; }
+        vcl::PushFlags getPushFlags() const { return mnPushFlags; }
+        void setPushFlags(vcl::PushFlags nNew) { if (nNew != mnPushFlags) 
mnPushFlags = nNew; }
 
         bool getLineOrFillActive() const { return (mbLineColor || 
mbFillColor); }
     };
@@ -196,7 +196,7 @@ namespace wmfemfhelper
     public:
         PropertyHolders();
         void PushDefault();
-        void Push(PushFlags nPushFlags);
+        void Push(vcl::PushFlags nPushFlags);
         void Pop();
         PropertyHolder& Current();
         ~PropertyHolders();
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index d60616d5be2c..52013c1e8850 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1561,7 +1561,7 @@ void 
VclMetafileProcessor2D::processPolygonStrokePrimitive2D(
     }
     else
     {
-        mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+        mpOutputDevice->Push(vcl::PushFlags::LINECOLOR | 
vcl::PushFlags::FILLCOLOR);
 
         // support SvtGraphicStroke MetaCommentAction
         std::unique_ptr<SvtGraphicStroke> pSvtGraphicStroke = 
impTryToCreateSvtGraphicStroke(
@@ -2011,7 +2011,7 @@ void 
VclMetafileProcessor2D::processPolyPolygonGradientPrimitive2D(
 void VclMetafileProcessor2D::processPolyPolygonColorPrimitive2D(
     const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate)
 {
-    mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+    mpOutputDevice->Push(vcl::PushFlags::LINECOLOR | 
vcl::PushFlags::FILLCOLOR);
     basegfx::B2DPolyPolygon 
aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
 
     // #i112245# Metafiles use tools Polygon and are not able to have more 
than 65535 points
@@ -2066,7 +2066,7 @@ void VclMetafileProcessor2D::processMaskPrimitive2D(
             // set VCL clip region; subdivide before conversion to tools 
polygon. Subdivision necessary (!)
             // Removed subdivision and fixed in 
vcl::Region::ImplPolyPolyRegionToBandRegionFunc() in VCL where
             // the ClipRegion is built from the Polygon. An AdaptiveSubdivide 
on the source polygon was missing there
-            mpOutputDevice->Push(PushFlags::CLIPREGION);
+            mpOutputDevice->Push(vcl::PushFlags::CLIPREGION);
             mpOutputDevice->SetClipRegion(vcl::Region(maClipPolyPolygon));
 
             // recursively paint content
@@ -2091,7 +2091,7 @@ void VclMetafileProcessor2D::processMaskPrimitive2D(
 void VclMetafileProcessor2D::processUnifiedTransparencePrimitive2D(
     const primitive2d::UnifiedTransparencePrimitive2D& 
rUniTransparenceCandidate)
 {
-    mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+    mpOutputDevice->Push(vcl::PushFlags::LINECOLOR | 
vcl::PushFlags::FILLCOLOR);
     // for metafile: Need to examine what the pure vcl version is doing here 
actually
     // - uses DrawTransparent with metafile for content and a gradient
     // - uses DrawTransparent for single PolyPolygons directly. Can be 
detected by
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 27dbd89f1d06..967b70aa793e 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -91,7 +91,7 @@ VclPixelProcessor2D::VclPixelProcessor2D(const 
geometry::ViewInformation2D& rVie
     maCurrentTransformation = rViewInformation.getObjectToViewTransformation();
 
     // prepare output directly to pixels
-    mpOutputDevice->Push(PushFlags::MAPMODE);
+    mpOutputDevice->Push(vcl::PushFlags::MAPMODE);
     mpOutputDevice->SetMapMode();
 
     // react on AntiAliasing settings
@@ -1234,7 +1234,7 @@ void VclPixelProcessor2D::processFillGradientPrimitive2D(
         std::floor(aFullRange.getMinX()), std::floor(aFullRange.getMinY()),
         std::ceil(aFullRange.getMaxX()), std::ceil(aFullRange.getMaxY()));
 
-    mpOutputDevice->Push(PushFlags::CLIPREGION);
+    mpOutputDevice->Push(vcl::PushFlags::CLIPREGION);
     mpOutputDevice->IntersectClipRegion(aOutputRectangle);
     mpOutputDevice->DrawGradient(aFullRectangle, aGradient);
     mpOutputDevice->Pop();
@@ -1265,7 +1265,7 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D(
     // Unless smooth edges are needed, simply use clipping.
     if (basegfx::utils::isRectangle(aMask) || 
!SvtOptionsDrawinglayer::IsAntiAliasing())
     {
-        mpOutputDevice->Push(PushFlags::CLIPREGION);
+        mpOutputDevice->Push(vcl::PushFlags::CLIPREGION);
         mpOutputDevice->IntersectClipRegion(vcl::Region(aMask));
         mpOutputDevice->DrawWallpaper(aMaskRect, Wallpaper(aTileImage));
         mpOutputDevice->Pop();
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 2ad0e342a209..16bf6a78b878 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -268,14 +268,14 @@ void 
VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
                 
maBColorModifierStack.getModifiedColor(rTextCandidate.getFontColor()));
             const basegfx::B2DPoint aPoint(aLocalTransform * 
basegfx::B2DPoint(0.0, 0.0));
             const Point aStartPoint(basegfx::fround(aPoint.getX()), 
basegfx::fround(aPoint.getY()));
-            const ComplexTextLayoutFlags 
nOldLayoutMode(mpOutputDevice->GetLayoutMode());
+            const vcl::text::ComplexTextLayoutFlags 
nOldLayoutMode(mpOutputDevice->GetLayoutMode());
 
             if (rTextCandidate.getFontAttribute().getRTL())
             {
-                ComplexTextLayoutFlags nRTLLayoutMode(nOldLayoutMode
-                                                      & 
~ComplexTextLayoutFlags::BiDiStrong);
-                nRTLLayoutMode
-                    |= ComplexTextLayoutFlags::BiDiRtl | 
ComplexTextLayoutFlags::TextOriginLeft;
+                vcl::text::ComplexTextLayoutFlags nRTLLayoutMode(
+                    nOldLayoutMode & 
~vcl::text::ComplexTextLayoutFlags::BiDiStrong);
+                nRTLLayoutMode |= vcl::text::ComplexTextLayoutFlags::BiDiRtl
+                                  | 
vcl::text::ComplexTextLayoutFlags::TextOriginLeft;
                 mpOutputDevice->SetLayoutMode(nRTLLayoutMode);
             }
 
@@ -771,7 +771,7 @@ void VclProcessor2D::RenderMaskPrimitive2DPixel(const 
primitive2d::MaskPrimitive
     // Unless smooth edges are needed, simply use clipping.
     if (basegfx::utils::isRectangle(aMask) || 
!SvtOptionsDrawinglayer::IsAntiAliasing())
     {
-        mpOutputDevice->Push(PushFlags::CLIPREGION);
+        mpOutputDevice->Push(vcl::PushFlags::CLIPREGION);
         mpOutputDevice->IntersectClipRegion(vcl::Region(aMask));
         process(rMaskCandidate.getChildren());
         mpOutputDevice->Pop();
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx 
b/drawinglayer/source/tools/wmfemfhelper.cxx
index a7beae35ed83..f7c01f3330c1 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -114,9 +114,9 @@ namespace wmfemfhelper
     :   maMapUnit(MapUnit::Map100thMM),
         maTextColor(sal_uInt32(COL_BLACK)),
         maRasterOp(RasterOp::OverPaint),
-        mnLayoutMode(ComplexTextLayoutFlags::Default),
+        mnLayoutMode(vcl::text::ComplexTextLayoutFlags::Default),
         maLanguageType(0),
-        mnPushFlags(PushFlags::NONE),
+        mnPushFlags(vcl::PushFlags::NONE),
         mbLineColor(false),
         mbFillColor(false),
         mbTextColor(true),
@@ -150,7 +150,7 @@ namespace wmfemfhelper
         maPropertyHolders.push_back(pNew);
     }
 
-    void PropertyHolders::Push(PushFlags nPushFlags)
+    void PropertyHolders::Push(vcl::PushFlags nPushFlags)
     {
         if (bool(nPushFlags))
         {
@@ -173,56 +173,56 @@ namespace wmfemfhelper
             return;
 
         const PropertyHolder* pTip = maPropertyHolders.back();
-        const PushFlags nPushFlags(pTip->getPushFlags());
+        const vcl::PushFlags nPushFlags(pTip->getPushFlags());
 
-        if (nPushFlags != PushFlags::NONE)
+        if (nPushFlags != vcl::PushFlags::NONE)
         {
             if (nSize > 1)
             {
                 // copy back content for all non-set flags
                 PropertyHolder* pLast = maPropertyHolders[nSize - 2];
 
-                if (PushFlags::ALL != nPushFlags)
+                if (vcl::PushFlags::ALL != nPushFlags)
                 {
-                    if (!(nPushFlags & PushFlags::LINECOLOR))
+                    if (!(nPushFlags & vcl::PushFlags::LINECOLOR))
                     {
                         pLast->setLineColor(pTip->getLineColor());
                         pLast->setLineColorActive(pTip->getLineColorActive());
                     }
-                    if (!(nPushFlags & PushFlags::FILLCOLOR))
+                    if (!(nPushFlags & vcl::PushFlags::FILLCOLOR))
                     {
                         pLast->setFillColor(pTip->getFillColor());
                         pLast->setFillColorActive(pTip->getFillColorActive());
                     }
-                    if (!(nPushFlags & PushFlags::FONT))
+                    if (!(nPushFlags & vcl::PushFlags::FONT))
                     {
                         pLast->setFont(pTip->getFont());
                     }
-                    if (!(nPushFlags & PushFlags::TEXTCOLOR))
+                    if (!(nPushFlags & vcl::PushFlags::TEXTCOLOR))
                     {
                         pLast->setTextColor(pTip->getTextColor());
                         pLast->setTextColorActive(pTip->getTextColorActive());
                     }
-                    if (!(nPushFlags & PushFlags::MAPMODE))
+                    if (!(nPushFlags & vcl::PushFlags::MAPMODE))
                     {
                         pLast->setTransformation(pTip->getTransformation());
                         pLast->setMapUnit(pTip->getMapUnit());
                     }
-                    if (!(nPushFlags & PushFlags::CLIPREGION))
+                    if (!(nPushFlags & vcl::PushFlags::CLIPREGION))
                     {
                         pLast->setClipPolyPolygon(pTip->getClipPolyPolygon());
                         
pLast->setClipPolyPolygonActive(pTip->getClipPolyPolygonActive());
                     }
-                    if (!(nPushFlags & PushFlags::RASTEROP))
+                    if (!(nPushFlags & vcl::PushFlags::RASTEROP))
                     {
                         pLast->setRasterOp(pTip->getRasterOp());
                     }
-                    if (!(nPushFlags & PushFlags::TEXTFILLCOLOR))
+                    if (!(nPushFlags & vcl::PushFlags::TEXTFILLCOLOR))
                     {
                         pLast->setTextFillColor(pTip->getTextFillColor());
                         
pLast->setTextFillColorActive(pTip->getTextFillColorActive());
                     }
-                    if (!(nPushFlags & PushFlags::TEXTALIGN))
+                    if (!(nPushFlags & vcl::PushFlags::TEXTALIGN))
                     {
                         if (pLast->getFont().GetAlignment() != 
pTip->getFont().GetAlignment())
                         {
@@ -231,24 +231,24 @@ namespace wmfemfhelper
                             pLast->setFont(aFont);
                         }
                     }
-                    if (!(nPushFlags & PushFlags::REFPOINT))
+                    if (!(nPushFlags & vcl::PushFlags::REFPOINT))
                     {
                         // not supported
                     }
-                    if (!(nPushFlags & PushFlags::TEXTLINECOLOR))
+                    if (!(nPushFlags & vcl::PushFlags::TEXTLINECOLOR))
                     {
                         pLast->setTextLineColor(pTip->getTextLineColor());
                         
pLast->setTextLineColorActive(pTip->getTextLineColorActive());
                     }
-                    if (!(nPushFlags & PushFlags::TEXTLAYOUTMODE))
+                    if (!(nPushFlags & vcl::PushFlags::TEXTLAYOUTMODE))
                     {
                         pLast->setLayoutMode(pTip->getLayoutMode());
                     }
-                    if (!(nPushFlags & PushFlags::TEXTLANGUAGE))
+                    if (!(nPushFlags & vcl::PushFlags::TEXTLANGUAGE))
                     {
                         pLast->setLanguageType(pTip->getLanguageType());
                     }
-                    if (!(nPushFlags & PushFlags::OVERLINECOLOR))
+                    if (!(nPushFlags & vcl::PushFlags::OVERLINECOLOR))
                     {
                         pLast->setOverlineColor(pTip->getOverlineColor());
                         
pLast->setOverlineColorActive(pTip->getOverlineColorActive());
@@ -1061,8 +1061,8 @@ namespace wmfemfhelper
         rFontAttribute = 
drawinglayer::primitive2d::getFontAttributeFromVclFont(
                             aFontScaling,
                             rFont,
-                            bool(rProperty.getLayoutMode() & 
ComplexTextLayoutFlags::BiDiRtl),
-                            bool(rProperty.getLayoutMode() & 
ComplexTextLayoutFlags::BiDiStrong));
+                            bool(rProperty.getLayoutMode() & 
vcl::text::ComplexTextLayoutFlags::BiDiRtl),
+                            bool(rProperty.getLayoutMode() & 
vcl::text::ComplexTextLayoutFlags::BiDiStrong));
 
         // add FontScaling
         rTextTransform.scale(aFontScaling.getX(), aFontScaling.getY());
@@ -2600,8 +2600,8 @@ namespace wmfemfhelper
                 case MetaActionType::POP :
                 {
                     /** CHECKED, WORKS WELL */
-                    const bool 
bRegionMayChange(rPropertyHolders.Current().getPushFlags() & 
PushFlags::CLIPREGION);
-                    const bool 
bRasterOpMayChange(rPropertyHolders.Current().getPushFlags() & 
PushFlags::RASTEROP);
+                    const bool 
bRegionMayChange(rPropertyHolders.Current().getPushFlags() & 
vcl::PushFlags::CLIPREGION);
+                    const bool 
bRasterOpMayChange(rPropertyHolders.Current().getPushFlags() & 
vcl::PushFlags::RASTEROP);
 
                     if(bRegionMayChange && 
rPropertyHolders.Current().getClipPolyPolygonActive())
                     {
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 3ad33fa5525d..92e8d2b89709 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -352,7 +352,7 @@ void ImpEditView::lokSelectionCallback(const 
std::optional<tools::PolyPolygon> &
     }
     else
     {
-        pOutWin->GetOutDev()->Push(PushFlags::MAPMODE);
+        pOutWin->GetOutDev()->Push(vcl::PushFlags::MAPMODE);
         if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
         {
             // Find the parent that is not right
@@ -725,7 +725,7 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice& 
rTarget, const Point& rDo
         }
         else
         {
-            
rTarget.Push(PushFlags::LINECOLOR|PushFlags::FILLCOLOR|PushFlags::RASTEROP);
+            
rTarget.Push(vcl::PushFlags::LINECOLOR|vcl::PushFlags::FILLCOLOR|vcl::PushFlags::RASTEROP);
             rTarget.SetLineColor();
             rTarget.SetFillColor(COL_BLACK);
             rTarget.SetRasterOp(RasterOp::Invert);
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 41985b874a85..90b7603a6b93 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3353,7 +3353,7 @@ sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* 
pPortion, EditLine* pLine,
 
     // #114278# Saving both layout mode and language (since I'm
     // potentially changing both)
-    GetRefDevice()->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
+    GetRefDevice()->Push( 
vcl::PushFlags::TEXTLAYOUTMODE|vcl::PushFlags::TEXTLANGUAGE );
 
     ImplInitLayoutMode(*GetRefDevice(), nPara, -1);
 
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 94d838a4de8a..fb52e1eb984b 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -685,7 +685,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
     }
 
     // Saving both layout mode and language (since I'm potentially changing 
both)
-    GetRefDevice()->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
+    GetRefDevice()->Push( 
vcl::PushFlags::TEXTLAYOUTMODE|vcl::PushFlags::TEXTLANGUAGE );
 
     ImplInitLayoutMode(*GetRefDevice(), nPara, -1);
 
@@ -2359,7 +2359,7 @@ sal_Int32 ImpEditEngine::SplitTextPortion( ParaPortion* 
pPortion, sal_Int32 nPos
             SvxFont aTmpFont( 
pPortion->GetNode()->GetCharAttribs().GetDefFont() );
             SeekCursor( pPortion->GetNode(), nTxtPortionStart+1, aTmpFont );
             aTmpFont.SetPhysFont(*GetRefDevice());
-            GetRefDevice()->Push( PushFlags::TEXTLANGUAGE );
+            GetRefDevice()->Push( vcl::PushFlags::TEXTLANGUAGE );
             ImplInitDigitMode(*GetRefDevice(), aTmpFont.GetLanguage());
             Size aSz = aTmpFont.QuickGetTextSize( GetRefDevice(), 
pPortion->GetNode()->GetString(), nTxtPortionStart, pTextPortion->GetLen() );
             GetRefDevice()->Pop();
@@ -3251,7 +3251,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, 
tools::Rectangle aClipRect, Po
 
                                 // #114278# Saving both layout mode and 
language (since I'm
                                 // potentially changing both)
-                                rOutDev.Push( 
PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
+                                rOutDev.Push( 
vcl::PushFlags::TEXTLAYOUTMODE|vcl::PushFlags::TEXTLANGUAGE );
                                 ImplInitLayoutMode(rOutDev, n, nIndex);
                                 ImplInitDigitMode(rOutDev, 
aTmpFont.GetLanguage());
 
@@ -3302,8 +3302,8 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, 
tools::Rectangle aClipRect, Po
                                                 
adjustXDirectionAware(aBottomRightRectPos, 2 * nHalfBlankWidth);
                                                 
adjustYDirectionAware(aBottomRightRectPos, pLine->GetHeight());
 
-                                                rOutDev.Push( 
PushFlags::FILLCOLOR );
-                                                rOutDev.Push( 
PushFlags::LINECOLOR );
+                                                rOutDev.Push( 
vcl::PushFlags::FILLCOLOR );
+                                                rOutDev.Push( 
vcl::PushFlags::LINECOLOR );
                                                 rOutDev.SetFillColor( 
COL_LIGHTGRAY );
                                                 rOutDev.SetLineColor( 
COL_LIGHTGRAY );
 
@@ -4353,24 +4353,24 @@ void ImpEditEngine::ImplInitLayoutMode(OutputDevice& 
rOutDev, sal_Int32 nPara, s
         // it also works for issue 55927
     }
 
-    ComplexTextLayoutFlags nLayoutMode = rOutDev.GetLayoutMode();
+    vcl::text::ComplexTextLayoutFlags nLayoutMode = rOutDev.GetLayoutMode();
 
     // We always use the left position for DrawText()
-    nLayoutMode &= ~ComplexTextLayoutFlags::BiDiRtl;
+    nLayoutMode &= ~vcl::text::ComplexTextLayoutFlags::BiDiRtl;
 
     if ( !bCTL && !bR2L)
     {
         // No Bidi checking necessary
-        nLayoutMode |= ComplexTextLayoutFlags::BiDiStrong;
+        nLayoutMode |= vcl::text::ComplexTextLayoutFlags::BiDiStrong;
     }
     else
     {
         // Bidi checking necessary
         // Don't use BIDI_STRONG, VCL must do some checks.
-        nLayoutMode &= ~ComplexTextLayoutFlags::BiDiStrong;
+        nLayoutMode &= ~vcl::text::ComplexTextLayoutFlags::BiDiStrong;
 
         if ( bR2L )
-            nLayoutMode |= 
ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::TextOriginLeft;
+            nLayoutMode |= 
vcl::text::ComplexTextLayoutFlags::BiDiRtl|vcl::text::ComplexTextLayoutFlags::TextOriginLeft;
     }
 
     rOutDev.SetLayoutMode( nLayoutMode );
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 937d1d70c96f..7f6313e5c13c 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -958,10 +958,10 @@ void Outliner::PaintBullet(sal_Int32 nPara, const Point& 
rStartPos, const Point&
             }
 
             // VCL will take care of brackets and so on...
-            ComplexTextLayoutFlags nLayoutMode = rOutDev.GetLayoutMode();
-            nLayoutMode &= 
~ComplexTextLayoutFlags(ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::BiDiStrong);
+            vcl::text::ComplexTextLayoutFlags nLayoutMode = 
rOutDev.GetLayoutMode();
+            nLayoutMode &= 
~vcl::text::ComplexTextLayoutFlags(vcl::text::ComplexTextLayoutFlags::BiDiRtl|vcl::text::ComplexTextLayoutFlags::BiDiStrong);
             if ( bRightToLeftPara )
-                nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | 
ComplexTextLayoutFlags::TextOriginLeft | ComplexTextLayoutFlags::BiDiStrong;
+                nLayoutMode |= vcl::text::ComplexTextLayoutFlags::BiDiRtl | 
vcl::text::ComplexTextLayoutFlags::TextOriginLeft | 
vcl::text::ComplexTextLayoutFlags::BiDiStrong;
             rOutDev.SetLayoutMode( nLayoutMode );
 
             if(bStrippingPortions)
diff --git a/emfio/inc/mtftools.hxx b/emfio/inc/mtftools.hxx
index b0945f7806ef..527eae4a5a57 100644
--- a/emfio/inc/mtftools.hxx
+++ b/emfio/inc/mtftools.hxx
@@ -26,7 +26,7 @@
 #include <vcl/font.hxx>
 #include <vcl/bitmapex.hxx>
 #include <vcl/lineinfo.hxx>
-#include <vcl/outdevstate.hxx>
+#include <vcl/rendercontext/State.hxx>
 #include <rtl/ref.hxx>
 
 #include "emfiodllapi.h"
@@ -439,7 +439,7 @@ namespace emfio
     {
         BkMode              nBkMode;
         sal_uInt32          nMapMode, nGfxMode;
-        ComplexTextLayoutFlags nTextLayoutMode;
+        vcl::text::ComplexTextLayoutFlags nTextLayoutMode;
         sal_Int32           nWinOrgX, nWinOrgY, nWinExtX, nWinExtY;
         sal_Int32           nDevOrgX, nDevOrgY, nDevWidth, nDevHeight;
 
@@ -525,8 +525,8 @@ namespace emfio
         Color               maTextColor;
         Color               maLatestBkColor;
         Color               maBkColor;
-        ComplexTextLayoutFlags  mnLatestTextLayoutMode;
-        ComplexTextLayoutFlags  mnTextLayoutMode;
+        vcl::text::ComplexTextLayoutFlags  mnLatestTextLayoutMode;
+        vcl::text::ComplexTextLayoutFlags  mnTextLayoutMode;
         BkMode              mnLatestBkMode;
         BkMode              mnBkMode;
         RasterOp            meLatestRasterOp;
@@ -634,7 +634,7 @@ namespace emfio
         void                SelectObject(sal_uInt32 nIndex);
         rtl_TextEncoding    GetCharSet() const { return maFont.GetCharSet(); };
         const vcl::Font&    GetFont() const { return maFont; }
-        void                SetTextLayoutMode(ComplexTextLayoutFlags 
nLayoutMode);
+        void                
SetTextLayoutMode(vcl::text::ComplexTextLayoutFlags nLayoutMode);
 
         void                ClearPath() { maPathObj.Init(); };
         void                ClosePath() { maPathObj.ClosePath(); };
diff --git a/emfio/source/reader/emfreader.cxx 
b/emfio/source/reader/emfreader.cxx
index ab4f905990d5..b75d16c5759f 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1909,9 +1909,9 @@ namespace emfio
                             else if ( nOptions & ETO_OPAQUE )
                                 DrawRectWithBGColor( aRect );
 
-                            ComplexTextLayoutFlags nTextLayoutMode = 
ComplexTextLayoutFlags::Default;
+                            vcl::text::ComplexTextLayoutFlags nTextLayoutMode 
= vcl::text::ComplexTextLayoutFlags::Default;
                             if ( nOptions & ETO_RTLREADING )
-                                nTextLayoutMode = 
ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft;
+                                nTextLayoutMode = 
vcl::text::ComplexTextLayoutFlags::BiDiRtl | 
vcl::text::ComplexTextLayoutFlags::TextOriginLeft;
                             SetTextLayoutMode( nTextLayoutMode );
                             SAL_WARN_IF( ( nOptions & ( ETO_PDY | 
ETO_GLYPH_INDEX ) ) != 0, "emfio", "SJ: ETO_PDY || ETO_GLYPH_INDEX in EMF" );
 
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 07143b8168af..f78fee7bd5d9 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -894,7 +894,7 @@ namespace emfio
         }
     }
 
-    void MtfTools::SetTextLayoutMode( ComplexTextLayoutFlags nTextLayoutMode )
+    void MtfTools::SetTextLayoutMode( vcl::text::ComplexTextLayoutFlags 
nTextLayoutMode )
     {
         mnTextLayoutMode = nTextLayoutMode;
     }
@@ -1098,8 +1098,8 @@ namespace emfio
         mnTextAlign(TA_LEFT | TA_TOP | TA_NOUPDATECP),
         maLatestBkColor(ColorTransparency, 0x12345678),
         maBkColor(COL_WHITE),
-        mnLatestTextLayoutMode(ComplexTextLayoutFlags::Default),
-        mnTextLayoutMode(ComplexTextLayoutFlags::Default),
+        mnLatestTextLayoutMode(vcl::text::ComplexTextLayoutFlags::Default),
+        mnTextLayoutMode(vcl::text::ComplexTextLayoutFlags::Default),
         mnLatestBkMode(BkMode::NONE),
         mnBkMode(BkMode::OPAQUE),
         meLatestRasterOp(RasterOp::Invert),
@@ -1140,7 +1140,7 @@ namespace emfio
         mnStartPos = mpInputStream->Tell();
         SetDevOrg(Point());
 
-        mpGDIMetaFile->AddAction( new MetaPushAction( PushFlags::CLIPREGION ) 
); // The original clipregion has to be on top
+        mpGDIMetaFile->AddAction( new MetaPushAction( 
vcl::PushFlags::CLIPREGION ) ); // The original clipregion has to be on top
                                                                                
  // of the stack so it can always be restored
                                                                                
  // this is necessary to be able to support
                                                                                
  // SetClipRgn( NULL ) and similar ClipRgn actions (SJ)
@@ -1176,7 +1176,7 @@ namespace emfio
         mbComplexClip = false;
 
         mpGDIMetaFile->AddAction( new MetaPopAction() );                    // 
taking the original clipregion
-        mpGDIMetaFile->AddAction( new MetaPushAction( PushFlags::CLIPREGION ) 
);
+        mpGDIMetaFile->AddAction( new MetaPushAction( 
vcl::PushFlags::CLIPREGION ) );
 
         // skip for 'no clipping at all' case
         if( maClipPath.isEmpty() )
@@ -1294,7 +1294,7 @@ namespace emfio
         {
             if ( !bStroke )
             {
-                mpGDIMetaFile->AddAction( new MetaPushAction( 
PushFlags::LINECOLOR ) );
+                mpGDIMetaFile->AddAction( new MetaPushAction( 
vcl::PushFlags::LINECOLOR ) );
                 mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), 
false ) );
             }
             if ( maPathObj.Count() == 1 )
diff --git a/emfio/source/reader/wmfreader.cxx 
b/emfio/source/reader/wmfreader.cxx
index 2567ca4939cf..bcee84cd386d 100644
--- a/emfio/source/reader/wmfreader.cxx
+++ b/emfio/source/reader/wmfreader.cxx
@@ -688,9 +688,9 @@ namespace emfio
                     SAL_INFO( "emfio", "\t\t\t Rectangle : " << 
aTopLeft.getX() << ":" << aTopLeft.getY() << ", " << aBottomRight.getX() << ":" 
<< aBottomRight.getY() );
                 }
 
-                ComplexTextLayoutFlags nTextLayoutMode = 
ComplexTextLayoutFlags::Default;
+                vcl::text::ComplexTextLayoutFlags nTextLayoutMode = 
vcl::text::ComplexTextLayoutFlags::Default;
                 if ( nOptions & ETO_RTLREADING )
-                    nTextLayoutMode = ComplexTextLayoutFlags::BiDiRtl | 
ComplexTextLayoutFlags::TextOriginLeft;
+                    nTextLayoutMode = 
vcl::text::ComplexTextLayoutFlags::BiDiRtl | 
vcl::text::ComplexTextLayoutFlags::TextOriginLeft;
                 SetTextLayoutMode( nTextLayoutMode );
                 SAL_WARN_IF( ( nOptions & ( ETO_PDY | ETO_GLYPH_INDEX ) ) != 
0, "emfio", "SJ: ETO_PDY || ETO_GLYPH_INDEX in WMF" );
 
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 34b4f1a255a5..9d4e885ef269 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -88,10 +88,10 @@ const char   aXMLAttrStrokeLinejoin[] = "stroke-linejoin";
 const char   aXMLAttrStrokeLinecap[] = "stroke-linecap";
 
 
-PushFlags SVGContextHandler::getPushFlags() const
+vcl::PushFlags SVGContextHandler::getPushFlags() const
 {
     if (maStateStack.empty())
-        return PushFlags::NONE;
+        return vcl::PushFlags::NONE;
 
     const PartialState& rPartialState = maStateStack.top();
     return rPartialState.meFlags;
@@ -102,17 +102,17 @@ SVGState& SVGContextHandler::getCurrentState()
     return maCurrentState;
 }
 
-void SVGContextHandler::pushState( PushFlags eFlags )
+void SVGContextHandler::pushState( vcl::PushFlags eFlags )
 {
     PartialState aPartialState;
     aPartialState.meFlags = eFlags;
 
-    if (eFlags & PushFlags::FONT)
+    if (eFlags & vcl::PushFlags::FONT)
     {
         aPartialState.setFont( maCurrentState.aFont );
     }
 
-    if (eFlags & PushFlags::CLIPREGION)
+    if (eFlags & vcl::PushFlags::CLIPREGION)
     {
         aPartialState.mnRegionClipPathId = maCurrentState.nRegionClipPathId;
     }
@@ -126,14 +126,14 @@ void SVGContextHandler::popState()
         return;
 
     const PartialState& rPartialState = maStateStack.top();
-    PushFlags eFlags = rPartialState.meFlags;
+    vcl::PushFlags eFlags = rPartialState.meFlags;
 
-    if (eFlags & PushFlags::FONT)
+    if (eFlags & vcl::PushFlags::FONT)
     {
         maCurrentState.aFont = rPartialState.getFont( vcl::Font() );
     }
 
-    if (eFlags & PushFlags::CLIPREGION)
+    if (eFlags & vcl::PushFlags::CLIPREGION)
     {
         maCurrentState.nRegionClipPathId = rPartialState.mnRegionClipPathId;
     }
@@ -3858,7 +3858,7 @@ void SVGActionWriter::ImplWriteActions( const 
GDIMetaFile& rMtf,
             case MetaActionType::PUSH:
             {
                 const MetaPushAction*  pA = static_cast<const 
MetaPushAction*>(pAction);
-                PushFlags mnFlags = pA->GetFlags();
+                vcl::PushFlags mnFlags = pA->GetFlags();
 
                 const_cast<MetaAction*>(pAction)->Execute( mpVDev );
 
@@ -3870,11 +3870,11 @@ void SVGActionWriter::ImplWriteActions( const 
GDIMetaFile& rMtf,
             {
                 const_cast<MetaAction*>(pAction)->Execute( mpVDev );
 
-                PushFlags mnFlags = maContextHandler.getPushFlags();
+                vcl::PushFlags mnFlags = maContextHandler.getPushFlags();
 
                 maContextHandler.popState();
 
-                if( mnFlags & PushFlags::CLIPREGION )
+                if( mnFlags & vcl::PushFlags::CLIPREGION )
                 {
                     ImplEndClipRegion();
                     ImplStartClipRegion( mrCurrentState.nRegionClipPathId );
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index 7f0526d62fb9..e3fd2558498b 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -77,7 +77,7 @@ struct SVGState
 
 struct PartialState
 {
-    PushFlags                           meFlags;
+    vcl::PushFlags                           meFlags;
     ::std::optional<vcl::Font>          mupFont;
     sal_Int32                           mnRegionClipPathId;
 
@@ -88,7 +88,7 @@ struct PartialState
                                 { mupFont = rFont; }
 
     PartialState()
-        : meFlags( PushFlags::NONE )
+        : meFlags( vcl::PushFlags::NONE )
         , mupFont()
         , mnRegionClipPathId( 0 )
     {}
@@ -98,7 +98,7 @@ struct PartialState
         , mupFont( std::move( aPartialState.mupFont ) )
         , mnRegionClipPathId( aPartialState.mnRegionClipPathId )
     {
-        aPartialState.meFlags = PushFlags::NONE;
+        aPartialState.meFlags = vcl::PushFlags::NONE;
         aPartialState.mnRegionClipPathId = 0;
     }
 };
@@ -113,9 +113,9 @@ private:
     SVGState maCurrentState;
 
 public:
-    PushFlags getPushFlags() const;
+    vcl::PushFlags getPushFlags() const;
     SVGState& getCurrentState();
-    void pushState( PushFlags eFlags );
+    void pushState( vcl::PushFlags eFlags );
     void popState();
 };
 
diff --git a/forms/source/richtext/richtextimplcontrol.cxx 
b/forms/source/richtext/richtextimplcontrol.cxx
index c12ad42a9aa5..d1cbd7f6aec3 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -451,7 +451,7 @@ namespace frm
             tools::Long nFontWidth = 
m_pEngine->GetStandardFont(0).GetFontSize().Width();
             if ( !nFontWidth )
             {
-                m_pViewport->GetOutDev()->Push( PushFlags::FONT );
+                m_pViewport->GetOutDev()->Push( vcl::PushFlags::FONT );
                 m_pViewport->SetFont( m_pEngine->GetStandardFont(0) );
                 nFontWidth = m_pViewport->GetTextWidth( "x" );
                 m_pViewport->GetOutDev()->Pop();
@@ -566,7 +566,7 @@ namespace frm
     {
         // need to normalize the map mode of the device - every paint 
operation on any device needs
         // to use the same map mode
-        _pDev->Push( PushFlags::MAPMODE | PushFlags::LINECOLOR | 
PushFlags::FILLCOLOR );
+        _pDev->Push( vcl::PushFlags::MAPMODE | vcl::PushFlags::LINECOLOR | 
vcl::PushFlags::FILLCOLOR );
 
         // enforce our "normalize map mode" on the device
         MapMode aRefMapMode( m_pEngine->GetRefDevice()->GetMapMode() );
diff --git a/framework/inc/pch/precompiled_fwk.hxx 
b/framework/inc/pch/precompiled_fwk.hxx
index 45cb3cfddce5..4b14a600b18a 100644
--- a/framework/inc/pch/precompiled_fwk.hxx
+++ b/framework/inc/pch/precompiled_fwk.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-05-14 22:15:48 using:
+ Generated on 2021-09-28 05:36:23 using:
  ./bin/update_pch framework fwk --cutoff=7 --exclude:system --include:module 
--include:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -79,7 +79,6 @@
 #include <rtl/ustrbuf.hxx>
 #include <rtl/ustring.h>
 #include <rtl/ustring.hxx>
-#include <rtl/uuid.h>
 #include <sal/detail/log.h>
 #include <sal/log.hxx>
 #include <sal/macros.h>
@@ -102,7 +101,6 @@
 #include <vcl/mapmod.hxx>
 #include <vcl/menu.hxx>
 #include <vcl/metaactiontypes.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
 #include <vcl/rendercontext/AntialiasingFlags.hxx>
@@ -113,7 +111,10 @@
 #include <vcl/rendercontext/GetDefaultFontFlags.hxx>
 #include <vcl/rendercontext/ImplMapRes.hxx>
 #include <vcl/rendercontext/InvertFlags.hxx>
+#include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
+#include <vcl/rendercontext/SystemTextColorFlags.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <vcl/scopedbitmapaccess.hxx>
 #include <vcl/settings.hxx>
@@ -137,6 +138,8 @@
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/range/b2drange.hxx>
 #include <basegfx/range/basicrange.hxx>
+#include <basegfx/tuple/Tuple2D.hxx>
+#include <basegfx/tuple/Tuple3D.hxx>
 #include <basegfx/tuple/b2dtuple.hxx>
 #include <basegfx/tuple/b2i64tuple.hxx>
 #include <basegfx/tuple/b2ituple.hxx>
@@ -189,7 +192,6 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/ui/ItemStyle.hpp>
 #include <com/sun/star/ui/UIElementType.hpp>
-#include <com/sun/star/ui/XImageManager.hpp>
 #include <com/sun/star/ui/XUIConfigurationListener.hpp>
 #include <com/sun/star/ui/XUIConfigurationManager.hpp>
 #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
@@ -219,11 +221,14 @@
 #include <com/sun/star/xml/sax/SAXException.hpp>
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 #include <comphelper/comphelperdllapi.h>
+#include <comphelper/interfacecontainer2.hxx>
 #include <comphelper/lok.hxx>
+#include <comphelper/multicontainer2.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/propertysequence.hxx>
 #include <comphelper/sequence.hxx>
 #include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/servicehelper.hxx>
 #include <cppu/cppudllapi.h>
 #include <cppu/unotype.hxx>
 #include <cppuhelper/basemutex.hxx>
@@ -231,7 +236,6 @@
 #include <cppuhelper/cppuhelperdllapi.h>
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/interfacecontainer.h>
-#include <cppuhelper/interfacecontainer.hxx>
 #include <cppuhelper/propshlp.hxx>
 #include <cppuhelper/queryinterface.hxx>
 #include <cppuhelper/supportsservice.hxx>
diff --git a/include/sfx2/LokControlHandler.hxx 
b/include/sfx2/LokControlHandler.hxx
index fc0b065c8834..cb48e9eb355b 100644
--- a/include/sfx2/LokControlHandler.hxx
+++ b/include/sfx2/LokControlHandler.hxx
@@ -115,7 +115,7 @@ public:
         // Resizes the virtual device so to contain the entries context
         rDevice.SetOutputSizePixel(aOutputSize);
 
-        rDevice.Push(PushFlags::MAPMODE);
+        rDevice.Push(vcl::PushFlags::MAPMODE);
         MapMode aDeviceMapMode(rDevice.GetMapMode());
 
         const Fraction scale = conversionFract(o3tl::Length::px, 
o3tl::Length::mm100);
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 6562e8197158..dfdabac2de24 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -20,6 +20,8 @@
 #ifndef INCLUDED_VCL_METAACT_HXX
 #define INCLUDED_VCL_METAACT_HXX
 
+#include <sal/config.h>
+
 #include <config_options.h>
 
 #include <rtl/ref.hxx>
@@ -27,6 +29,7 @@
 #include <tools/poly.hxx>
 
 #include <vcl/dllapi.h>
+#include <vcl/rendercontext/State.hxx>
 #include <vcl/bitmapex.hxx>
 #include <vcl/font.hxx>
 #include <vcl/gdimtf.hxx>
@@ -35,7 +38,6 @@
 #include <vcl/hatch.hxx>
 #include <vcl/lineinfo.hxx>
 #include <vcl/metaactiontypes.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/wall.hxx>
@@ -1468,7 +1470,7 @@ class VCL_DLLPUBLIC MetaPushAction final : public 
MetaAction
 {
 private:
 
-    PushFlags           mnFlags;
+    vcl::PushFlags           mnFlags;
 
 public:
                         MetaPushAction();
@@ -1482,10 +1484,10 @@ public:
     virtual void        Execute( OutputDevice* pOut ) override;
     virtual rtl::Reference<MetaAction> Clone() const override;
 
-    explicit            MetaPushAction( PushFlags nFlags );
+    explicit            MetaPushAction( vcl::PushFlags nFlags );
 
-    PushFlags           GetFlags() const { return mnFlags; }
-    void                SetPushFlags(const PushFlags nFlags) { mnFlags = 
nFlags; }
+    vcl::PushFlags           GetFlags() const { return mnFlags; }
+    void                SetPushFlags(const vcl::PushFlags nFlags) { mnFlags = 
nFlags; }
 };
 
 class VCL_DLLPUBLIC MetaPopAction final : public MetaAction
@@ -1702,7 +1704,7 @@ class VCL_DLLPUBLIC MetaLayoutModeAction final : public 
MetaAction
 {
 private:
 
-    ComplexTextLayoutFlags  mnLayoutMode;
+    vcl::text::ComplexTextLayoutFlags  mnLayoutMode;
 
 public:
                         MetaLayoutModeAction();
@@ -1716,10 +1718,10 @@ public:
     virtual void        Execute( OutputDevice* pOut ) override;
     virtual rtl::Reference<MetaAction> Clone() const override;
 
-    explicit            MetaLayoutModeAction( ComplexTextLayoutFlags 
nLayoutMode );
+    explicit            MetaLayoutModeAction( 
vcl::text::ComplexTextLayoutFlags nLayoutMode );
 
-    ComplexTextLayoutFlags  GetLayoutMode() const { return mnLayoutMode; }
-    void                SetLayoutMode(const ComplexTextLayoutFlags 
nLayoutMode) { mnLayoutMode = nLayoutMode; }
+    vcl::text::ComplexTextLayoutFlags  GetLayoutMode() const { return 
mnLayoutMode; }
+    void                SetLayoutMode(const vcl::text::ComplexTextLayoutFlags 
nLayoutMode) { mnLayoutMode = nLayoutMode; }
 };
 
 class VCL_DLLPUBLIC MetaTextLanguageAction final : public MetaAction
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index e241de432077..87a69647d2ba 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -44,11 +44,11 @@
 #include <vcl/rendercontext/InvertFlags.hxx>
 #include <vcl/rendercontext/RasterOp.hxx>
 #include <vcl/rendercontext/SalLayoutFlags.hxx>
+#include <vcl/rendercontext/State.hxx>
 #include <vcl/mapmod.hxx>
 #include <vcl/wall.hxx>
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/salnativewidgets.hxx>
-#include <vcl/outdevstate.hxx>
 #include <vcl/vclreferencebase.hxx>
 
 #include <basegfx/numeric/ftools.hxx>
@@ -185,7 +185,7 @@ private:
     mutable rtl::Reference<LogicalFontInstance> mpFontInstance;
     mutable std::unique_ptr<vcl::font::PhysicalFontFaceCollection>  
mpFontFaceCollection;
     mutable std::unique_ptr<ImplDeviceFontSizeList> mpDeviceFontSizeList;
-    std::vector<OutDevState>        maOutDevStateStack;
+    std::vector<vcl::State>        maOutDevStateStack;
     std::unique_ptr<ImplOutDevData> mpOutDevData;
     std::vector< VCLXGraphics* >*   mpUnoGraphicsList;
     vcl::ExtOutDevData*             mpExtOutDevData;
@@ -218,7 +218,7 @@ private:
     mutable tools::Long                    mnEmphasisAscent;
     mutable tools::Long                    mnEmphasisDescent;
     DrawModeFlags                   mnDrawMode;
-    ComplexTextLayoutFlags           mnTextLayoutMode;
+    vcl::text::ComplexTextLayoutFlags mnTextLayoutMode;
     ImplMapRes                      maMapRes;
     const OutDevType                meOutDevType;
     OutDevViewType                  meOutDevViewType;
@@ -469,7 +469,7 @@ private:
 
 public:
 
-    void                        Push( PushFlags nFlags = PushFlags::ALL );
+    void                        Push( vcl::PushFlags nFlags = 
vcl::PushFlags::ALL );
     void                        Pop();
     void                        ClearStack();
 
@@ -483,8 +483,8 @@ public:
     void                        SetDrawMode( DrawModeFlags nDrawMode );
     DrawModeFlags               GetDrawMode() const { return mnDrawMode; }
 
-    void                        SetLayoutMode( ComplexTextLayoutFlags 
nTextLayoutMode );
-    ComplexTextLayoutFlags      GetLayoutMode() const { return 
mnTextLayoutMode; }
+    void                        SetLayoutMode( 
vcl::text::ComplexTextLayoutFlags nTextLayoutMode );
+    vcl::text::ComplexTextLayoutFlags GetLayoutMode() const { return 
mnTextLayoutMode; }
 
     void                        SetDigitLanguage( LanguageType );
     LanguageType                GetDigitLanguage() const { return 
meTextLanguage; }
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index b473db868821..3601c88501f9 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -715,7 +715,7 @@ The following structure describes the permissions used in 
PDF security
     void               IntersectClipRegion( const tools::Rectangle& rRect );
     void               IntersectClipRegion( const basegfx::B2DPolyPolygon& 
rRegion );
 
-    void               SetLayoutMode( ComplexTextLayoutFlags nMode );
+    void               SetLayoutMode( vcl::text::ComplexTextLayoutFlags nMode 
);
     void               SetDigitLanguage( LanguageType eLang );
 
     void               SetLineColor( const Color& rColor );
diff --git a/include/vcl/outdevstate.hxx b/include/vcl/rendercontext/State.hxx
similarity index 59%
rename from include/vcl/outdevstate.hxx
rename to include/vcl/rendercontext/State.hxx
index a80620f957b6..99460e390814 100644
--- a/include/vcl/outdevstate.hxx
+++ b/include/vcl/rendercontext/State.hxx
@@ -34,50 +34,70 @@
 #include <memory>
 #include <optional>
 
-// Flags for OutputDevice::Push() and OutDevState
-enum class PushFlags {
-    NONE            = 0x0000,
-    LINECOLOR       = 0x0001,
-    FILLCOLOR       = 0x0002,
-    FONT            = 0x0004,
-    TEXTCOLOR       = 0x0008,
-    MAPMODE         = 0x0010,
-    CLIPREGION      = 0x0020,
-    RASTEROP        = 0x0040,
-    TEXTFILLCOLOR   = 0x0080,
-    TEXTALIGN       = 0x0100,
-    REFPOINT        = 0x0200,
-    TEXTLINECOLOR   = 0x0400,
-    TEXTLAYOUTMODE  = 0x0800,
-    TEXTLANGUAGE    = 0x1000,
-    OVERLINECOLOR   = 0x2000,
-    ALL             = 0xFFFF
+namespace vcl
+{
+// Flags for OutputDevice::Push() and State
+enum class PushFlags
+{
+    NONE = 0x0000,
+    LINECOLOR = 0x0001,
+    FILLCOLOR = 0x0002,
+    FONT = 0x0004,
+    TEXTCOLOR = 0x0008,
+    MAPMODE = 0x0010,
+    CLIPREGION = 0x0020,
+    RASTEROP = 0x0040,
+    TEXTFILLCOLOR = 0x0080,
+    TEXTALIGN = 0x0100,
+    REFPOINT = 0x0200,
+    TEXTLINECOLOR = 0x0400,
+    TEXTLAYOUTMODE = 0x0800,
+    TEXTLANGUAGE = 0x1000,
+    OVERLINECOLOR = 0x2000,
+    ALL = 0xFFFF
 };
+}
 
 namespace o3tl
 {
-    template<> struct typed_flags<PushFlags> : is_typed_flags<PushFlags, 
0xFFFF> {};
+template <> struct typed_flags<vcl::PushFlags> : 
is_typed_flags<vcl::PushFlags, 0xFFFF>
+{
+};
 }
-#define PUSH_ALLFONT  (PushFlags::TEXTCOLOR | PushFlags::TEXTFILLCOLOR | 
PushFlags::TEXTLINECOLOR | PushFlags::OVERLINECOLOR | PushFlags::TEXTALIGN | 
PushFlags::TEXTLAYOUTMODE | PushFlags::TEXTLANGUAGE | PushFlags::FONT)
+#define PUSH_ALLFONT                                                           
                    \
+    (vcl::PushFlags::TEXTCOLOR | vcl::PushFlags::TEXTFILLCOLOR | 
vcl::PushFlags::TEXTLINECOLOR     \
+     | vcl::PushFlags::OVERLINECOLOR | vcl::PushFlags::TEXTALIGN | 
vcl::PushFlags::TEXTLAYOUTMODE  \
+     | vcl::PushFlags::TEXTLANGUAGE | vcl::PushFlags::FONT)
 
+namespace vcl::text
+{
 // Layout flags for Complex Text Layout
 // These are flag values, i.e they can be combined
 enum class ComplexTextLayoutFlags
 {
-    Default           = 0x0000,
-    BiDiRtl           = 0x0001,
-    BiDiStrong        = 0x0002,
-    TextOriginLeft    = 0x0004,
-    TextOriginRight   = 0x0008
+    Default = 0x0000,
+    BiDiRtl = 0x0001,
+    BiDiStrong = 0x0002,
+    TextOriginLeft = 0x0004,
+    TextOriginRight = 0x0008
+};
+}
+
+namespace o3tl
+{
+template <>
+struct typed_flags<vcl::text::ComplexTextLayoutFlags>
+    : is_typed_flags<vcl::text::ComplexTextLayoutFlags, 0x000f>
+{
 };
-namespace o3tl {
-    template<> struct typed_flags<ComplexTextLayoutFlags> : 
is_typed_flags<ComplexTextLayoutFlags, 0x000f> {};
 }
 
-struct OutDevState
+namespace vcl
+{
+struct State
 {
-    OutDevState() = default;
-    OutDevState(OutDevState&&) = default;
+    State() = default;
+    State(State&&) = default;
 
     std::unique_ptr<vcl::Region> mpClipRegion;
     std::optional<MapMode> mpMapMode;
@@ -91,10 +111,11 @@ struct OutDevState
     std::optional<Color> mpOverlineColor;
     TextAlign meTextAlign = ALIGN_TOP;
     RasterOp meRasterOp = RasterOp::OverPaint;
-    ComplexTextLayoutFlags mnTextLayoutMode = ComplexTextLayoutFlags::Default;
+    text::ComplexTextLayoutFlags mnTextLayoutMode = 
text::ComplexTextLayoutFlags::Default;

... etc. - the rest is truncated

Reply via email to