diff options
-rw-r--r-- | include/tools/rc.h | 17 | ||||
-rw-r--r-- | include/tools/rcid.h | 2 | ||||
-rw-r--r-- | include/vcl/field.hxx | 5 | ||||
-rw-r--r-- | rsc/inc/rscdb.hxx | 3 | ||||
-rw-r--r-- | rsc/source/parser/rscicpx.cxx | 48 | ||||
-rw-r--r-- | rsc/source/parser/rscinit.cxx | 9 | ||||
-rw-r--r-- | tools/source/rc/resmgr.cxx | 1 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 54 |
8 files changed, 1 insertions, 138 deletions
diff --git a/include/tools/rc.h b/include/tools/rc.h index 97c9f2dd331c..396c8286987e 100644 --- a/include/tools/rc.h +++ b/include/tools/rc.h @@ -90,27 +90,10 @@ namespace o3tl { template<> struct typed_flags<RscNumFormatterFlags> : is_typed_flags<RscNumFormatterFlags, 0x37> {}; } -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 #define NUMERICFIELD_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: enum class RscToolboxItemFlags { Id = 0x0001, diff --git a/include/tools/rcid.h b/include/tools/rcid.h index 0f98bed3064f..95c4b9a58104 100644 --- a/include/tools/rcid.h +++ b/include/tools/rcid.h @@ -68,7 +68,7 @@ #define RSC_SPINFIELD (RSC_NOTYPE + 0x61) #define RSC_NUMERICFIELD (RSC_NOTYPE + 0x63) -#define RSC_METRICFIELD (RSC_NOTYPE + 0x64) + #define RSC_TOOLBOXITEM (RSC_NOTYPE + 0x70) #define RSC_TOOLBOX (RSC_NOTYPE + 0x71) diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index 90267eb269e2..96873ff2f0ec 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -210,7 +210,6 @@ protected: protected: MetricFormatter(); - SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); SAL_DLLPRIVATE bool ImplMetricReformat( const OUString& rStr, double& rValue, OUString& rOutStr ); public: @@ -475,12 +474,8 @@ public: class VCL_DLLPUBLIC MetricField : public SpinField, public MetricFormatter { -protected: - SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); - public: explicit MetricField( vcl::Window* pParent, WinBits nWinStyle ); - explicit MetricField( vcl::Window* pParent, const ResId& ); virtual bool PreNotify( NotifyEvent& rNEvt ) override; virtual bool Notify( NotifyEvent& rNEvt ) override; diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index 6e3f6d955b49..dee45c8eddb1 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -199,12 +199,9 @@ class RscTypCont RscTop * InitClassMenu( RscTop * pSuper, RscTop * pMenuItem ); RscTop * InitClassNumericFormatter( RscTop * pSuper ); - RscTop * InitClassMetricFormatter( RscTop * pSuper, - RscEnum * pFieldUnits ); RscTop * InitClassSpinField( RscTop * pSuper ); RscTop * InitClassNumericField( RscTop * pSuper ); - RscTop * InitClassMetricField( RscTop * pSuper ); RscTop * InitClassDockingWindow( RscTop * pSuper, RscEnum * pMapUnit ); diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index 39db9c852da3..56a6c2ea1142 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -800,28 +800,6 @@ RscTop * RscTypCont::InitClassNumericFormatter( RscTop * pSuper ) return pClassNumeric; } -RscTop * RscTypCont::InitClassMetricFormatter( RscTop * pSuper, - RscEnum * pFieldUnits ) -{ - Atom nId; - RscTop * pClassMetric; - - // initialize class - nId = pHS->getID( "MetricFormatter" ); - pClassMetric = new RscClass( nId, RSC_NOTYPE, pSuper ); - pClassMetric->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType ); - - // initialize variables - nId = aNmTb.Put( "Unit", VARNAME ); - pClassMetric->SetVariable( nId, pFieldUnits, nullptr, - 0, (sal_uInt32)RscMetricFormatterFlags::Unit ); - nId = aNmTb.Put( "CustomUnitText", VARNAME ); - pClassMetric->SetVariable( nId, &aLangString, nullptr, - 0, (sal_uInt32)RscMetricFormatterFlags::CustomUnitText ); - - return pClassMetric; -} - RscTop * RscTypCont::InitClassSpinField( RscTop * pSuper ) { Atom nId; @@ -865,32 +843,6 @@ RscTop * RscTypCont::InitClassNumericField( RscTop * pSuper ) return pClassNumericField; } -RscTop * RscTypCont::InitClassMetricField( RscTop * pSuper ) -{ - Atom nId; - RscTop * pClassMetricField; - - // initialize class - nId = pHS->getID( "MetricField" ); - pClassMetricField = new RscClass( nId, RSC_METRICFIELD, pSuper ); - pClassMetricField->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType ); - - aNmTb.Put( nId, CLASSNAME, pClassMetricField ); - - // initialize variables - nId = aNmTb.Put( "First", VARNAME ); - pClassMetricField->SetVariable( nId, &aIdLong, nullptr, - 0, (sal_uInt32)RscMetricFieldFlags::First ); - nId = aNmTb.Put( "Last", VARNAME ); - pClassMetricField->SetVariable( nId, &aIdLong, nullptr, - 0, (sal_uInt32)RscMetricFieldFlags::Last ); - nId = aNmTb.Put( "SpinSize", VARNAME ); - pClassMetricField->SetVariable( nId, &aIdLong, nullptr, - 0, (sal_uInt32)RscMetricFieldFlags::SpinSize ); - - return pClassMetricField; -} - RscTop * RscTypCont::InitClassDockingWindow( RscTop * pSuper, RscEnum * pMapUnit ) { diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx index 7a363813c8d1..022889a010f9 100644 --- a/rsc/source/parser/rscinit.cxx +++ b/rsc/source/parser/rscinit.cxx @@ -396,15 +396,6 @@ void RscTypCont::Init() RscTop* pClassNumericField = InitClassNumericField( pClassTmp ); pRoot->Insert( pClassNumericField ); } - { // hand-made multiple inheritance - RscTop* pClassTmp = InitClassNumericFormatter( pClassSpinField ); - aBaseLst.push_back( pClassTmp ); - pClassTmp = InitClassMetricFormatter( pClassTmp, pFieldUnits ); - aBaseLst.push_back( pClassTmp ); - - RscTop* pClassMetricField = InitClassMetricField( pClassTmp ); - pRoot->Insert( pClassMetricField ); - } } { RscTop* pClassDockingWindow = InitClassDockingWindow( pClassWindow, pMapUnit ); diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index 8385e280e7fc..983f78da4229 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -1431,7 +1431,6 @@ OString ResMgr::GetAutoHelpId() case RSC_PUSHBUTTON: aHID.append( "PushButton" ); break; case RSC_SPINFIELD: aHID.append( "SpinField" ); break; case RSC_NUMERICFIELD: aHID.append( "NumericField" ); break; - case RSC_METRICFIELD: aHID.append( "MetricField" ); break; case RSC_IMAGEBUTTON: aHID.append( "ImageButton" ); break; default: // no type, no auto HID diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index c71ae85c40f0..4ea339ced88a 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -1407,28 +1407,6 @@ MetricFormatter::MetricFormatter() ImplInit(); } -void MetricFormatter::ImplLoadRes( const ResId& rResId ) -{ - NumericFormatter::ImplLoadRes( rResId ); - - ResMgr* pMgr = rResId.GetResMgr(); - if( pMgr ) - { - RscMetricFormatterFlags nMask = (RscMetricFormatterFlags)pMgr->ReadLong(); - - if ( RscMetricFormatterFlags::Unit & nMask ) - { - sal_uLong nUnit = pMgr->ReadLong(); - assert(nUnit <= FUNIT_MILLISECOND && "out of FieldUnit bounds"); - if (nUnit <= FUNIT_MILLISECOND) - meUnit = (FieldUnit)nUnit; - } - - if ( RscMetricFormatterFlags::CustomUnitText & nMask ) - maCustomUnitText = pMgr->ReadString(); - } -} - MetricFormatter::~MetricFormatter() { } @@ -1605,19 +1583,6 @@ MetricField::MetricField( vcl::Window* pParent, WinBits nWinStyle ) : Reformat(); } -MetricField::MetricField( vcl::Window* pParent, const ResId& rResId ) : - SpinField( WINDOW_METRICFIELD ) -{ - rResId.SetRT( RSC_METRICFIELD ); - WinBits nStyle = ImplInitRes( rResId ) ; - SpinField::ImplInit( pParent, nStyle ); - SetField( this ); - ImplLoadRes( rResId ); - - if ( !(nStyle & WB_HIDE ) ) - Show(); -} - void MetricField::dispose() { MetricFormatter::SetField( nullptr ); @@ -1640,25 +1605,6 @@ bool MetricField::set_property(const OString &rKey, const OString &rValue) return true; } -void MetricField::ImplLoadRes( const ResId& rResId ) -{ - SpinField::ImplLoadRes( rResId ); - MetricFormatter::ImplLoadRes( ResId( static_cast<RSHEADER_TYPE *>(GetClassRes()), *rResId.GetResMgr() ) ); - - RscMetricFieldFlags nMask = (RscMetricFieldFlags)ReadLongRes(); - - if ( RscMetricFieldFlags::First & nMask ) - mnFirst = ReadLongRes(); - - if ( RscMetricFieldFlags::Last & nMask ) - mnLast = ReadLongRes(); - - if ( RscMetricFieldFlags::SpinSize & nMask ) - mnSpinSize = ReadLongRes(); - - Reformat(); -} - void MetricField::SetUnit( FieldUnit nNewUnit ) { sal_Int64 nRawMax = GetMax( nNewUnit ); |