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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 22 06:35:04 UTC 2018


 compilerplugins/clang/unusedenumconstants.untouched.results |   12 ---
 vcl/inc/unx/saldisp.hxx                                     |    5 -
 vcl/unx/generic/app/saldisp.cxx                             |   44 ++++++------
 3 files changed, 23 insertions(+), 38 deletions(-)

New commits:
commit fe39cd0df3e1c9e1e4ea71b3759371cbcca944dd
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Nov 21 13:48:54 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Nov 22 07:34:34 2018 +0100

    convert SalRGB to scoped enum
    
    and remove unused values
    
    Change-Id: Id10c18e832d54a6e530c3fe197b230d2d511d79c
    Reviewed-on: https://gerrit.libreoffice.org/63739
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/unusedenumconstants.untouched.results b/compilerplugins/clang/unusedenumconstants.untouched.results
index 1bc5f5f600d5..df0a83601656 100644
--- a/compilerplugins/clang/unusedenumconstants.untouched.results
+++ b/compilerplugins/clang/unusedenumconstants.untouched.results
@@ -544,18 +544,6 @@ vcl/inc/salptype.hxx:44
     enum SalPrinterError General
 vcl/inc/unx/saldisp.hxx:65
     srv_vendor_t vendor_none
-vcl/inc/unx/saldisp.hxx:77
-    enum SalRGB RGBA
-vcl/inc/unx/saldisp.hxx:77
-    enum SalRGB RBGA
-vcl/inc/unx/saldisp.hxx:78
-    enum SalRGB GBRA
-vcl/inc/unx/saldisp.hxx:78
-    enum SalRGB GRBA
-vcl/inc/unx/saldisp.hxx:79
-    enum SalRGB BRGA
-vcl/inc/unx/saldisp.hxx:79
-    enum SalRGB BGRA
 vcl/source/gdi/CommonSalLayout.cxx:129
     enum (anonymous namespace)::VerticalOrientation Rotated
 vcl/unx/gtk3/gtk3gtkinst.cxx:2524
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 44fb08b87a91..c5bc241a37cc 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -71,12 +71,9 @@ extern "C" srv_vendor_t sal_GetServerVendor( Display *p_display );
 
 // MSB/Bigendian view (Color == RGB, r=0xFF0000, g=0xFF00, b=0xFF)
 
