include/vcl/outdev.hxx       |    6 +++---
 vcl/source/gdi/print.cxx     |    9 ++++++---
 vcl/source/gdi/virdev.cxx    |   16 +++++++---------
 vcl/source/outdev/outdev.cxx |    4 ++--
 vcl/source/window/window.cxx |   14 ++++++--------
 5 files changed, 24 insertions(+), 25 deletions(-)

New commits:
commit 7a46940d0a8782ed40b7e8182d883b02eb69bc40
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Tue Oct 23 11:00:31 2018 +0000
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Tue Oct 23 23:28:23 2018 +0200

    Constify OutputDevice::meOutDevType
    
    Change-Id: Idfa57c545704626a8b8b7405cd32c49666a04746
    Reviewed-on: https://gerrit.libreoffice.org/62255
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index c9f9d06db17c..72d5ae57dca9 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -298,7 +298,7 @@ namespace o3tl
     template<> struct typed_flags<InvertFlags> : is_typed_flags<InvertFlags, 
0x0007> {};
 }
 
-enum OutDevType { OUTDEV_DONTKNOW, OUTDEV_WINDOW, OUTDEV_PRINTER, 
OUTDEV_VIRDEV };
+enum OutDevType { OUTDEV_WINDOW, OUTDEV_PRINTER, OUTDEV_VIRDEV };
 
 enum class OutDevViewType { DontKnow, PrintPreview, SlideShow };
 
@@ -379,7 +379,7 @@ private:
     ComplexTextLayoutFlags           mnTextLayoutMode;
     ImplMapRes                      maMapRes;
     ImplThresholdRes                maThresRes;
-    OutDevType                      meOutDevType;
+    const OutDevType                meOutDevType;
     OutDevViewType                  meOutDevViewType;
     vcl::Region                     maRegion;           // contains the clip 
region, see SetClipRegion(...)
     Color                           maLineColor;
@@ -421,7 +421,7 @@ private:
     ///@{
 
 protected:
-                                OutputDevice();
+                                OutputDevice(OutDevType eOutDevType);
     virtual                     ~OutputDevice() override;
     virtual void                dispose() override;
 
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 36edd1bbcdde..2c9a58dec73d 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -461,7 +461,6 @@ OUString Printer::GetDefaultPrinterName()
 void Printer::ImplInitData()
 {
     mbDevOutput         = false;
-    meOutDevType        = OUTDEV_PRINTER;
     mbDefPrinter        = false;
     mnError             = ERRCODE_NONE;
     mnPageQueueSize     = 0;
@@ -854,6 +853,7 @@ long Printer::GetGradientStepCount( long nMinRect )
 }
 
 Printer::Printer()
+    : OutputDevice(OUTDEV_PRINTER)
 {
     ImplInitData();
     SalPrinterQueueInfo* pInfo = ImplGetQueueInfo( GetDefaultPrinterName(), 
nullptr );
@@ -867,8 +867,9 @@ Printer::Printer()
         ImplInitDisplay();
 }
 
-Printer::Printer( const JobSetup& rJobSetup ) :
-    maJobSetup( rJobSetup )
+Printer::Printer( const JobSetup& rJobSetup )
+    : OutputDevice(OUTDEV_PRINTER)
+    , maJobSetup(rJobSetup)
 {
     ImplInitData();
     const ImplJobSetup& rConstData = rJobSetup.ImplGetConstData();
@@ -888,6 +889,7 @@ Printer::Printer( const JobSetup& rJobSetup ) :
 }
 
 Printer::Printer( const QueueInfo& rQueueInfo )
