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

Noel Grandin noel.grandin at collabora.co.uk
Tue Feb 14 07:31:28 UTC 2017


 include/tools/rcid.h        |   14 +++++++-------
 include/tools/resid.hxx     |   16 +++++++++-------
 include/tools/resmgr.hxx    |    2 +-
 rsc/inc/rscarray.hxx        |    4 ++--
 rsc/inc/rscclass.hxx        |    6 +++---
 rsc/inc/rscconst.hxx        |    5 +++--
 rsc/inc/rsccont.hxx         |    8 ++++----
 rsc/inc/rscflag.hxx         |    4 ++--
 rsc/inc/rscmgr.hxx          |    2 +-
 rsc/inc/rscrange.hxx        |   10 +++++-----
 rsc/inc/rscstr.hxx          |    2 +-
 rsc/inc/rsctop.hxx          |    3 ++-
 rsc/source/parser/rscdb.cxx |    8 ++++----
 rsc/source/res/rscarray.cxx |    4 ++--
 rsc/source/res/rscclass.cxx |    6 +++---
 rsc/source/res/rscconst.cxx |    4 ++--
 rsc/source/res/rsccont.cxx  |    8 ++++----
 rsc/source/res/rscflag.cxx  |    4 ++--
 rsc/source/res/rscmgr.cxx   |    2 +-
 rsc/source/res/rscrange.cxx |   10 +++++-----
 rsc/source/res/rscstr.cxx   |    2 +-
 rsc/source/res/rsctop.cxx   |    2 +-
 tools/source/rc/resmgr.cxx  |   10 +++++-----
 23 files changed, 70 insertions(+), 66 deletions(-)

New commits:
commit 2b70fb58be039fbd05ea833a40b1b3e9f922e45c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Feb 13 19:09:17 2017 +0200

    Use o3tl::strong_int on RESOURCE_TYPE
    
    Change-Id: I42690c07a611e031963ff41942f530af4a5c672a
    Reviewed-on: https://gerrit.libreoffice.org/34220
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/tools/rcid.h b/include/tools/rcid.h
index 8a58f66..6c6cbf4f 100644
--- a/include/tools/rcid.h
+++ b/include/tools/rcid.h
@@ -30,15 +30,15 @@
 // Resource types
 // Minimum is 0x100 due to MS-Windows resource types
 // (RSC_NOTYPE=0x100) is defined in resid.hxx
-#define RSC_VERSIONCONTROL      (RSC_NOTYPE + 0x02) // Version control
+#define RSC_VERSIONCONTROL      (RSC_NOTYPE + RESOURCE_TYPE(0x02)) // Version control
 
-#define RSC_RESOURCE            (RSC_NOTYPE + 0x10)
-#define RSC_STRING              (RSC_NOTYPE + 0x11)
-#define RSC_BITMAP              (RSC_NOTYPE + 0x13)
-#define RSC_MENU                (RSC_NOTYPE + 0x1c)
-#define RSC_MENUITEM            (RSC_NOTYPE + 0x1d) // only used internally
+#define RSC_RESOURCE            (RSC_NOTYPE + RESOURCE_TYPE(0x10))
+#define RSC_STRING              (RSC_NOTYPE + RESOURCE_TYPE(0x11))
+#define RSC_BITMAP              (RSC_NOTYPE + RESOURCE_TYPE(0x13))
+#define RSC_MENU                (RSC_NOTYPE + RESOURCE_TYPE(0x1c))
+#define RSC_MENUITEM            (RSC_NOTYPE + RESOURCE_TYPE(0x1d)) // only used internally
 
-#define RSC_STRINGARRAY         (RSC_NOTYPE + 0x79)
+#define RSC_STRINGARRAY         (RSC_NOTYPE + RESOURCE_TYPE(0x79))
 
 // (RSC_NOTYPE + 0x200) - (RSC_NOTYPE + 0x300) reserved for Sfx
 
diff --git a/include/tools/resid.hxx b/include/tools/resid.hxx
index 480f5b7..53a229b 100644
--- a/include/tools/resid.hxx
+++ b/include/tools/resid.hxx
@@ -24,10 +24,12 @@
 #include <rtl/ustring.hxx>
 #include <tools/solar.h>
 #include <tools/toolsdllapi.h>
