diff options
Diffstat (limited to 'basic/inc/basic/sbxvar.hxx')
-rw-r--r-- | basic/inc/basic/sbxvar.hxx | 226 |
1 files changed, 113 insertions, 113 deletions
diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx index 1ba1b5d1edfa..5a2fc4601586 100644 --- a/basic/inc/basic/sbxvar.hxx +++ b/basic/inc/basic/sbxvar.hxx @@ -38,17 +38,17 @@ struct SbxINT64 { - INT32 nHigh; UINT32 nLow; + sal_Int32 nHigh; sal_uInt32 nLow; #if FALSE SbxINT64() : nHigh( 0 ), nLow( 0 ) {} - SbxINT64( UINT8 n ) : nHigh( 0 ), nLow( n ) {} - SbxINT64( UINT16 n ) : nHigh( 0 ), nLow( n ) {} - SbxINT64( UINT32 n ) : nHigh( 0 ), nLow( n ) {} + SbxINT64( sal_uInt8 n ) : nHigh( 0 ), nLow( n ) {} + SbxINT64( sal_uInt16 n ) : nHigh( 0 ), nLow( n ) {} + SbxINT64( sal_uInt32 n ) : nHigh( 0 ), nLow( n ) {} SbxINT64( unsigned int n ) : nHigh( 0 ), nLow( n ) {} - SbxINT64( INT8 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} - SbxINT64( INT16 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} - SbxINT64( INT32 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} + SbxINT64( sal_Int8 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} + SbxINT64( sal_Int16 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} + SbxINT64( sal_Int32 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} SbxINT64( int n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} SbxINT64( SbxINT64 &r ) : nHigh( r.nHigh ), nLow( r.nLow ) {} @@ -57,7 +57,7 @@ struct SbxINT64 #endif void CHS() { - nLow ^= (UINT32)-1; + nLow ^= (sal_uInt32)-1; nHigh ^= -1; nLow++; if( !nLow ) @@ -69,16 +69,16 @@ struct SbxINT64 { if( n >= 0 ) { - nHigh = (INT32)(n / (double)4294967296.0); - nLow = (UINT32)(n - ((double)nHigh * (double)4294967296.0) + 0.5); + nHigh = (sal_Int32)(n / (double)4294967296.0); + nLow = (sal_uInt32)(n - ((double)nHigh * (double)4294967296.0) + 0.5); } else { - nHigh = (INT32)(-n / (double)4294967296.0); - nLow = (UINT32)(-n - ((double)nHigh * (double)4294967296.0) + 0.5); + nHigh = (sal_Int32)(-n / (double)4294967296.0); + nLow = (sal_uInt32)(-n - ((double)nHigh * (double)4294967296.0) + 0.5); CHS(); } } - void Set(INT32 n) { nHigh = n < 0 ? -1 : 0; nLow = n; } + void Set(sal_Int32 n) { nHigh = n < 0 ? -1 : 0; nLow = n; } void SetMax() { nHigh = 0x7FFFFFFF; nLow = 0xFFFFFFFF; } void SetMin() { nHigh = 0x80000000; nLow = 0x00000000; } @@ -117,14 +117,14 @@ struct SbxINT64 struct SbxUINT64 { - UINT32 nHigh; UINT32 nLow; + sal_uInt32 nHigh; sal_uInt32 nLow; void Set(double n) { - nHigh = (UINT32)(n / (double)4294967296.0); - nLow = (UINT32)(n - ((double)nHigh * (double)4294967296.0)); + nHigh = (sal_uInt32)(n / (double)4294967296.0); + nLow = (sal_uInt32)(n - ((double)nHigh * (double)4294967296.0)); } - void Set(UINT32 n) { nHigh = 0; nLow = n; } + void Set(sal_uInt32 n) { nHigh = 0; nLow = n; } void SetMax() { nHigh = 0xFFFFFFFF; nLow = 0xFFFFFFFF; } void SetMin() { nHigh = 0x00000000; nLow = 0x00000000; } @@ -165,11 +165,11 @@ struct SbxValues { union { sal_Unicode nChar; - BYTE nByte; - INT16 nInteger; - INT32 nLong; - UINT16 nUShort; - UINT32 nULong; + sal_uInt8 nByte; + sal_Int16 nInteger; + sal_Int32 nLong; + sal_uInt16 nUShort; + sal_uInt32 nULong; float nSingle; double nDouble; SbxINT64 nLong64; @@ -183,11 +183,11 @@ struct SbxValues SbxBase* pObj; sal_Unicode* pChar; - BYTE* pByte; - INT16* pInteger; - INT32* pLong; - UINT16* pUShort; - UINT32* pULong; + sal_uInt8* pByte; + sal_Int16* pInteger; + sal_Int32* pLong; + sal_uInt16* pUShort; + sal_uInt32* pULong; float* pSingle; double* pDouble; SbxINT64* pLong64; @@ -203,11 +203,11 @@ struct SbxValues SbxValues(): pData( NULL ), eType(SbxEMPTY) {} SbxValues( SbxDataType e ): eType(e) {} SbxValues( char _nChar ): nChar( _nChar ), eType(SbxCHAR) {} - SbxValues( BYTE _nByte ): nByte( _nByte ), eType(SbxBYTE) {} + SbxValues( sal_uInt8 _nByte ): nByte( _nByte ), eType(SbxBYTE) {} SbxValues( short _nInteger ): nInteger( _nInteger ), eType(SbxINTEGER ) {} SbxValues( long _nLong ): nLong( _nLong ), eType(SbxLONG) {} - SbxValues( USHORT _nUShort ): nUShort( _nUShort ), eType(SbxUSHORT) {} - SbxValues( ULONG _nULong ): nULong( _nULong ), eType(SbxULONG) {} + SbxValues( sal_uInt16 _nUShort ): nUShort( _nUShort ), eType(SbxUSHORT) {} + SbxValues( sal_uIntPtr _nULong ): nULong( _nULong ), eType(SbxULONG) {} SbxValues( float _nSingle ): nSingle( _nSingle ), eType(SbxSINGLE) {} SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {} SbxValues( int _nInt ): nInt( _nInt ), eType(SbxINT) {} @@ -233,17 +233,17 @@ class SbxValue : public SbxBase SbxValueImpl* mpSbxValueImplImpl; // Impl data // #55226 Transport additional infos - SbxValue* TheRealValue( BOOL bObjInObjError ) const; + SbxValue* TheRealValue( sal_Bool bObjInObjError ) const; SbxValue* TheRealValue() const; protected: SbxValues aData; // Data ::rtl::OUString aPic; // Picture-String String aToolString; // tool string copy - virtual void Broadcast( ULONG ); // Broadcast-Call + virtual void Broadcast( sal_uIntPtr ); // Broadcast-Call virtual ~SbxValue(); - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VALUE,1); TYPEINFO(); @@ -252,41 +252,41 @@ public: SbxValue( const SbxValue& ); SbxValue& operator=( const SbxValue& ); virtual void Clear(); - virtual BOOL IsFixed() const; - - BOOL IsInteger() const { return BOOL( GetType() == SbxINTEGER ); } - BOOL IsLong() const { return BOOL( GetType() == SbxLONG ); } - BOOL IsSingle() const { return BOOL( GetType() == SbxSINGLE ); } - BOOL IsDouble() const { return BOOL( GetType() == SbxDOUBLE ); } - BOOL IsString() const { return BOOL( GetType() == SbxSTRING ); } - BOOL IsDate() const { return BOOL( GetType() == SbxDATE ); } - BOOL IsCurrency()const { return BOOL( GetType() == SbxCURRENCY ); } - BOOL IsObject() const { return BOOL( GetType() == SbxOBJECT ); } - BOOL IsDataObject()const{return BOOL( GetType() == SbxDATAOBJECT);} - BOOL IsBool() const { return BOOL( GetType() == SbxBOOL ); } - BOOL IsErr() const { return BOOL( GetType() == SbxERROR ); } - BOOL IsEmpty() const { return BOOL( GetType() == SbxEMPTY ); } - BOOL IsNull() const { return BOOL( GetType() == SbxNULL ); } - BOOL IsChar() const { return BOOL( GetType() == SbxCHAR ); } - BOOL IsByte() const { return BOOL( GetType() == SbxBYTE ); } - BOOL IsUShort() const { return BOOL( GetType() == SbxUSHORT ); } - BOOL IsULong() const { return BOOL( GetType() == SbxULONG ); } - BOOL IsInt() const { return BOOL( GetType() == SbxINT ); } - BOOL IsUInt() const { return BOOL( GetType() == SbxUINT ); } - BOOL IspChar() const { return BOOL( GetType() == SbxLPSTR ); } - BOOL IsNumeric() const; - BOOL IsNumericRTL() const; // #41692 Interface for Basic - BOOL ImpIsNumeric( BOOL bOnlyIntntl ) const; // Implementation + virtual sal_Bool IsFixed() const; + + sal_Bool IsInteger() const { return sal_Bool( GetType() == SbxINTEGER ); } + sal_Bool IsLong() const { return sal_Bool( GetType() == SbxLONG ); } + sal_Bool IsSingle() const { return sal_Bool( GetType() == SbxSINGLE ); } + sal_Bool IsDouble() const { return sal_Bool( GetType() == SbxDOUBLE ); } + sal_Bool IsString() const { return sal_Bool( GetType() == SbxSTRING ); } + sal_Bool IsDate() const { return sal_Bool( GetType() == SbxDATE ); } + sal_Bool IsCurrency()const { return sal_Bool( GetType() == SbxCURRENCY ); } + sal_Bool IsObject() const { return sal_Bool( GetType() == SbxOBJECT ); } + sal_Bool IsDataObject()const{return sal_Bool( GetType() == SbxDATAOBJECT);} + sal_Bool IsBool() const { return sal_Bool( GetType() == SbxBOOL ); } + sal_Bool IsErr() const { return sal_Bool( GetType() == SbxERROR ); } + sal_Bool IsEmpty() const { return sal_Bool( GetType() == SbxEMPTY ); } + sal_Bool IsNull() const { return sal_Bool( GetType() == SbxNULL ); } + sal_Bool IsChar() const { return sal_Bool( GetType() == SbxCHAR ); } + sal_Bool IsByte() const { return sal_Bool( GetType() == SbxBYTE ); } + sal_Bool IsUShort() const { return sal_Bool( GetType() == SbxUSHORT ); } + sal_Bool IsULong() const { return sal_Bool( GetType() == SbxULONG ); } + sal_Bool IsInt() const { return sal_Bool( GetType() == SbxINT ); } + sal_Bool IsUInt() const { return sal_Bool( GetType() == SbxUINT ); } + sal_Bool IspChar() const { return sal_Bool( GetType() == SbxLPSTR ); } + sal_Bool IsNumeric() const; + sal_Bool IsNumericRTL() const; // #41692 Interface for Basic + sal_Bool ImpIsNumeric( sal_Bool bOnlyIntntl ) const; // Implementation virtual SbxClassType GetClass() const; virtual SbxDataType GetType() const; SbxDataType GetFullType() const; - BOOL SetType( SbxDataType ); + sal_Bool SetType( SbxDataType ); - virtual BOOL Get( SbxValues& ) const; - BOOL GetNoBroadcast( SbxValues& ); + virtual sal_Bool Get( SbxValues& ) const; + sal_Bool GetNoBroadcast( SbxValues& ); const SbxValues& GetValues_Impl() const { return aData; } - virtual BOOL Put( const SbxValues& ); + virtual sal_Bool Put( const SbxValues& ); inline SbxValues * data() { return &aData; } @@ -295,65 +295,65 @@ public: SbxUINT64 GetULong64() const; sal_Int64 GetInt64() const; sal_uInt64 GetUInt64() const; - INT16 GetInteger() const; - INT32 GetLong() const; + sal_Int16 GetInteger() const; + sal_Int32 GetLong() const; float GetSingle() const; double GetDouble() const; double GetDate() const; - BOOL GetBool() const; - UINT16 GetErr() const; + sal_Bool GetBool() const; + sal_uInt16 GetErr() const; const String& GetString() const; const String& GetCoreString() const; ::rtl::OUString GetOUString() const; SbxDecimal* GetDecimal() const; SbxBase* GetObject() const; - BOOL HasObject() const; + sal_Bool HasObject() const; void* GetData() const; sal_Unicode GetChar() const; - BYTE GetByte() const; - UINT16 GetUShort() const; - UINT32 GetULong() const; + sal_uInt8 GetByte() const; + sal_uInt16 GetUShort() const; + sal_uInt32 GetULong() const; int GetInt() const; - BOOL PutCurrency( const SbxINT64& ); - BOOL PutLong64( const SbxINT64& ); - BOOL PutULong64( const SbxUINT64& ); - BOOL PutInt64( sal_Int64 ); - BOOL PutUInt64( sal_uInt64 ); - BOOL PutInteger( INT16 ); - BOOL PutLong( INT32 ); - BOOL PutSingle( float ); - BOOL PutDouble( double ); - BOOL PutDate( double ); - BOOL PutBool( BOOL ); - BOOL PutErr( USHORT ); - BOOL PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "TRUE"/"FALSE") - BOOL PutString( const ::rtl::OUString& ); - BOOL PutString( const sal_Unicode* ); // Type = SbxSTRING - BOOL PutpChar( const sal_Unicode* ); // Type = SbxLPSTR - BOOL PutDecimal( SbxDecimal* pDecimal ); - BOOL PutObject( SbxBase* ); - BOOL PutData( void* ); - BOOL PutChar( sal_Unicode ); - BOOL PutByte( BYTE ); - BOOL PutUShort( UINT16 ); - BOOL PutULong( UINT32 ); - BOOL PutInt( int ); - BOOL PutEmpty(); - BOOL PutNull(); + sal_Bool PutCurrency( const SbxINT64& ); + sal_Bool PutLong64( const SbxINT64& ); + sal_Bool PutULong64( const SbxUINT64& ); + sal_Bool PutInt64( sal_Int64 ); + sal_Bool PutUInt64( sal_uInt64 ); + sal_Bool PutInteger( sal_Int16 ); + sal_Bool PutLong( sal_Int32 ); + sal_Bool PutSingle( float ); + sal_Bool PutDouble( double ); + sal_Bool PutDate( double ); + sal_Bool PutBool( sal_Bool ); + sal_Bool PutErr( sal_uInt16 ); + sal_Bool PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "sal_True"/"sal_False") + sal_Bool PutString( const ::rtl::OUString& ); + sal_Bool PutString( const sal_Unicode* ); // Type = SbxSTRING + sal_Bool PutpChar( const sal_Unicode* ); // Type = SbxLPSTR + sal_Bool PutDecimal( SbxDecimal* pDecimal ); + sal_Bool PutObject( SbxBase* ); + sal_Bool PutData( void* ); + sal_Bool PutChar( sal_Unicode ); + sal_Bool PutByte( sal_uInt8 ); + sal_Bool PutUShort( sal_uInt16 ); + sal_Bool PutULong( sal_uInt32 ); + sal_Bool PutInt( int ); + sal_Bool PutEmpty(); + sal_Bool PutNull(); // Special decimal methods - BOOL PutDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); - BOOL fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); + sal_Bool PutDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); + sal_Bool fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); - virtual BOOL Convert( SbxDataType ); - virtual BOOL Compute( SbxOperator, const SbxValue& ); - virtual BOOL Compare( SbxOperator, const SbxValue& ) const; - BOOL Scan( const String&, USHORT* = NULL ); + virtual sal_Bool Convert( SbxDataType ); + virtual sal_Bool Compute( SbxOperator, const SbxValue& ); + virtual sal_Bool Compare( SbxOperator, const SbxValue& ) const; + sal_Bool Scan( const String&, sal_uInt16* = NULL ); void Format( String&, const String* = NULL ) const; // Interface for CDbl in Basic - static SbxError ScanNumIntnl( const String& rSrc, double& nVal, BOOL bSingle=FALSE ); + static SbxError ScanNumIntnl( const String& rSrc, double& nVal, sal_Bool bSingle=sal_False ); // The following operators are definied for easier handling. // Error conditions (overflow, conversions) are not @@ -449,7 +449,7 @@ class SbxVariable : public SbxValue SfxBroadcaster* pCst; // Broadcaster, if needed String maName; // Name, if available SbxArrayRef mpPar; // Parameter-Array, if set - USHORT nHash; // Hash-ID for search + sal_uInt16 nHash; // Hash-ID for search SbxVariableImpl* getImpl( void ); @@ -458,8 +458,8 @@ protected: sal_uIntPtr nUserData; // User data for Call() SbxObject* pParent; // Currently attached object virtual ~SbxVariable(); - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VARIABLE,2); TYPEINFO(); @@ -468,13 +468,13 @@ public: SbxVariable( const SbxVariable& ); SbxVariable& operator=( const SbxVariable& ); - void Dump( SvStream&, BOOL bDumpAll=FALSE ); + void Dump( SvStream&, sal_Bool bDumpAll=sal_False ); virtual void SetName( const String& ); virtual const String& GetName( SbxNameType = SbxNAME_NONE ) const; - USHORT GetHashCode() const { return nHash; } + sal_uInt16 GetHashCode() const { return nHash; } - virtual void SetModified( BOOL ); + virtual void SetModified( sal_Bool ); sal_uIntPtr GetUserData() const { return nUserData; } void SetUserData( sal_uIntPtr n ) { nUserData = n; } @@ -491,8 +491,8 @@ public: // Sfx-Broadcasting-Support: // Due to data reduction and better DLL-hierarchie currently via casting SfxBroadcaster& GetBroadcaster(); - BOOL IsBroadcaster() const { return BOOL( pCst != NULL ); } - virtual void Broadcast( ULONG nHintId ); + sal_Bool IsBroadcaster() const { return sal_Bool( pCst != NULL ); } + virtual void Broadcast( sal_uIntPtr nHintId ); inline const SbxObject* GetParent() const { return pParent; } inline SbxObject* GetParent() { return pParent; } @@ -504,7 +504,7 @@ public: StarBASIC* pParentBasic ); void ClearComListener( void ); - static USHORT MakeHashCode( const String& rName ); + static sal_uInt16 MakeHashCode( const String& rName ); }; #ifndef SBX_VARIABLE_DECL_DEFINED |