[Libreoffice-commits] core.git: vcl/inc vcl/unx

Noel Grandin noel at peralex.com
Tue May 24 06:53:36 UTC 2016


 vcl/inc/unx/printergfx.hxx           |    6 +++---
 vcl/unx/generic/print/bitmap_gfx.cxx |   32 ++++++++++++++++----------------
 2 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 93e61f9663df7e3986d88d6cb7db795af96a11b4
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 23 10:17:16 2016 +0200

    Convert ImageType to scoped enum
    
    Change-Id: I7928fe7f1d6e96dcf42b03bd04fa9499371bbd98
    Reviewed-on: https://gerrit.libreoffice.org/25354
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/vcl/inc/unx/printergfx.hxx b/vcl/inc/unx/printergfx.hxx
index d4807fe..6f71cba 100644
--- a/vcl/inc/unx/printergfx.hxx
+++ b/vcl/inc/unx/printergfx.hxx
@@ -138,13 +138,13 @@ public:
     virtual sal_uInt32  GetDepth ()     const = 0;
 };
 
-typedef enum {
-    InvalidType = 0,
+enum class ImageType {
+    Invalid = 0,
     TrueColorImage,
     MonochromeImage,
     PaletteImage,
     GrayScaleImage
-} ImageType;
+};
 
 /*
  * printer raster operations
diff --git a/vcl/unx/generic/print/bitmap_gfx.cxx b/vcl/unx/generic/print/bitmap_gfx.cxx
index d89d190..93ed0ce 100644
--- a/vcl/unx/generic/print/bitmap_gfx.cxx
+++ b/vcl/unx/generic/print/bitmap_gfx.cxx
@@ -523,10 +523,10 @@ PrinterGfx::writePS2ImageHeader (const Rectangle& rArea, psp::ImageType nType)
     sal_Int32 nDictType = 0;
     switch (nType)
     {
-        case psp::TrueColorImage:  nDictType = 0; break;
-        case psp::PaletteImage:    nDictType = 1; break;
-        case psp::GrayScaleImage:  nDictType = 2; break;
-        case psp::MonochromeImage: nDictType = 3; break;
+        case psp::ImageType::TrueColorImage:  nDictType = 0; break;
+        case psp::ImageType::PaletteImage:    nDictType = 1; break;
+        case psp::ImageType::GrayScaleImage:  nDictType = 2; break;
+        case psp::ImageType::MonochromeImage: nDictType = 3; break;
         default: break;
     }
     sal_Int32 nCompressType = mbCompressBmp ? 1 : 0;
@@ -548,18 +548,18 @@ PrinterGfx::writePS2Colorspace(const PrinterBmp& rBitmap, psp::ImageType nType)
 {
     switch (nType)
     {
-        case psp::GrayScaleImage:
+        case psp::ImageType::GrayScaleImage:
 
             WritePS (mpPageBody, "/DeviceGray setcolorspace\n");
             break;
 
-        case psp::TrueColorImage:
+        case psp::ImageType::TrueColorImage:
 
             WritePS (mpPageBody, "/DeviceRGB setcolorspace\n");
             break;
 
-        case psp::MonochromeImage:
-        case psp::PaletteImage:
+        case psp::ImageType::MonochromeImage:
+        case psp::ImageType::PaletteImage:
         {
 
             sal_Int32 nChar = 0;
@@ -597,8 +597,8 @@ PrinterGfx::writePS2Colorspace(const PrinterBmp& rBitmap, psp::ImageType nType)
 void
 PrinterGfx::DrawPS2GrayImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
 {
-    writePS2Colorspace(rBitmap, psp::GrayScaleImage);
-    writePS2ImageHeader(rArea, psp::GrayScaleImage);
+    writePS2Colorspace(rBitmap, psp::ImageType::GrayScaleImage);
+    writePS2ImageHeader(rArea, psp::ImageType::GrayScaleImage);
 
     std::unique_ptr<ByteEncoder> xEncoder(mbCompressBmp ? new LZWEncoder(mpPageBody)
                                             : new Ascii85Encoder(mpPageBody));
@@ -616,8 +616,8 @@ PrinterGfx::DrawPS2GrayImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
 void
 PrinterGfx::DrawPS2MonoImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
 {
-    writePS2Colorspace(rBitmap, psp::MonochromeImage);
-    writePS2ImageHeader(rArea, psp::MonochromeImage);
+    writePS2Colorspace(rBitmap, psp::ImageType::MonochromeImage);
+    writePS2ImageHeader(rArea, psp::ImageType::MonochromeImage);
 
     std::unique_ptr<ByteEncoder> xEncoder(mbCompressBmp ? new LZWEncoder(mpPageBody)
                                             : new Ascii85Encoder(mpPageBody));
@@ -648,8 +648,8 @@ PrinterGfx::DrawPS2MonoImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
 void
 PrinterGfx::DrawPS2PaletteImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
 {
-    writePS2Colorspace(rBitmap, psp::PaletteImage);
-    writePS2ImageHeader(rArea, psp::PaletteImage);
+    writePS2Colorspace(rBitmap, psp::ImageType::PaletteImage);
+    writePS2ImageHeader(rArea, psp::ImageType::PaletteImage);
 
     std::unique_ptr<ByteEncoder> xEncoder(mbCompressBmp ? new LZWEncoder(mpPageBody)
                                             : new Ascii85Encoder(mpPageBody));
@@ -667,8 +667,8 @@ PrinterGfx::DrawPS2PaletteImage (const PrinterBmp& rBitmap, const Rectangle& rAr
 void
 PrinterGfx::DrawPS2TrueColorImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
 {
-    writePS2Colorspace(rBitmap, psp::TrueColorImage);
-    writePS2ImageHeader(rArea, psp::TrueColorImage);
+    writePS2Colorspace(rBitmap, psp::ImageType::TrueColorImage);
+    writePS2ImageHeader(rArea, psp::ImageType::TrueColorImage);
 
     std::unique_ptr<ByteEncoder> xEncoder(mbCompressBmp ? new LZWEncoder(mpPageBody)
                                             : new Ascii85Encoder(mpPageBody));


More information about the Libreoffice-commits mailing list