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

Caolán McNamara caolanm at redhat.com
Thu Oct 6 11:37:08 UTC 2016


 include/tools/rc.h            |   17 -------------
 include/tools/rcid.h          |    2 -
 include/vcl/field.hxx         |    5 ---
 rsc/inc/rscdb.hxx             |    3 --
 rsc/source/parser/rscicpx.cxx |   48 -------------------------------------
 rsc/source/parser/rscinit.cxx |    9 -------
 tools/source/rc/resmgr.cxx    |    1 
 vcl/source/control/field.cxx  |   54 ------------------------------------------
 8 files changed, 1 insertion(+), 138 deletions(-)

New commits:
commit c8c4f28f1131f4e993f5cc7693077457b03b4400
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 6 12:07:32 2016 +0100

    no MetricFields are loaded from .src files now
    
    Change-Id: I4b30cbc7bc6a3a3a635c3889d43b7fa6513209f5

diff --git a/include/tools/rc.h b/include/tools/rc.h
index 97c9f2d..396c828 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 0f98bed..95c4b9a 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 90267eb..96873ff 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 6e3f6d9..dee45c8 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 39db9c8..56a6c2e 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 7a36381..022889a 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 8385e28..983f78d 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 c71ae85..4ea339ce 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 );


More information about the Libreoffice-commits mailing list