+#include <o3tl/strong_int.hxx>
 
 struct RSHEADER_TYPE;
-typedef sal_uInt32 RESOURCE_TYPE;
-#define RSC_NOTYPE              0x100
+struct RESOURCE_TYPE_Tag {};
+typedef o3tl::strong_int<sal_uInt32, RESOURCE_TYPE_Tag> RESOURCE_TYPE;
+#define RSC_NOTYPE              RESOURCE_TYPE(0x100)
 #define RSC_DONTRELEASE         (sal_uInt32(1U << 31))
 
 class ResMgr;
@@ -45,11 +47,11 @@ class SAL_WARN_UNUSED ResId
         release the Resource context after loading this id.
     */
     RSHEADER_TYPE*          m_pResource;
-    mutable sal_uInt32      m_nResId;      // Resource Identifier
+    mutable RESOURCE_TYPE   m_nResId;      // Resource Identifier
     mutable RESOURCE_TYPE   m_nRT;         // type for loading (mutable to be set later)
     mutable ResMgr *        m_pResMgr;     // load from this ResMgr (mutable for setting on demand)
 
-    void ImplInit( sal_uInt32 nId, ResMgr& rMgr, RSHEADER_TYPE* pRes )
+    void ImplInit( RESOURCE_TYPE nId, ResMgr& rMgr, RSHEADER_TYPE* pRes )
     {
         m_pResource = pRes; m_nResId = nId; m_nRT = RSC_NOTYPE; m_pResMgr = &rMgr;
         OSL_ENSURE( m_pResMgr != nullptr, "ResId without ResMgr created" );
@@ -60,7 +62,7 @@ public:
     {
         ImplInit( 0, rMgr, pRc );
     }
-    ResId( sal_uInt32 nId, ResMgr& rMgr )
+    ResId( RESOURCE_TYPE nId, ResMgr& rMgr )
     {
         ImplInit( nId, rMgr, nullptr );
     }
@@ -87,9 +89,9 @@ public:
     ResMgr *        GetResMgr() const { return m_pResMgr; }
     void            ClearResMgr() const { m_pResMgr = nullptr; }
 
-    bool            IsAutoRelease()  const { return !(m_nResId & RSC_DONTRELEASE); }
+    bool            IsAutoRelease()  const { return !(sal_uInt32(m_nResId) & RSC_DONTRELEASE); }
 
-    sal_uInt32      GetId()          const { return m_nResId & ~RSC_DONTRELEASE; }
+    sal_uInt32      GetId()          const { return sal_uInt32(m_nResId) & ~RSC_DONTRELEASE; }
     RSHEADER_TYPE*  GetpResource()   const { return m_pResource; }
 
     TOOLS_DLLPUBLIC OUString toString() const;
diff --git a/include/tools/resmgr.hxx b/include/tools/resmgr.hxx
index eec8d1a..9712629 100644
--- a/include/tools/resmgr.hxx
+++ b/include/tools/resmgr.hxx
@@ -202,7 +202,7 @@ inline sal_uInt32 RSHEADER_TYPE::GetId()
 
 inline RESOURCE_TYPE RSHEADER_TYPE::GetRT()
 {
-    return (RESOURCE_TYPE)ResMgr::GetLong( &nRT );
+    return RESOURCE_TYPE(ResMgr::GetLong( &nRT ));
 }
 
 inline sal_uInt32 RSHEADER_TYPE::GetGlobOff()
diff --git a/rsc/inc/rscarray.hxx b/rsc/inc/rscarray.hxx
index 62fb1da..b3bf672 100644
--- a/rsc/inc/rscarray.hxx
+++ b/rsc/inc/rscarray.hxx
@@ -59,7 +59,7 @@ protected:
     void            WriteSrcArray( const RSCINST & rInst, FILE * fOutput,
                                    RscTypCont * pTC, sal_uInt32 nTab, const char * );
 public:
-                    RscArray( Atom nId, sal_uInt32 nTypId,
+                    RscArray( Atom nId, RESOURCE_TYPE nTypId,
                               RscTop * pSuper, RscEnum * pTypeClass );
                     virtual ~RscArray() override;
     virtual RSCCLASS_TYPE   GetClassType() const override;
@@ -94,7 +94,7 @@ public:
 class RscLangArray : public RscArray
 {
 public:
-                    RscLangArray( Atom nId, sal_uInt32 nTypId,
+                    RscLangArray( Atom nId, RESOURCE_TYPE nTypId,
                                   RscTop * pSuper, RscEnum * pTypeClass );
     virtual RSCCLASS_TYPE   GetClassType() const override;
 };
diff --git a/rsc/inc/rscclass.hxx b/rsc/inc/rscclass.hxx
index 31bf1fd..193e372 100644
--- a/rsc/inc/rscclass.hxx
+++ b/rsc/inc/rscclass.hxx
@@ -54,7 +54,7 @@ protected:
     void                SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle,
                                     bool bSet );
 public:
-                    RscClass( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl );
+                    RscClass( Atom nId, RESOURCE_TYPE nTypId, RscTop * pSuperCl );
                     virtual ~RscClass() override;
 
     virtual RSCCLASS_TYPE   GetClassType() const override;
@@ -95,7 +95,7 @@ public:
 class RscSysDepend : public RscClass
 {
 public:
-                    RscSysDepend( Atom nId, sal_uInt32 nTypId, RscTop * pSuper );
+                    RscSysDepend( Atom nId, RESOURCE_TYPE nTypId, RscTop * pSuper );
     ERRTYPE         WriteSysDependRc( const RSCINST &, RscWriteRc & aMem,
                                       RscTypCont * pTC, sal_uInt32, bool bExtra );
     ERRTYPE         WriteRc( const RSCINST &, RscWriteRc & aMem,
@@ -105,7 +105,7 @@ public:
 class RscTupel : public RscClass
 {
 public:
-    RscTupel( Atom nId, sal_uInt32 nTypId );
+    RscTupel( Atom nId, RESOURCE_TYPE nTypId );
     RSCINST         GetTupelVar( const RSCINST & rInst, sal_uInt32 nPos,
                                  const RSCINST & rInitInst ) override;
     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
diff --git a/rsc/inc/rscconst.hxx b/rsc/inc/rscconst.hxx
index 44b92b9..8519f9a 100644
--- a/rsc/inc/rscconst.hxx
+++ b/rsc/inc/rscconst.hxx
@@ -23,6 +23,7 @@
 #include <rscerror.h>
 #include <rschash.hxx>
 #include <rsctop.hxx>
+#include <tools/resid.hxx>
 
 class RscConst : public RscTop
 {
@@ -35,7 +36,7 @@ protected:
     VarEle *        pVarArray;  // pointer to the field with constant
     sal_uInt32      nEntries;   // number of entries in field
 public:
-                    RscConst( Atom nId, sal_uInt32 nTypId );
+                    RscConst( Atom nId, RESOURCE_TYPE nTypId );
                     virtual ~RscConst() override;
     virtual RSCCLASS_TYPE   GetClassType() const override;
                     // sets the allowed values
@@ -53,7 +54,7 @@ class RscEnum : public RscConst
         bool        bDflt;  // is default
     };
 public:
-                    RscEnum( Atom nId, sal_uInt32 nTypId );
+                    RscEnum( Atom nId, RESOURCE_TYPE nTypId );
     RSCINST         Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override;
     sal_uInt32      Size() const override { return ALIGNED_SIZE(sizeof(RscEnumInst)); }
 
diff --git a/rsc/inc/rsccont.hxx b/rsc/inc/rsccont.hxx
index 69a66f7..e480ea6d 100644
--- a/rsc/inc/rsccont.hxx
+++ b/rsc/inc/rsccont.hxx
@@ -54,7 +54,7 @@ protected:
     ERRTYPE         ContWriteRc( const RSCINST & rInst, RscWriteRc & aMem,
                                  RscTypCont * pTC, sal_uInt32, bool bExtra );
 public:
-                    RscBaseCont( Atom nId, sal_uInt32 nTypId,
+                    RscBaseCont( Atom nId, RESOURCE_TYPE nTypId,
                                  bool bNoId );
                     virtual ~RscBaseCont() override;
     virtual RSCCLASS_TYPE   GetClassType() const override;
@@ -105,7 +105,7 @@ public:
 class RscContWriteSrc : public RscBaseCont
 {
 public:
-                    RscContWriteSrc( Atom nId, sal_uInt32 nTypId );
+                    RscContWriteSrc( Atom nId, RESOURCE_TYPE nTypId );
     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
                               RscTypCont * pTC, sal_uInt32 nTab, const char * ) override;
 };
@@ -113,7 +113,7 @@ public:
 class RscCont : public RscContWriteSrc
 {
 public:
-                    RscCont( Atom nId, sal_uInt32 nTypId );
+                    RscCont( Atom nId, RESOURCE_TYPE nTypId );
     ERRTYPE         WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
                              RscTypCont * pTC, sal_uInt32, bool bExtra ) override;
 };
@@ -121,7 +121,7 @@ public:
 class RscContExtraData : public RscContWriteSrc
 {
 public:
-                    RscContExtraData( Atom nId, sal_uInt32 nTypId );
+                    RscContExtraData( Atom nId, RESOURCE_TYPE nTypId );
     ERRTYPE         WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
                              RscTypCont * pTC, sal_uInt32, bool bExtra ) override;
 };
diff --git a/rsc/inc/rscflag.hxx b/rsc/inc/rscflag.hxx
index 77b21f3f..dd3b986 100644
--- a/rsc/inc/rscflag.hxx
+++ b/rsc/inc/rscflag.hxx
@@ -34,7 +34,7 @@ class RscFlag : public RscConst
     };
     RSCINST         CreateBasic( RSCINST * pInst );
 public:
-                    RscFlag( Atom nId, sal_uInt32 nTypId );
+                    RscFlag( Atom nId, RESOURCE_TYPE nTypId );
     RSCINST         Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass = false ) override;
     RSCINST         CreateClient( RSCINST * pInst, const RSCINST & rDflt,
                                   bool bOwnClass, Atom nConsId );
@@ -67,7 +67,7 @@ class RscClient : public RscTop
     RscFlag *       pRefClass;  // class which is used as server
     Atom            nConstId;   // id of the value to set
 public:
-                    RscClient( Atom nId, sal_uInt32 nTypId, RscFlag * pClass,
+                    RscClient( Atom nId, RESOURCE_TYPE nTypId, RscFlag * pClass,
                                Atom nConstantId );
     virtual RSCCLASS_TYPE   GetClassType() const override;
     RSCINST         Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass = false ) override;
diff --git a/rsc/inc/rscmgr.hxx b/rsc/inc/rscmgr.hxx
index 3fd9afa..347512a 100644
--- a/rsc/inc/rscmgr.hxx
+++ b/rsc/inc/rscmgr.hxx
@@ -37,7 +37,7 @@ class RscMgr : public RscClass
     };
     ERRTYPE         IsToDeep( const RSCINST & rInst );
 public:
