Use o3tl::strong_int on RESOURCE_TYPE

Change-Id: I42690c07a611e031963ff41942f530af4a5c672a
Reviewed-on: https://gerrit.libreoffice.org/34220
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2017-02-13 19:09:17 +02:00
parent ed8773a201
commit 2b70fb58be
23 changed files with 70 additions and 66 deletions

View File

@ -30,15 +30,15 @@
// Resource types // Resource types
// Minimum is 0x100 due to MS-Windows resource types // Minimum is 0x100 due to MS-Windows resource types
// (RSC_NOTYPE=0x100) is defined in resid.hxx // (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_RESOURCE (RSC_NOTYPE + RESOURCE_TYPE(0x10))
#define RSC_STRING (RSC_NOTYPE + 0x11) #define RSC_STRING (RSC_NOTYPE + RESOURCE_TYPE(0x11))
#define RSC_BITMAP (RSC_NOTYPE + 0x13) #define RSC_BITMAP (RSC_NOTYPE + RESOURCE_TYPE(0x13))
#define RSC_MENU (RSC_NOTYPE + 0x1c) #define RSC_MENU (RSC_NOTYPE + RESOURCE_TYPE(0x1c))
#define RSC_MENUITEM (RSC_NOTYPE + 0x1d) // only used internally #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 // (RSC_NOTYPE + 0x200) - (RSC_NOTYPE + 0x300) reserved for Sfx

View File

@ -24,10 +24,12 @@
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <tools/solar.h> #include <tools/solar.h>
#include <tools/toolsdllapi.h> #include <tools/toolsdllapi.h>
#include <o3tl/strong_int.hxx>
struct RSHEADER_TYPE; struct RSHEADER_TYPE;
typedef sal_uInt32 RESOURCE_TYPE; struct RESOURCE_TYPE_Tag {};
#define RSC_NOTYPE 0x100 typedef o3tl::strong_int<sal_uInt32, RESOURCE_TYPE_Tag> RESOURCE_TYPE;
#define RSC_NOTYPE RESOURCE_TYPE(0x100)
#define RSC_DONTRELEASE (sal_uInt32(1U << 31)) #define RSC_DONTRELEASE (sal_uInt32(1U << 31))
class ResMgr; class ResMgr;
@ -45,11 +47,11 @@ class SAL_WARN_UNUSED ResId
release the Resource context after loading this id. release the Resource context after loading this id.
*/ */
RSHEADER_TYPE* m_pResource; 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 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) 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; m_pResource = pRes; m_nResId = nId; m_nRT = RSC_NOTYPE; m_pResMgr = &rMgr;
OSL_ENSURE( m_pResMgr != nullptr, "ResId without ResMgr created" ); OSL_ENSURE( m_pResMgr != nullptr, "ResId without ResMgr created" );
@ -60,7 +62,7 @@ public:
{ {
ImplInit( 0, rMgr, pRc ); ImplInit( 0, rMgr, pRc );
} }
ResId( sal_uInt32 nId, ResMgr& rMgr ) ResId( RESOURCE_TYPE nId, ResMgr& rMgr )
{ {
ImplInit( nId, rMgr, nullptr ); ImplInit( nId, rMgr, nullptr );
} }
@ -87,9 +89,9 @@ public:
ResMgr * GetResMgr() const { return m_pResMgr; } ResMgr * GetResMgr() const { return m_pResMgr; }
void ClearResMgr() const { m_pResMgr = nullptr; } 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; } RSHEADER_TYPE* GetpResource() const { return m_pResource; }
TOOLS_DLLPUBLIC OUString toString() const; TOOLS_DLLPUBLIC OUString toString() const;

View File

@ -202,7 +202,7 @@ inline sal_uInt32 RSHEADER_TYPE::GetId()
inline RESOURCE_TYPE RSHEADER_TYPE::GetRT() inline RESOURCE_TYPE RSHEADER_TYPE::GetRT()
{ {
return (RESOURCE_TYPE)ResMgr::GetLong( &nRT ); return RESOURCE_TYPE(ResMgr::GetLong( &nRT ));
} }
inline sal_uInt32 RSHEADER_TYPE::GetGlobOff() inline sal_uInt32 RSHEADER_TYPE::GetGlobOff()

