[Libreoffice-commits] core.git: 2 commits - include/tools rsc/source vcl/source

Noel Grandin noelgrandin at gmail.com
Thu May 26 07:22:28 UTC 2016


 include/tools/rc.h            |   15 +++++++--------
 rsc/source/parser/rscicpx.cxx |    4 ++--
 vcl/source/control/field.cxx  |    6 +++---
 3 files changed, 12 insertions(+), 13 deletions(-)

New commits:
commit a92cb70768576bf906449f34db01afadc9ac7816
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Wed May 25 20:37:05 2016 +0200

    remove unused WORKWIN constants
    
    Change-Id: I2216f52999271a3d39c8062c1ad58bd6664306a7
    Reviewed-on: https://gerrit.libreoffice.org/25465
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/tools/rc.h b/include/tools/rc.h
index f39e0e7..6bfafde 100644
--- a/include/tools/rc.h
+++ b/include/tools/rc.h
@@ -49,12 +49,6 @@ namespace o3tl {
 #define WINDOW_QUICKTEXT                0x0100
 #define WINDOW_HELPID                   0x0200
 
-// For "WorkWindow" resources:
-
-#define WORKWIN_SHOWNORMAL              0
-#define WORKWIN_SHOWMINIMIZED           1
-#define WORKWIN_SHOWMAXIMIZED           2
-
 // For "FixedImage" resource:
 #define RSC_FIXEDIMAGE_IMAGE            0x0001
 
commit 12eec0ce0ce0d2008e80f294c4b2d4d3e6e3ef55
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Wed May 25 20:33:30 2016 +0200

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

diff --git a/include/tools/rc.h b/include/tools/rc.h
index 8b6d5ea..f39e0e7 100644
--- a/include/tools/rc.h
+++ b/include/tools/rc.h
@@ -98,8 +98,13 @@ namespace o3tl {
     template<> struct typed_flags<RscNumFormatterFlags> : is_typed_flags<RscNumFormatterFlags, 0x37> {};
 }
 
-#define METRICFORMATTER_UNIT            0x01
-#define METRICFORMATTER_CUSTOMUNITTEXT  0x02
+enum class RscMetricFormatterFlags {
+    Unit            = 0x01,
+    CustomUnitText  = 0x02
+};
+namespace o3tl {
+    template<> struct typed_flags<RscMetricFormatterFlags> : is_typed_flags<RscMetricFormatterFlags, 0x03> {};
+}
 
 #define NUMERICFIELD_FIRST              0x01
 #define NUMERICFIELD_LAST               0x02
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 20e05a5..1ec99f2 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -850,10 +850,10 @@ RscTop * RscTypCont::InitClassMetricFormatter( RscTop * pSuper,
     // initialize variables
     nId = aNmTb.Put( "Unit", VARNAME );
     pClassMetric->SetVariable( nId, pFieldUnits, nullptr,
-                               0, METRICFORMATTER_UNIT );
+                               0, (sal_uInt32)RscMetricFormatterFlags::Unit );
     nId = aNmTb.Put( "CustomUnitText", VARNAME );
     pClassMetric->SetVariable( nId, &aLangString, nullptr,
-                               0, METRICFORMATTER_CUSTOMUNITTEXT );
+                               0, (sal_uInt32)RscMetricFormatterFlags::CustomUnitText );
 
     return pClassMetric;
 }
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 40c2fff..1997cc1 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1416,9 +1416,9 @@ void MetricFormatter::ImplLoadRes( const ResId& rResId )
     ResMgr*     pMgr = rResId.GetResMgr();
     if( pMgr )
     {
-        sal_uLong       nMask = pMgr->ReadLong();
+        RscMetricFormatterFlags nMask = (RscMetricFormatterFlags)pMgr->ReadLong();
 
-        if ( METRICFORMATTER_UNIT & nMask )
+        if ( RscMetricFormatterFlags::Unit & nMask )
         {
             sal_uLong nUnit = pMgr->ReadLong();
             assert(nUnit <= FUNIT_MILLISECOND && "out of FieldUnit bounds");
@@ -1426,7 +1426,7 @@ void MetricFormatter::ImplLoadRes( const ResId& rResId )
                 meUnit = (FieldUnit)nUnit;
         }
 
-        if ( METRICFORMATTER_CUSTOMUNITTEXT & nMask )
+        if ( RscMetricFormatterFlags::CustomUnitText & nMask )
             maCustomUnitText = pMgr->ReadString();
     }
 }


More information about the Libreoffice-commits mailing list