+    : OutputDevice(OUTDEV_PRINTER)
 {
     ImplInitData();
     SalPrinterQueueInfo* pInfo = ImplGetQueueInfo( rQueueInfo.GetPrinterName(),
@@ -899,6 +901,7 @@ Printer::Printer( const QueueInfo& rQueueInfo )
 }
 
 Printer::Printer( const OUString& rPrinterName )
+    : OutputDevice(OUTDEV_PRINTER)
 {
     ImplInitData();
     SalPrinterQueueInfo* pInfo = ImplGetQueueInfo( rPrinterName, nullptr );
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index e0dc6ee1c201..425b2d153a4e 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -112,6 +112,9 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* 
pOutDev,
 {
     SAL_INFO( "vcl.virdev", "ImplInitVirDev(" << nDX << "," << nDY << "," << 
static_cast<int>(eFormat) << ")" );
 
+    meRefDevMode = RefDevMode::NONE;
+    mbForceZeroExtleadBug = false;
+
     bool bErase = nDX > 0 && nDY > 0;
 
     if ( nDX < 1 )
@@ -166,7 +169,6 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* 
pOutDev,
     else if ( pOutDev->GetOutDevType() == OUTDEV_VIRDEV )
         mbScreenComp = static_cast<const 
VirtualDevice*>(pOutDev)->mbScreenComp;
 
-    meOutDevType    = OUTDEV_VIRDEV;
     mbDevOutput     = true;
     mxFontCollection = pSVData->maGDIData.mxScreenFontList;
     mxFontCache     = pSVData->maGDIData.mxScreenFontCache;
@@ -199,8 +201,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* 
pOutDev,
 }
 
 VirtualDevice::VirtualDevice(DeviceFormat eFormat)
-:   meRefDevMode( RefDevMode::NONE ),
-    mbForceZeroExtleadBug( false )
+    : OutputDevice(OUTDEV_VIRDEV)
 {
     SAL_INFO( "vcl.virdev", "VirtualDevice::VirtualDevice( " << 
static_cast<int>(eFormat) << " )" );
 
@@ -208,8 +209,7 @@ VirtualDevice::VirtualDevice(DeviceFormat eFormat)
 }
 
 VirtualDevice::VirtualDevice(const OutputDevice& rCompDev, DeviceFormat 
eFormat)
-    : meRefDevMode( RefDevMode::NONE ),
-    mbForceZeroExtleadBug( false )
+    : OutputDevice(OUTDEV_VIRDEV)
 {
     SAL_INFO( "vcl.virdev", "VirtualDevice::VirtualDevice( " << 
static_cast<int>(eFormat) << " )" );
 
@@ -217,8 +217,7 @@ VirtualDevice::VirtualDevice(const OutputDevice& rCompDev, 
DeviceFormat eFormat)
 }
 
 VirtualDevice::VirtualDevice(const OutputDevice& rCompDev, DeviceFormat 
eFormat, DeviceFormat eAlphaFormat)
-    : meRefDevMode( RefDevMode::NONE )
-    , mbForceZeroExtleadBug( false )
+    : OutputDevice(OUTDEV_VIRDEV)
 {
     SAL_INFO( "vcl.virdev",
             "VirtualDevice::VirtualDevice( " << static_cast<int>(eFormat) << 
", " << static_cast<int>(eAlphaFormat) << " )" );
@@ -231,8 +230,7 @@ VirtualDevice::VirtualDevice(const OutputDevice& rCompDev, 
DeviceFormat eFormat,
 
 VirtualDevice::VirtualDevice(const SystemGraphicsData *pData, const Size 
&rSize,
                              DeviceFormat eFormat)
-:   meRefDevMode( RefDevMode::NONE ),
-    mbForceZeroExtleadBug( false )
+    : OutputDevice(OUTDEV_VIRDEV)
 {
     SAL_INFO( "vcl.virdev", "VirtualDevice::VirtualDevice( " << 
static_cast<int>(eFormat) << " )" );
 
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index ad56b6d36357..2be0140182c6 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -46,7 +46,8 @@ namespace {
 
 // Begin initializer and accessor public functions
 
-OutputDevice::OutputDevice() :
+OutputDevice::OutputDevice(OutDevType eOutDevType) :
+    meOutDevType(eOutDevType),
     maRegion(true),
     maFillColor( COL_WHITE ),
     maTextLineColor( COL_TRANSPARENT ),
@@ -85,7 +86,6 @@ OutputDevice::OutputDevice() :
     if( AllSettings::GetLayoutRTL() ) //#i84553# tip BiDi preference to RTL
         mnTextLayoutMode            = ComplexTextLayoutFlags::BiDiRtl | 
ComplexTextLayoutFlags::TextOriginLeft;
 
-    meOutDevType                    = OUTDEV_DONTKNOW;
     meOutDevViewType                = OutDevViewType::DontKnow;
     mbMap                           = false;
     mbClipRegion                    = false;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 247a465f23b7..fc56c4d09d29 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -86,20 +86,18 @@ using namespace ::com::sun::star::datatransfer::dnd;
 
 namespace vcl {
 
-Window::Window( WindowType nType ) :
-    mpWindowImpl(new WindowImpl( nType ))
+Window::Window( WindowType nType )
+    : OutputDevice(OUTDEV_WINDOW)
+    , mpWindowImpl(new WindowImpl( nType ))
 {
-    meOutDevType = OUTDEV_WINDOW;
-
     // true: this outdev will be mirrored if RTL window layout (UI mirroring) 
is globally active
     mbEnableRTL = AllSettings::GetLayoutRTL();
 }
 
-Window::Window( vcl::Window* pParent, WinBits nStyle ) :
-    mpWindowImpl(new WindowImpl( WindowType::WINDOW ))
+Window::Window( vcl::Window* pParent, WinBits nStyle )
+    : OutputDevice(OUTDEV_WINDOW)
+    , mpWindowImpl(new WindowImpl( WindowType::WINDOW ))
 {
-    meOutDevType = OUTDEV_WINDOW;
-
     // true: this outdev will be mirrored if RTL window layout (UI mirroring) 
is globally active
     mbEnableRTL = AllSettings::GetLayoutRTL();
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to