View File

@ -59,7 +59,7 @@ protected:
void WriteSrcArray( const RSCINST & rInst, FILE * fOutput, void WriteSrcArray( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * ); RscTypCont * pTC, sal_uInt32 nTab, const char * );
public: public:
RscArray( Atom nId, sal_uInt32 nTypId, RscArray( Atom nId, RESOURCE_TYPE nTypId,
RscTop * pSuper, RscEnum * pTypeClass ); RscTop * pSuper, RscEnum * pTypeClass );
virtual ~RscArray() override; virtual ~RscArray() override;
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
@ -94,7 +94,7 @@ public:
class RscLangArray : public RscArray class RscLangArray : public RscArray
{ {
public: public:
RscLangArray( Atom nId, sal_uInt32 nTypId, RscLangArray( Atom nId, RESOURCE_TYPE nTypId,
RscTop * pSuper, RscEnum * pTypeClass ); RscTop * pSuper, RscEnum * pTypeClass );
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
}; };

View File

@ -54,7 +54,7 @@ protected:
void SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle, void SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle,
bool bSet ); bool bSet );
public: public:
RscClass( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl ); RscClass( Atom nId, RESOURCE_TYPE nTypId, RscTop * pSuperCl );
virtual ~RscClass() override; virtual ~RscClass() override;
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
@ -95,7 +95,7 @@ public:
class RscSysDepend : public RscClass class RscSysDepend : public RscClass
{ {
public: public:
RscSysDepend( Atom nId, sal_uInt32 nTypId, RscTop * pSuper ); RscSysDepend( Atom nId, RESOURCE_TYPE nTypId, RscTop * pSuper );
ERRTYPE WriteSysDependRc( const RSCINST &, RscWriteRc & aMem, ERRTYPE WriteSysDependRc( const RSCINST &, RscWriteRc & aMem,
RscTypCont * pTC, sal_uInt32, bool bExtra ); RscTypCont * pTC, sal_uInt32, bool bExtra );
ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
@ -105,7 +105,7 @@ public:
class RscTupel : public RscClass class RscTupel : public RscClass
{ {
public: public:
RscTupel( Atom nId, sal_uInt32 nTypId ); RscTupel( Atom nId, RESOURCE_TYPE nTypId );
RSCINST GetTupelVar( const RSCINST & rInst, sal_uInt32 nPos, RSCINST GetTupelVar( const RSCINST & rInst, sal_uInt32 nPos,
const RSCINST & rInitInst ) override; const RSCINST & rInitInst ) override;
void WriteSrc( const RSCINST & rInst, FILE * fOutput, void WriteSrc( const RSCINST & rInst, FILE * fOutput,

View File

@ -23,6 +23,7 @@
#include <rscerror.h> #include <rscerror.h>
#include <rschash.hxx> #include <rschash.hxx>
#include <rsctop.hxx> #include <rsctop.hxx>
#include <tools/resid.hxx>
class RscConst : public RscTop class RscConst : public RscTop
{ {
@ -35,7 +36,7 @@ protected:
VarEle * pVarArray; // pointer to the field with constant VarEle * pVarArray; // pointer to the field with constant
sal_uInt32 nEntries; // number of entries in field sal_uInt32 nEntries; // number of entries in field
public: public:
RscConst( Atom nId, sal_uInt32 nTypId ); RscConst( Atom nId, RESOURCE_TYPE nTypId );
virtual ~RscConst() override; virtual ~RscConst() override;
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
// sets the allowed values // sets the allowed values
@ -53,7 +54,7 @@ class RscEnum : public RscConst
bool bDflt; // is default bool bDflt; // is default
}; };
public: public:
RscEnum( Atom nId, sal_uInt32 nTypId ); RscEnum( Atom nId, RESOURCE_TYPE nTypId );
RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override; RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override;
sal_uInt32 Size() const override { return ALIGNED_SIZE(sizeof(RscEnumInst)); } sal_uInt32 Size() const override { return ALIGNED_SIZE(sizeof(RscEnumInst)); }

View File

@ -54,7 +54,7 @@ protected:
ERRTYPE ContWriteRc( const RSCINST & rInst, RscWriteRc & aMem, ERRTYPE ContWriteRc( const RSCINST & rInst, RscWriteRc & aMem,
RscTypCont * pTC, sal_uInt32, bool bExtra ); RscTypCont * pTC, sal_uInt32, bool bExtra );
public: public:
RscBaseCont( Atom nId, sal_uInt32 nTypId, RscBaseCont( Atom nId, RESOURCE_TYPE nTypId,
bool bNoId ); bool bNoId );
virtual ~RscBaseCont() override; virtual ~RscBaseCont() override;
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
@ -105,7 +105,7 @@ public:
class RscContWriteSrc : public RscBaseCont class RscContWriteSrc : public RscBaseCont
{ {
public: public:
RscContWriteSrc( Atom nId, sal_uInt32 nTypId ); RscContWriteSrc( Atom nId, RESOURCE_TYPE nTypId );
void WriteSrc( const RSCINST & rInst, FILE * fOutput, void WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * ) override; RscTypCont * pTC, sal_uInt32 nTab, const char * ) override;
}; };
@ -113,7 +113,7 @@ public:
class RscCont : public RscContWriteSrc class RscCont : public RscContWriteSrc
{ {
public: public:
RscCont( Atom nId, sal_uInt32 nTypId ); RscCont( Atom nId, RESOURCE_TYPE nTypId );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
RscTypCont * pTC, sal_uInt32, bool bExtra ) override; RscTypCont * pTC, sal_uInt32, bool bExtra ) override;
}; };
@ -121,7 +121,7 @@ public:
class RscContExtraData : public RscContWriteSrc class RscContExtraData : public RscContWriteSrc
{ {
public: public:
RscContExtraData( Atom nId, sal_uInt32 nTypId ); RscContExtraData( Atom nId, RESOURCE_TYPE nTypId );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
RscTypCont * pTC, sal_uInt32, bool bExtra ) override; RscTypCont * pTC, sal_uInt32, bool bExtra ) override;
}; };

View File

@ -34,7 +34,7 @@ class RscFlag : public RscConst
}; };
RSCINST CreateBasic( RSCINST * pInst ); RSCINST CreateBasic( RSCINST * pInst );
public: 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 Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass = false ) override;
RSCINST CreateClient( RSCINST * pInst, const RSCINST & rDflt, RSCINST CreateClient( RSCINST * pInst, const RSCINST & rDflt,
bool bOwnClass, Atom nConsId ); bool bOwnClass, Atom nConsId );
@ -67,7 +67,7 @@ class RscClient : public RscTop
RscFlag * pRefClass; // class which is used as server RscFlag * pRefClass; // class which is used as server
Atom nConstId; // id of the value to set Atom nConstId; // id of the value to set
public: public:
RscClient( Atom nId, sal_uInt32 nTypId, RscFlag * pClass, RscClient( Atom nId, RESOURCE_TYPE nTypId, RscFlag * pClass,
Atom nConstantId ); Atom nConstantId );
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass = false ) override; RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass = false ) override;