-                    RscMgr( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl );
+                    RscMgr( Atom nId, RESOURCE_TYPE nTypId, RscTop * pSuperCl );
 
     void            SetToDefault( const RSCINST & rInst ) override;
     bool            IsDefault( const RSCINST & rInst ) override;
diff --git a/rsc/inc/rscrange.hxx b/rsc/inc/rscrange.hxx
index f1fc92a..00573f9 100644
--- a/rsc/inc/rscrange.hxx
+++ b/rsc/inc/rscrange.hxx
@@ -35,7 +35,7 @@ protected:
     sal_Int32       nMin;   // range minimum value
     sal_Int32       nMax;   // range maximum value
 public:
-                    RscRange( Atom nId, sal_uInt32 nTypId );
+                    RscRange( Atom nId, RESOURCE_TYPE nTypId );
     virtual RSCCLASS_TYPE   GetClassType() const override;
     RSCINST         Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override;
                     // sets the allowed range
@@ -72,7 +72,7 @@ protected:
     sal_Int32    nMin;   // range minimum value
     sal_Int32    nMax;   // range maximum value
 public:
-                    RscLongRange( Atom nId, sal_uInt32 nTypId );
+                    RscLongRange( Atom nId, RESOURCE_TYPE nTypId );
     virtual RSCCLASS_TYPE   GetClassType() const override;
     RSCINST         Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override;
                     // sets the allowed range
