diff options
-rw-r--r-- | include/tools/rc.h | 11 | ||||
-rw-r--r-- | rsc/source/parser/rscicpx.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 8 |
3 files changed, 15 insertions, 10 deletions
diff --git a/include/tools/rc.h b/include/tools/rc.h index b1fd2c081e56..8b6d5ea67daa 100644 --- a/include/tools/rc.h +++ b/include/tools/rc.h @@ -105,9 +105,14 @@ namespace o3tl { #define NUMERICFIELD_LAST 0x02 #define NUMERICFIELD_SPINSIZE 0x04 -#define METRICFIELD_FIRST 0x01 -#define METRICFIELD_LAST 0x02 -#define METRICFIELD_SPINSIZE 0x04 +enum class RscMetricFieldFlags { + First = 0x01, + Last = 0x02, + SpinSize = 0x04 +}; +namespace o3tl { + template<> struct typed_flags<RscMetricFieldFlags> : is_typed_flags<RscMetricFieldFlags, 0x07> {}; +} // For "ToolBoxItem" resources: #define RSC_TOOLBOXITEM_ID 0x0001 diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index adff90201de7..20e05a5bab82 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -916,13 +916,13 @@ RscTop * RscTypCont::InitClassMetricField( RscTop * pSuper ) // initialize variables nId = aNmTb.Put( "First", VARNAME ); pClassMetricField->SetVariable( nId, &aIdLong, nullptr, - 0, METRICFIELD_FIRST ); + 0, (sal_uInt32)RscMetricFieldFlags::First ); nId = aNmTb.Put( "Last", VARNAME ); pClassMetricField->SetVariable( nId, &aIdLong, nullptr, - 0, METRICFIELD_LAST ); + 0, (sal_uInt32)RscMetricFieldFlags::Last ); nId = aNmTb.Put( "SpinSize", VARNAME ); pClassMetricField->SetVariable( nId, &aIdLong, nullptr, - 0, METRICFIELD_SPINSIZE ); + 0, (sal_uInt32)RscMetricFieldFlags::SpinSize ); return pClassMetricField; } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 4ae94361f07a..40c2fffc9d25 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -1647,15 +1647,15 @@ void MetricField::ImplLoadRes( const ResId& rResId ) SpinField::ImplLoadRes( rResId ); MetricFormatter::ImplLoadRes( ResId( static_cast<RSHEADER_TYPE *>(GetClassRes()), *rResId.GetResMgr() ) ); - sal_uLong nMask = ReadLongRes(); + RscMetricFieldFlags nMask = (RscMetricFieldFlags)ReadLongRes(); - if ( METRICFIELD_FIRST & nMask ) + if ( RscMetricFieldFlags::First & nMask ) mnFirst = ReadLongRes(); - if ( METRICFIELD_LAST & nMask ) + if ( RscMetricFieldFlags::Last & nMask ) mnLast = ReadLongRes(); - if ( METRICFIELD_SPINSIZE & nMask ) + if ( RscMetricFieldFlags::SpinSize & nMask ) mnSpinSize = ReadLongRes(); Reformat(); |