View File

@ -37,7 +37,7 @@ class RscMgr : public RscClass
}; };
ERRTYPE IsToDeep( const RSCINST & rInst ); ERRTYPE IsToDeep( const RSCINST & rInst );
public: public:
RscMgr( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl ); RscMgr( Atom nId, RESOURCE_TYPE nTypId, RscTop * pSuperCl );
void SetToDefault( const RSCINST & rInst ) override; void SetToDefault( const RSCINST & rInst ) override;
bool IsDefault( const RSCINST & rInst ) override; bool IsDefault( const RSCINST & rInst ) override;

View File

@ -35,7 +35,7 @@ protected:
sal_Int32 nMin; // range minimum value sal_Int32 nMin; // range minimum value
sal_Int32 nMax; // range maximum value sal_Int32 nMax; // range maximum value
public: public:
RscRange( Atom nId, sal_uInt32 nTypId ); RscRange( Atom nId, RESOURCE_TYPE nTypId );
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override; RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override;
// sets the allowed range // sets the allowed range
@ -72,7 +72,7 @@ protected:
sal_Int32 nMin; // range minimum value sal_Int32 nMin; // range minimum value
sal_Int32 nMax; // range maximum value sal_Int32 nMax; // range maximum value
public: public:
RscLongRange( Atom nId, sal_uInt32 nTypId ); RscLongRange( Atom nId, RESOURCE_TYPE nTypId );
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override; RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool bOwnClass = false ) override;
// sets the allowed range // sets the allowed range
@ -102,7 +102,7 @@ public:
class RscLongEnumRange : public RscLongRange class RscLongEnumRange : public RscLongRange
{ {
public: public:
RscLongEnumRange( Atom nId, sal_uInt32 nTypId ); RscLongEnumRange( Atom nId, RESOURCE_TYPE nTypId );
ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId, ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId,
sal_Int32 nValue ) override; sal_Int32 nValue ) override;
@ -114,7 +114,7 @@ protected:
sal_Int32 nMin; // range minimum value sal_Int32 nMin; // range minimum value
sal_Int32 nMax; // range maximum value sal_Int32 nMax; // range maximum value
public: public:
RscIdRange( Atom nId, sal_uInt32 nTypId ); RscIdRange( Atom nId, RESOURCE_TYPE nTypId );
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
// sets the allowed range // sets the allowed range
void SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum ) void SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum )
@ -150,7 +150,7 @@ public:
class RscBool : public RscRange class RscBool : public RscRange
{ {
public: public:
RscBool( Atom nId, sal_uInt32 nTypId ); RscBool( Atom nId, RESOURCE_TYPE nTypId );
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
ERRTYPE SetBool( const RSCINST & rInst, bool b ) override ERRTYPE SetBool( const RSCINST & rInst, bool b ) override
{ {

View File

@ -34,7 +34,7 @@ class RscString : public RscTop
RscId aRefId; // reference name RscId aRefId; // reference name
}; };
public: public:
RscString( Atom nId, sal_uInt32 nTypId ); RscString( Atom nId, RESOURCE_TYPE nTypId );
virtual RSCCLASS_TYPE GetClassType() const override; virtual RSCCLASS_TYPE GetClassType() const override;
void SetRefClass( RscTop * pClass ) { pRefClass = pClass; } void SetRefClass( RscTop * pClass ) { pRefClass = pClass; }

View File

@ -25,6 +25,7 @@
#include <rscclobj.hxx> #include <rscclobj.hxx>
#include <rsc/rscsfx.hxx> #include <rsc/rscsfx.hxx>
#include <o3tl/typed_flags_set.hxx> #include <o3tl/typed_flags_set.hxx>
#include <tools/resid.hxx>
enum class RSCVAR { enum class RSCVAR {
NONE = 0x0000, NONE = 0x0000,
@ -47,7 +48,7 @@ class RscTop : public RefNode
RscTop * pRefClass; RscTop * pRefClass;
protected: protected:
RscTop( Atom nId, sal_uInt32 nTypIdent, RscTop( Atom nId, RESOURCE_TYPE nTypIdent,
RscTop * pSuperCl = nullptr ); RscTop * pSuperCl = nullptr );
public: public:

View File

@ -44,7 +44,7 @@ RscTypCont::RscTypCont( RscError * pErrHdl,
, aSearchPath( rSearchPath ) , aSearchPath( rSearchPath )
, nUniqueId(256) , nUniqueId(256)
, nFilePos( 0 ) , 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 ) , aBool( pHS->getID( "sal_Bool" ), RSC_NOTYPE )
, aShort( pHS->getID( "short" ), RSC_NOTYPE ) , aShort( pHS->getID( "short" ), RSC_NOTYPE )
, aUShort( pHS->getID( "sal_uInt16" ), RSC_NOTYPE ) , aUShort( pHS->getID( "sal_uInt16" ), RSC_NOTYPE )
@ -300,17 +300,17 @@ void RscEnumerateObj::WriteRcFile( RscWriteRc & rMem, FILE * fOut )
/* /*
struct RSHEADER_TYPE{ struct RSHEADER_TYPE{
sal_uInt32 nId; // resource identifier sal_uInt32 nId; // resource identifier
sal_uInt32 nRT; // resource type RESOURCE_TYPE nRT; // resource type
sal_uInt32 nGlobOff; // global offset sal_uInt32 nGlobOff; // global offset
sal_uInt32 nLocalOff; // local offset sal_uInt32 nLocalOff; // local offset
} aHeader; } aHeader;
*/ */
sal_uInt32 nId = rMem.GetLong( 0 ); 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 // 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 ) if( nRT == RSC_VERSIONCONTROL )
{ // always comes last { // always comes last

View File

@ -44,7 +44,7 @@ sal_uInt32 RscInstNode::GetId() const
return nTypeId; 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 ) : RscTop( nId, nTypeId, pSuper )
, pTypeClass(pTypeCl) , pTypeClass(pTypeCl)
, nOffInstData(RscTop::Size()) , nOffInstData(RscTop::Size())
@ -422,7 +422,7 @@ ERRTYPE RscArray::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
return aError; return aError;
} }
RscLangArray::RscLangArray( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper, RscLangArray::RscLangArray( Atom nId, RESOURCE_TYPE nTypeId, RscTop * pSuper,
RscEnum * pTypeCl ) RscEnum * pTypeCl )
: RscArray( nId, nTypeId, pSuper, pTypeCl ) : RscArray( nId, nTypeId, pSuper, pTypeCl )
{ {

View File

@ -28,7 +28,7 @@
#include <tools/rcid.h> #include <tools/rcid.h>
#include <tools/rc.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 ) : RscTop( nId, nTypeId, pSuperCl )
, nSuperSize(RscTop::Size()) , nSuperSize(RscTop::Size())
, nSize(nSuperSize + ALIGNED_SIZE(sizeof(RscClassInst ))) , nSize(nSuperSize + ALIGNED_SIZE(sizeof(RscClassInst )))
@ -642,7 +642,7 @@ ERRTYPE RscClass::WriteRc( const RSCINST & rInst,
return aError; return aError;
} }
RscSysDepend::RscSysDepend( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper ) RscSysDepend::RscSysDepend( Atom nId, RESOURCE_TYPE nTypeId, RscTop * pSuper )
: RscClass( nId, nTypeId, pSuper ) : RscClass( nId, nTypeId, pSuper )
{ {
} }
@ -693,7 +693,7 @@ ERRTYPE RscSysDepend::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
return aError; return aError;
} }
RscTupel::RscTupel( Atom nId, sal_uInt32 nTypeId ) RscTupel::RscTupel( Atom nId, RESOURCE_TYPE nTypeId )
: RscClass( nId, nTypeId, nullptr ) : RscClass( nId, nTypeId, nullptr )
{ {
} }

View File

@ -26,7 +26,7 @@
#include <rschash.hxx> #include <rschash.hxx>
#include <tools/resid.hxx> #include <tools/resid.hxx>
RscConst::RscConst( Atom nId, sal_uInt32 nTypeId ) RscConst::RscConst( Atom nId, RESOURCE_TYPE nTypeId )
: RscTop( nId, nTypeId ) : RscTop( nId, nTypeId )
, pVarArray(nullptr), nEntries(0) , pVarArray(nullptr), nEntries(0)
{ {
@ -98,7 +98,7 @@ sal_uInt32 RscConst::GetConstPos( Atom nConst )
return nEntries; return nEntries;
} }
RscEnum::RscEnum( Atom nId, sal_uInt32 nTypeId ) RscEnum::RscEnum( Atom nId, RESOURCE_TYPE nTypeId )
: RscConst( nId, nTypeId ) : RscConst( nId, nTypeId )
{ {
} }

View File

@ -35,7 +35,7 @@ void ENTRY_STRUCT::Destroy()
} }
} }
RscBaseCont::RscBaseCont( Atom nId, sal_uInt32 nTypeId, RscBaseCont::RscBaseCont( Atom nId, RESOURCE_TYPE nTypeId,
bool bNoIdent ) bool bNoIdent )
: RscTop(nId, nTypeId, nullptr) : RscTop(nId, nTypeId, nullptr)
, pTypeClass(nullptr), pTypeClass1(nullptr) , pTypeClass(nullptr), pTypeClass1(nullptr)
@ -719,7 +719,7 @@ ERRTYPE RscBaseCont::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
return aError; return aError;
} }
RscContWriteSrc::RscContWriteSrc( Atom nId, sal_uInt32 nTypeId ) RscContWriteSrc::RscContWriteSrc( Atom nId, RESOURCE_TYPE nTypeId )
: RscBaseCont( nId, nTypeId, true ) : RscBaseCont( nId, nTypeId, true )
{ {
} }
@ -746,7 +746,7 @@ void RscContWriteSrc::WriteSrc( const RSCINST & rInst, FILE * fOutput,
fprintf( fOutput, "}" ); fprintf( fOutput, "}" );
} }
RscCont::RscCont( Atom nId, sal_uInt32 nTypeId ) RscCont::RscCont( Atom nId, RESOURCE_TYPE nTypeId )
: RscContWriteSrc( nId, nTypeId ) : RscContWriteSrc( nId, nTypeId )
{ {
} }
@ -769,7 +769,7 @@ ERRTYPE RscCont::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
return aError; return aError;
} }
RscContExtraData::RscContExtraData( Atom nId, sal_uInt32 nTypeId ) RscContExtraData::RscContExtraData( Atom nId, RESOURCE_TYPE nTypeId )
: RscContWriteSrc( nId, nTypeId ) : RscContWriteSrc( nId, nTypeId )
{ {
} }