@@ -102,7 +102,7 @@ public:
 class RscLongEnumRange : public RscLongRange
 {
 public:
-                    RscLongEnumRange( Atom nId, sal_uInt32 nTypId );
+                    RscLongEnumRange( Atom nId, RESOURCE_TYPE nTypId );
 
     ERRTYPE         SetConst( const RSCINST & rInst, Atom nValueId,
                               sal_Int32 nValue ) override;
@@ -114,7 +114,7 @@ protected:
     sal_Int32    nMin;   // range minimum value
     sal_Int32    nMax;   // range maximum value
 public:
-                    RscIdRange( Atom nId, sal_uInt32 nTypId );
+                    RscIdRange( Atom nId, RESOURCE_TYPE nTypId );
     virtual RSCCLASS_TYPE   GetClassType() const override;
                     // sets the allowed range
     void            SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum )
@@ -150,7 +150,7 @@ public:
 class RscBool : public RscRange
 {
 public:
-                    RscBool( Atom nId, sal_uInt32 nTypId );
+                    RscBool( Atom nId, RESOURCE_TYPE nTypId );
     virtual RSCCLASS_TYPE   GetClassType() const override;
     ERRTYPE         SetBool( const RSCINST & rInst, bool b ) override
                         {
diff --git a/rsc/inc/rscstr.hxx b/rsc/inc/rscstr.hxx
index ae20f04..77010ac 100644
--- a/rsc/inc/rscstr.hxx
+++ b/rsc/inc/rscstr.hxx
@@ -34,7 +34,7 @@ class RscString : public RscTop
         RscId   aRefId; // reference name
     };
 public:
-                    RscString( Atom nId, sal_uInt32 nTypId );
+                    RscString( Atom nId, RESOURCE_TYPE nTypId );
     virtual RSCCLASS_TYPE   GetClassType() const override;
 
     void            SetRefClass( RscTop * pClass ) { pRefClass = pClass; }
diff --git a/rsc/inc/rsctop.hxx b/rsc/inc/rsctop.hxx
index 24d4082..8d3f52f 100644
--- a/rsc/inc/rsctop.hxx
+++ b/rsc/inc/rsctop.hxx
@@ -25,6 +25,7 @@
 #include <rscclobj.hxx>
 #include <rsc/rscsfx.hxx>
 #include <o3tl/typed_flags_set.hxx>
+#include <tools/resid.hxx>
 
 enum class RSCVAR {
     NONE        = 0x0000,
@@ -47,7 +48,7 @@ class RscTop : public RefNode
     RscTop *        pRefClass;
 
 protected:
-                    RscTop( Atom nId, sal_uInt32 nTypIdent,
+                    RscTop( Atom nId, RESOURCE_TYPE nTypIdent,
                             RscTop * pSuperCl = nullptr );
 
 public:
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 1675cc4..9aa1193 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -44,7 +44,7 @@ RscTypCont::RscTypCont( RscError * pErrHdl,
     , aSearchPath( rSearchPath )
     , nUniqueId(256)
     , nFilePos( 0 )
-    , nPMId(RSC_VERSIONCONTROL +1) // at least one more
+    , nPMId(RSC_VERSIONCONTROL + RESOURCE_TYPE(1)) // at least one more
     , aBool( pHS->getID( "sal_Bool" ), RSC_NOTYPE )
     , aShort( pHS->getID( "short" ), RSC_NOTYPE )
     , aUShort( pHS->getID( "sal_uInt16" ), RSC_NOTYPE )
@@ -300,17 +300,17 @@ void RscEnumerateObj::WriteRcFile( RscWriteRc & rMem, FILE * fOut )
     /*
     struct RSHEADER_TYPE{
         sal_uInt32          nId;        // resource identifier
-        sal_uInt32          nRT;        // resource type
+        RESOURCE_TYPE       nRT;        // resource type
         sal_uInt32          nGlobOff;   // global offset
         sal_uInt32          nLocalOff;  // local offset
     } aHeader;
     */
 
     sal_uInt32 nId = rMem.GetLong( 0 );
-    sal_uInt32 nRT = rMem.GetLong( 4 );
+    RESOURCE_TYPE nRT(rMem.GetLong( 4 ));
 
     // table is filled with nId and nRT
-    pTypCont->PutTranslatorKey( (sal_uInt64(nRT) << 32) + sal_uInt64(nId) );
+    pTypCont->PutTranslatorKey( (sal_uInt64(sal_uInt32(nRT)) << 32) + sal_uInt64(nId) );
 
     if( nRT == RSC_VERSIONCONTROL )
     { // always comes last
diff --git a/rsc/source/res/rscarray.cxx b/rsc/source/res/rscarray.cxx
index 3348807..817a8c1 100644
--- a/rsc/source/res/rscarray.cxx
+++ b/rsc/source/res/rscarray.cxx
@@ -44,7 +44,7 @@ sal_uInt32 RscInstNode::GetId() const
     return nTypeId;
 }
 
-RscArray::RscArray( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper, RscEnum * pTypeCl )
+RscArray::RscArray( Atom nId, RESOURCE_TYPE nTypeId, RscTop * pSuper, RscEnum * pTypeCl )
     : RscTop( nId, nTypeId, pSuper )
     , pTypeClass(pTypeCl)
     , nOffInstData(RscTop::Size())
@@ -422,7 +422,7 @@ ERRTYPE RscArray::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
     return aError;
 }
 
-RscLangArray::RscLangArray( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper,
+RscLangArray::RscLangArray( Atom nId, RESOURCE_TYPE nTypeId, RscTop * pSuper,
                           RscEnum * pTypeCl )
     : RscArray( nId, nTypeId, pSuper, pTypeCl )
 {
diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx
index fc1d08e..12fb795 100644
--- a/rsc/source/res/rscclass.cxx
+++ b/rsc/source/res/rscclass.cxx
@@ -28,7 +28,7 @@
 #include <tools/rcid.h>
 #include <tools/rc.h>
 
-RscClass::RscClass( Atom nId, sal_uInt32 nTypeId, RscTop * pSuperCl )
+RscClass::RscClass( Atom nId, RESOURCE_TYPE nTypeId, RscTop * pSuperCl )
     : RscTop( nId, nTypeId, pSuperCl )
     , nSuperSize(RscTop::Size())
     , nSize(nSuperSize + ALIGNED_SIZE(sizeof(RscClassInst )))
@@ -642,7 +642,7 @@ ERRTYPE RscClass::WriteRc( const RSCINST & rInst,
     return aError;
 }
 
-RscSysDepend::RscSysDepend( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper )
+RscSysDepend::RscSysDepend( Atom nId, RESOURCE_TYPE nTypeId, RscTop * pSuper )
             : RscClass( nId, nTypeId, pSuper )
 {
 }
@@ -693,7 +693,7 @@ ERRTYPE RscSysDepend::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
     return aError;
 }
 
-RscTupel::RscTupel( Atom nId, sal_uInt32 nTypeId )
+RscTupel::RscTupel( Atom nId, RESOURCE_TYPE nTypeId )
     : RscClass( nId, nTypeId, nullptr )
 {
 }
diff --git a/rsc/source/res/rscconst.cxx b/rsc/source/res/rscconst.cxx
index f45045b..32aa189 100644
--- a/rsc/source/res/rscconst.cxx
+++ b/rsc/source/res/rscconst.cxx
@@ -26,7 +26,7 @@
 #include <rschash.hxx>
 #include <tools/resid.hxx>
 
-RscConst::RscConst( Atom nId, sal_uInt32 nTypeId )
+RscConst::RscConst( Atom nId, RESOURCE_TYPE nTypeId )
     : RscTop( nId, nTypeId )
     , pVarArray(nullptr), nEntries(0)
 {
@@ -98,7 +98,7 @@ sal_uInt32 RscConst::GetConstPos( Atom nConst )
     return nEntries;
 }
 
-RscEnum::RscEnum( Atom nId, sal_uInt32 nTypeId )
+RscEnum::RscEnum( Atom nId, RESOURCE_TYPE nTypeId )
     : RscConst( nId, nTypeId )
 {
 }
diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx
index 2ffa8d3..6c389e7 100644
--- a/rsc/source/res/rsccont.cxx
+++ b/rsc/source/res/rsccont.cxx
@@ -35,7 +35,7 @@ void ENTRY_STRUCT::Destroy()
     }
 }
 
-RscBaseCont::RscBaseCont( Atom nId, sal_uInt32 nTypeId,
+RscBaseCont::RscBaseCont( Atom nId, RESOURCE_TYPE nTypeId,
                           bool bNoIdent )
     : RscTop(nId, nTypeId, nullptr)
     , pTypeClass(nullptr), pTypeClass1(nullptr)
@@ -719,7 +719,7 @@ ERRTYPE RscBaseCont::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
     return aError;
 }
 
-RscContWriteSrc::RscContWriteSrc( Atom nId, sal_uInt32 nTypeId )
+RscContWriteSrc::RscContWriteSrc( Atom nId, RESOURCE_TYPE nTypeId )
     : RscBaseCont( nId, nTypeId, true )
 {
 }
@@ -746,7 +746,7 @@ void RscContWriteSrc::WriteSrc( const RSCINST & rInst, FILE * fOutput,
     fprintf( fOutput, "}" );
 }
 
-RscCont::RscCont( Atom nId, sal_uInt32 nTypeId )
+RscCont::RscCont( Atom nId, RESOURCE_TYPE nTypeId )
     : RscContWriteSrc( nId, nTypeId )
 {
 }
@@ -769,7 +769,7 @@ ERRTYPE RscCont::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
     return aError;
 }
 
-RscContExtraData::RscContExtraData( Atom nId, sal_uInt32 nTypeId )
+RscContExtraData::RscContExtraData( Atom nId, RESOURCE_TYPE nTypeId )
     : RscContWriteSrc( nId, nTypeId )
 {
 }
diff --git a/rsc/source/res/rscflag.cxx b/rsc/source/res/rscflag.cxx
index 4ac6473..d1d8afd 100644
--- a/rsc/source/res/rscflag.cxx
+++ b/rsc/source/res/rscflag.cxx
@@ -24,7 +24,7 @@
 
 #include <rscflag.hxx>
 
-RscFlag::RscFlag( Atom nId, sal_uInt32 nTypeId )
+RscFlag::RscFlag( Atom nId, RESOURCE_TYPE nTypeId )
     : RscConst( nId, nTypeId )
 {
 }
@@ -292,7 +292,7 @@ ERRTYPE RscFlag::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
     return ERR_OK;
 }
 