-enum SalRGB { RGB,  RBG,
+enum class SalRGB { RGB,  RBG,
               GBR,  GRB,
               BGR,  BRG,
-              RGBA, RBGA,
-              GBRA, GRBA,
-              BGRA, BRGA,
               otherSalRGB };
 
 class SalVisual : public XVisualInfo
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index e454587bafe0..ba436d4b3945 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -2393,7 +2393,7 @@ bool SalDisplay::XIfEventWithTimeout( XEvent* o_pEvent, XPointer i_pPredicateDat
 }
 
 SalVisual::SalVisual():
-    eRGBMode_(RGB), nRedShift_(0), nGreenShift_(0), nBlueShift_(0), nRedBits_(0), nGreenBits_(0),
+    eRGBMode_(SalRGB::RGB), nRedShift_(0), nGreenShift_(0), nBlueShift_(0), nRedBits_(0), nGreenBits_(0),
     nBlueBits_(0)
 {}
 
@@ -2414,46 +2414,46 @@ SalVisual::SalVisual( const XVisualInfo* pXVI )
             if( red_mask == 0xFF0000 )
                 if( green_mask == 0xFF00 )
                     if( blue_mask  == 0xFF )
-                        eRGBMode_ = RGB;
+                        eRGBMode_ = SalRGB::RGB;
                     else
-                        eRGBMode_ = otherSalRGB;
+                        eRGBMode_ = SalRGB::otherSalRGB;
                 else if( blue_mask  == 0xFF00 )
                     if( green_mask == 0xFF )
-                        eRGBMode_ = RBG;
+                        eRGBMode_ = SalRGB::RBG;
                     else
-                        eRGBMode_ = otherSalRGB;
+                        eRGBMode_ = SalRGB::otherSalRGB;
                 else
-                    eRGBMode_ = otherSalRGB;
+                    eRGBMode_ = SalRGB::otherSalRGB;
             else if( green_mask == 0xFF0000 )
                 if( red_mask == 0xFF00 )
                     if( blue_mask  == 0xFF )
-                        eRGBMode_ = GRB;
+                        eRGBMode_ = SalRGB::GRB;
                     else
-                        eRGBMode_ = otherSalRGB;
+                        eRGBMode_ = SalRGB::otherSalRGB;
                 else if( blue_mask == 0xFF00 )
                     if( red_mask  == 0xFF )
-                        eRGBMode_ = GBR;
+                        eRGBMode_ = SalRGB::GBR;
                     else
-                        eRGBMode_ = otherSalRGB;
+                        eRGBMode_ = SalRGB::otherSalRGB;
                 else
-                    eRGBMode_ = otherSalRGB;
+                    eRGBMode_ = SalRGB::otherSalRGB;
             else if( blue_mask == 0xFF0000 )
                 if( red_mask == 0xFF00 )
                     if( green_mask  == 0xFF )
-                        eRGBMode_ = BRG;
+                        eRGBMode_ = SalRGB::BRG;
                     else
-                        eRGBMode_ = otherSalRGB;
+                        eRGBMode_ = SalRGB::otherSalRGB;
                 else if( green_mask == 0xFF00 )
                     if( red_mask == 0xFF )
-                        eRGBMode_ = BGR;
+                        eRGBMode_ = SalRGB::BGR;
                     else
-                        eRGBMode_ = otherSalRGB;
+                        eRGBMode_ = SalRGB::otherSalRGB;
                 else
-                    eRGBMode_ = otherSalRGB;
+                    eRGBMode_ = SalRGB::otherSalRGB;
             else
-                eRGBMode_ = otherSalRGB;
+                eRGBMode_ = SalRGB::otherSalRGB;
         else
-            eRGBMode_ = otherSalRGB;
+            eRGBMode_ = SalRGB::otherSalRGB;
     }
 }
 
@@ -2462,8 +2462,8 @@ SalVisual::SalVisual( const XVisualInfo* pXVI )
 
 // Color is RGB (ABGR) a=0xFF000000, r=0xFF0000, g=0xFF00, b=0xFF
 
-#define SALCOLOR        RGB
-#define SALCOLORREVERSE BGR
+#define SALCOLOR        SalRGB::RGB
+#define SALCOLORREVERSE SalRGB::BGR
 
 Color SalVisual::GetTCColor( Pixel nPixel ) const
 {
@@ -2479,7 +2479,7 @@ Color SalVisual::GetTCColor( Pixel nPixel ) const
     Pixel g = nPixel & green_mask;
     Pixel b = nPixel & blue_mask;
 
-    if( otherSalRGB != eRGBMode_ ) // 8+8+8=24
+    if( SalRGB::otherSalRGB != eRGBMode_ ) // 8+8+8=24
         return Color( r >> nRedShift_,
                               g >> nGreenShift_,
                               b >> nBlueShift_ );
@@ -2510,7 +2510,7 @@ Pixel SalVisual::GetTCPixel( Color nColor ) const
     if( SALCOLORREVERSE == eRGBMode_ )
         return (b << 16) | (g << 8) | r;
 
-    if( otherSalRGB != eRGBMode_ ) // 8+8+8=24
+    if( SalRGB::otherSalRGB != eRGBMode_ ) // 8+8+8=24
         return (r << nRedShift_) | (g << nGreenShift_) | (b << nBlueShift_);
 
     if( nRedShift_ > 0 )   r <<= nRedShift_;   else r >>= -nRedShift_;


More information about the Libreoffice-commits mailing list