View File

@ -24,7 +24,7 @@
#include <rscflag.hxx> #include <rscflag.hxx>
RscFlag::RscFlag( Atom nId, sal_uInt32 nTypeId ) RscFlag::RscFlag( Atom nId, RESOURCE_TYPE nTypeId )
: RscConst( nId, nTypeId ) : RscConst( nId, nTypeId )
{ {
} }
@ -292,7 +292,7 @@ ERRTYPE RscFlag::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
return ERR_OK; return ERR_OK;
} }
RscClient::RscClient( Atom nId, sal_uInt32 nTypeId, RscFlag * pClass, RscClient::RscClient( Atom nId, RESOURCE_TYPE nTypeId, RscFlag * pClass,
Atom nConstantId ) Atom nConstantId )
: RscTop(nId, nTypeId), pRefClass(pClass), nConstId(nConstantId) : RscTop(nId, nTypeId), pRefClass(pClass), nConstId(nConstantId)
{ {

View File

@ -26,7 +26,7 @@
#include <rscmgr.hxx> #include <rscmgr.hxx>
#include <rscdb.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 ) : RscClass( nId, nTypeId, pSuperCl )
{ {
} }

View File

@ -24,7 +24,7 @@
#include <rscrange.hxx> #include <rscrange.hxx>
RscRange::RscRange( Atom nId, sal_uInt32 nTypeId ) RscRange::RscRange( Atom nId, RESOURCE_TYPE nTypeId )
: RscTop( nId, nTypeId ) : RscTop( nId, nTypeId )
, nMin(0), nMax(0) , nMin(0), nMax(0)
{ {
@ -135,7 +135,7 @@ ERRTYPE RscRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
return ERR_OK; return ERR_OK;
} }
RscLongRange::RscLongRange( Atom nId, sal_uInt32 nTypeId ) RscLongRange::RscLongRange( Atom nId, RESOURCE_TYPE nTypeId )
: RscTop( nId, nTypeId ) : RscTop( nId, nTypeId )
, nMin(0), nMax(0) , nMin(0), nMax(0)
{ {
@ -241,7 +241,7 @@ ERRTYPE RscLongRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
return ERR_OK; return ERR_OK;
} }
RscLongEnumRange::RscLongEnumRange( Atom nId, sal_uInt32 nTypeId ) RscLongEnumRange::RscLongEnumRange( Atom nId, RESOURCE_TYPE nTypeId )
: RscLongRange( nId, nTypeId ) : RscLongRange( nId, nTypeId )
{ {
} }
@ -252,7 +252,7 @@ ERRTYPE RscLongEnumRange::SetConst( const RSCINST & rInst, Atom /*nConst*/,
return SetNumber( rInst, nValue ); return SetNumber( rInst, nValue );
} }
RscIdRange::RscIdRange( Atom nId, sal_uInt32 nTypeId ) RscIdRange::RscIdRange( Atom nId, RESOURCE_TYPE nTypeId )
: RscTop( nId, nTypeId ) : RscTop( nId, nTypeId )
, nMin(0), nMax(0) , 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( nId, nTypeId )
{ {
RscRange::SetRange( 0, 1 ); RscRange::SetRange( 0, 1 );

View File

@ -28,7 +28,7 @@
#include <rtl/textcvt.h> #include <rtl/textcvt.h>
#include <rtl/textenc.h> #include <rtl/textenc.h>
RscString::RscString( Atom nId, sal_uInt32 nTypeId ) RscString::RscString( Atom nId, RESOURCE_TYPE nTypeId )
: RscTop( nId, nTypeId ) : RscTop( nId, nTypeId )
, pRefClass(nullptr) , pRefClass(nullptr)
{ {

View File

@ -22,7 +22,7 @@
#include <string.h> #include <string.h>
#include <rsctop.hxx> #include <rsctop.hxx>
RscTop::RscTop( Atom nId, sal_uInt32 nTypIdent, RscTop * pSuperCl ) RscTop::RscTop( Atom nId, RESOURCE_TYPE nTypIdent, RscTop * pSuperCl )
: RefNode( nId ) : RefNode( nId )
, pSuperClass( pSuperCl ) , pSuperClass( pSuperCl )
, nTypId( nTypIdent ) , nTypId( nTypIdent )

View File

@ -544,7 +544,7 @@ bool InternalResMgr::IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) cons
{ {
// Anfang der Strings suchen // Anfang der Strings suchen
ImpContent aValue; ImpContent aValue;
aValue.nTypeAndId = ((sal_uInt64(nRT) << 32) | nId); aValue.nTypeAndId = ((sal_uInt64(sal_uInt32(nRT)) << 32) | nId);
ImpContent * pFind = ::std::lower_bound(pContent, ImpContent * pFind = ::std::lower_bound(pContent,
pContent + nEntries, pContent + nEntries,
aValue, aValue,
@ -558,11 +558,11 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
{ {
#ifdef DBG_UTIL #ifdef DBG_UTIL
if( pResUseDump ) if( pResUseDump )
pResUseDump->erase( (sal_uInt64(nRT) << 32) | nId ); pResUseDump->erase( (sal_uInt64(sal_uInt32(nRT)) << 32) | nId );
#endif #endif
// search beginning of string // search beginning of string
ImpContent aValue; ImpContent aValue;
aValue.nTypeAndId = ((sal_uInt64(nRT) << 32) | nId); aValue.nTypeAndId = ((sal_uInt64(sal_uInt32(nRT)) << 32) | nId);
ImpContent* pEnd = (pContent + nEntries); ImpContent* pEnd = (pContent + nEntries);
ImpContent* pFind = ::std::lower_bound( pContent, ImpContent* pFind = ::std::lower_bound( pContent,
pEnd, pEnd,
@ -578,9 +578,9 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
// search beginning of string // search beginning of string
ImpContent * pFirst = pFind; ImpContent * pFirst = pFind;
ImpContent * pLast = pFirst; ImpContent * pLast = pFirst;
while( pFirst > pContent && ((pFirst -1)->nTypeAndId >> 32) == RSC_STRING ) while( pFirst > pContent && RESOURCE_TYPE((pFirst -1)->nTypeAndId >> 32) == RSC_STRING )
--pFirst; --pFirst;
while( pLast < pEnd && (pLast->nTypeAndId >> 32) == RSC_STRING ) while( pLast < pEnd && RESOURCE_TYPE(pLast->nTypeAndId >> 32) == RSC_STRING )
++pLast; ++pLast;
nOffCorrection = pFirst->nOffset; nOffCorrection = pFirst->nOffset;
sal_uInt32 nSize; sal_uInt32 nSize;