-RscClient::RscClient( Atom nId, sal_uInt32 nTypeId, RscFlag * pClass,
+RscClient::RscClient( Atom nId, RESOURCE_TYPE nTypeId, RscFlag * pClass,
                       Atom nConstantId )
     : RscTop(nId, nTypeId), pRefClass(pClass), nConstId(nConstantId)
 {
diff --git a/rsc/source/res/rscmgr.cxx b/rsc/source/res/rscmgr.cxx
index 33f8058..c123a93 100644
--- a/rsc/source/res/rscmgr.cxx
+++ b/rsc/source/res/rscmgr.cxx
@@ -26,7 +26,7 @@
 #include <rscmgr.hxx>
 #include <rscdb.hxx>
 
-RscMgr::RscMgr( Atom nId, sal_uInt32 nTypeId, RscTop * pSuperCl )
+RscMgr::RscMgr( Atom nId, RESOURCE_TYPE nTypeId, RscTop * pSuperCl )
     : RscClass( nId, nTypeId, pSuperCl )
 {
 }
diff --git a/rsc/source/res/rscrange.cxx b/rsc/source/res/rscrange.cxx
index 6273eab..403e7bc 100644
--- a/rsc/source/res/rscrange.cxx
+++ b/rsc/source/res/rscrange.cxx
@@ -24,7 +24,7 @@
 
 #include <rscrange.hxx>
 
-RscRange::RscRange( Atom nId, sal_uInt32 nTypeId )
+RscRange::RscRange( Atom nId, RESOURCE_TYPE nTypeId )
     : RscTop( nId, nTypeId )
     , nMin(0), nMax(0)
 {
@@ -135,7 +135,7 @@ ERRTYPE RscRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
     return ERR_OK;
 }
 
-RscLongRange::RscLongRange( Atom nId, sal_uInt32 nTypeId )
+RscLongRange::RscLongRange( Atom nId, RESOURCE_TYPE nTypeId )
     : RscTop( nId, nTypeId )
     , nMin(0), nMax(0)
 {
@@ -241,7 +241,7 @@ ERRTYPE RscLongRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
     return ERR_OK;
 }
 
-RscLongEnumRange::RscLongEnumRange( Atom nId, sal_uInt32 nTypeId )
+RscLongEnumRange::RscLongEnumRange( Atom nId, RESOURCE_TYPE nTypeId )
     : RscLongRange( nId, nTypeId )
 {
 }
@@ -252,7 +252,7 @@ ERRTYPE RscLongEnumRange::SetConst( const RSCINST & rInst, Atom /*nConst*/,
     return SetNumber( rInst, nValue );
 }
 
-RscIdRange::RscIdRange( Atom nId, sal_uInt32 nTypeId )
+RscIdRange::RscIdRange( Atom nId, RESOURCE_TYPE nTypeId )
     : RscTop( nId, nTypeId )
     , nMin(0), nMax(0)
 {
@@ -389,7 +389,7 @@ bool RscIdRange::IsConsistent( const RSCINST & rInst )
 
 }
 
-RscBool::RscBool( Atom nId, sal_uInt32 nTypeId )
+RscBool::RscBool( Atom nId, RESOURCE_TYPE nTypeId )
     : RscRange( nId, nTypeId )
 {
     RscRange::SetRange( 0, 1 );
diff --git a/rsc/source/res/rscstr.cxx b/rsc/source/res/rscstr.cxx
index f03bf4e..dc54561 100644
--- a/rsc/source/res/rscstr.cxx
+++ b/rsc/source/res/rscstr.cxx
@@ -28,7 +28,7 @@
 #include <rtl/textcvt.h>
 #include <rtl/textenc.h>
 
-RscString::RscString( Atom nId, sal_uInt32 nTypeId )
+RscString::RscString( Atom nId, RESOURCE_TYPE nTypeId )
     : RscTop( nId, nTypeId )
     , pRefClass(nullptr)
 {
diff --git a/rsc/source/res/rsctop.cxx b/rsc/source/res/rsctop.cxx
index 6117bf9..3d48b8e 100644
--- a/rsc/source/res/rsctop.cxx
+++ b/rsc/source/res/rsctop.cxx
@@ -22,7 +22,7 @@
 #include <string.h>
 #include <rsctop.hxx>
 
-RscTop::RscTop( Atom nId, sal_uInt32 nTypIdent, RscTop * pSuperCl )
+RscTop::RscTop( Atom nId, RESOURCE_TYPE nTypIdent, RscTop * pSuperCl )
     : RefNode( nId )
     , pSuperClass( pSuperCl )
     , nTypId( nTypIdent )
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index d810bd2..7c4827c 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -544,7 +544,7 @@ bool InternalResMgr::IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) cons
 {
     // Anfang der Strings suchen
     ImpContent aValue;
-    aValue.nTypeAndId = ((sal_uInt64(nRT) << 32) | nId);
+    aValue.nTypeAndId = ((sal_uInt64(sal_uInt32(nRT)) << 32) | nId);
     ImpContent * pFind = ::std::lower_bound(pContent,
                                             pContent + nEntries,
                                             aValue,
@@ -558,11 +558,11 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
 {
 #ifdef DBG_UTIL
     if( pResUseDump )
-        pResUseDump->erase( (sal_uInt64(nRT) << 32) | nId );
+        pResUseDump->erase( (sal_uInt64(sal_uInt32(nRT)) << 32) | nId );
 #endif
     // search beginning of string
     ImpContent aValue;
-    aValue.nTypeAndId = ((sal_uInt64(nRT) << 32) | nId);
+    aValue.nTypeAndId = ((sal_uInt64(sal_uInt32(nRT)) << 32) | nId);
     ImpContent* pEnd = (pContent + nEntries);
     ImpContent* pFind = ::std::lower_bound( pContent,
                                             pEnd,
@@ -578,9 +578,9 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
                 // search beginning of string
                 ImpContent * pFirst = pFind;
                 ImpContent * pLast = pFirst;
-                while( pFirst > pContent && ((pFirst -1)->nTypeAndId >> 32) == RSC_STRING )
+                while( pFirst > pContent && RESOURCE_TYPE((pFirst -1)->nTypeAndId >> 32) == RSC_STRING )
                     --pFirst;
-                while( pLast < pEnd && (pLast->nTypeAndId >> 32) == RSC_STRING )
+                while( pLast < pEnd && RESOURCE_TYPE(pLast->nTypeAndId >> 32) == RSC_STRING )
                     ++pLast;
                 nOffCorrection = pFirst->nOffset;
                 sal_uInt32 nSize;


More information about the Libreoffice-commits mailing list