diff options
Diffstat (limited to 'sc/source/filter/inc/tokstack.hxx')
-rw-r--r-- | sc/source/filter/inc/tokstack.hxx | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/sc/source/filter/inc/tokstack.hxx b/sc/source/filter/inc/tokstack.hxx index 0fc780bab344..eb4ac68a970b 100644 --- a/sc/source/filter/inc/tokstack.hxx +++ b/sc/source/filter/inc/tokstack.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,21 +42,21 @@ typedef OpCode DefTokenId; //typedef UINT16 TokenId; struct TokenId { - UINT16 nId; + UINT16 nId; TokenId() : nId( 0 ) {} TokenId( UINT16 n ) : nId( n ) {} TokenId( const TokenId& r ) : nId( r.nId ) {} - inline TokenId& operator =( const TokenId& r ) { nId = r.nId; return *this; } - inline TokenId& operator =( UINT16 n ) { nId = n; return *this; } - inline operator UINT16&() { return nId; } - inline operator const UINT16&() const { return nId; } - inline BOOL operator <( UINT16 n ) const { return nId < n; } - inline BOOL operator >( UINT16 n ) const { return nId > n; } - inline BOOL operator <=( UINT16 n ) const { return nId <= n; } - inline BOOL operator >=( UINT16 n ) const { return nId >= n; } - inline BOOL operator ==( UINT16 n ) const { return nId == n; } - inline BOOL operator !=( UINT16 n ) const { return nId != n; } + inline TokenId& operator =( const TokenId& r ) { nId = r.nId; return *this; } + inline TokenId& operator =( UINT16 n ) { nId = n; return *this; } + inline operator UINT16&() { return nId; } + inline operator const UINT16&() const { return nId; } + inline BOOL operator <( UINT16 n ) const { return nId < n; } + inline BOOL operator >( UINT16 n ) const { return nId > n; } + inline BOOL operator <=( UINT16 n ) const { return nId <= n; } + inline BOOL operator >=( UINT16 n ) const { return nId >= n; } + inline BOOL operator ==( UINT16 n ) const { return nId == n; } + inline BOOL operator !=( UINT16 n ) const { return nId != n; } }; @@ -68,20 +68,20 @@ class ScToken; enum E_TYPE { - T_Id, // Id-Folge - T_Str, // String - T_D, // Double + T_Id, // Id-Folge + T_Str, // String + T_D, // Double T_Err, // Error code - T_RefC, // Cell Reference - T_RefA, // Area Reference - T_RN, // Range Name - T_Ext, // irgendwas Unbekanntes mit Funktionsnamen - T_Nlf, // token for natural language formula - T_Matrix, // token for inline arrays + T_RefC, // Cell Reference + T_RefA, // Area Reference + T_RN, // Range Name + T_Ext, // irgendwas Unbekanntes mit Funktionsnamen + T_Nlf, // token for natural language formula + T_Matrix, // token for inline arrays T_ExtName, // token for external names T_ExtRefC, T_ExtRefA, - T_Error // fuer Abfrage im Fehlerfall + T_Error // fuer Abfrage im Fehlerfall }; @@ -92,50 +92,50 @@ class TokenPool // !ACHTUNG!: externe Id-Basis ist 1, interne 0! // Ausgabe Id = 0 -> Fehlerfall private: - String** ppP_Str; // Pool fuer Strings - UINT16 nP_Str; // ...mit Groesse - UINT16 nP_StrAkt; // ...und Schreibmarke + String** ppP_Str; // Pool fuer Strings + UINT16 nP_Str; // ...mit Groesse + UINT16 nP_StrAkt; // ...und Schreibmarke - double* pP_Dbl; // Pool fuer Doubles - UINT16 nP_Dbl; - UINT16 nP_DblAkt; + double* pP_Dbl; // Pool fuer Doubles + UINT16 nP_Dbl; + UINT16 nP_DblAkt; USHORT* pP_Err; // Pool for error codes UINT16 nP_Err; UINT16 nP_ErrAkt; - ScSingleRefData** ppP_RefTr; // Pool fuer Referenzen - UINT16 nP_RefTr; - UINT16 nP_RefTrAkt; + ScSingleRefData** ppP_RefTr; // Pool fuer Referenzen + UINT16 nP_RefTr; + UINT16 nP_RefTrAkt; - UINT16* pP_Id; // Pool fuer Id-Folgen - UINT16 nP_Id; - UINT16 nP_IdAkt; - UINT16 nP_IdLast; // letzter Folgen-Beginn + UINT16* pP_Id; // Pool fuer Id-Folgen + UINT16 nP_Id; + UINT16 nP_IdAkt; + UINT16 nP_IdLast; // letzter Folgen-Beginn - struct EXTCONT + struct EXTCONT { - DefTokenId eId; - String aText; + DefTokenId eId; + String aText; EXTCONT( const DefTokenId e, const String& r ) : eId( e ), aText( r ){} }; - EXTCONT** ppP_Ext; - UINT16 nP_Ext; - UINT16 nP_ExtAkt; + EXTCONT** ppP_Ext; + UINT16 nP_Ext; + UINT16 nP_ExtAkt; - struct NLFCONT + struct NLFCONT { - ScSingleRefData aRef; - NLFCONT( const ScSingleRefData& r ) : aRef( r ) {} + ScSingleRefData aRef; + NLFCONT( const ScSingleRefData& r ) : aRef( r ) {} }; - NLFCONT** ppP_Nlf; - UINT16 nP_Nlf; - UINT16 nP_NlfAkt; + NLFCONT** ppP_Nlf; + UINT16 nP_Nlf; + UINT16 nP_NlfAkt; - ScMatrix** ppP_Matrix; // Pool fuer Matricies - UINT16 nP_Matrix; - UINT16 nP_MatrixAkt; + ScMatrix** ppP_Matrix; // Pool fuer Matricies + UINT16 nP_Matrix; + UINT16 nP_MatrixAkt; /** for storage of external names */ struct ExtName @@ -149,7 +149,7 @@ class TokenPool struct ExtCellRef { sal_uInt16 mnFileId; - String maTabName; + String maTabName; ScSingleRefData maRef; }; ::std::vector<ExtCellRef> maExtCellRefs; @@ -158,66 +158,66 @@ class TokenPool struct ExtAreaRef { sal_uInt16 mnFileId; - String maTabName; + String maTabName; ScComplexRefData maRef; }; ::std::vector<ExtAreaRef> maExtAreaRefs; - UINT16* pElement; // Array mit Indizes fuer Elemente - E_TYPE* pType; // ...mit Typ-Info - UINT16* pSize; // ...mit Laengenangabe (Anz. UINT16) - UINT16 nElement; - UINT16 nElementAkt; + UINT16* pElement; // Array mit Indizes fuer Elemente + E_TYPE* pType; // ...mit Typ-Info + UINT16* pSize; // ...mit Laengenangabe (Anz. UINT16) + UINT16 nElement; + UINT16 nElementAkt; - static const UINT16 nScTokenOff;// Offset fuer SC-Token + static const UINT16 nScTokenOff;// Offset fuer SC-Token #ifdef DBG_UTIL - UINT16 nRek; // Rekursionszaehler + UINT16 nRek; // Rekursionszaehler #endif - ScTokenArray* pScToken; // Tokenbastler - - void GrowString( void ); - void GrowDouble( void ); - void GrowTripel( void ); - void GrowId( void ); - void GrowElement( void ); - void GrowExt( void ); - void GrowNlf( void ); - void GrowMatrix( void ); - void GetElement( const UINT16 nId ); - void GetElementRek( const UINT16 nId ); + ScTokenArray* pScToken; // Tokenbastler + + void GrowString( void ); + void GrowDouble( void ); + void GrowTripel( void ); + void GrowId( void ); + void GrowElement( void ); + void GrowExt( void ); + void GrowNlf( void ); + void GrowMatrix( void ); + void GetElement( const UINT16 nId ); + void GetElementRek( const UINT16 nId ); public: TokenPool( void ); ~TokenPool(); - inline TokenPool& operator <<( const TokenId nId ); - inline TokenPool& operator <<( const DefTokenId eId ); - inline TokenPool& operator <<( TokenStack& rStack ); - void operator >>( TokenId& rId ); - inline void operator >>( TokenStack& rStack ); - inline const TokenId Store( void ); - const TokenId Store( const double& rDouble ); + inline TokenPool& operator <<( const TokenId nId ); + inline TokenPool& operator <<( const DefTokenId eId ); + inline TokenPool& operator <<( TokenStack& rStack ); + void operator >>( TokenId& rId ); + inline void operator >>( TokenStack& rStack ); + inline const TokenId Store( void ); + const TokenId Store( const double& rDouble ); // nur fuer Range-Names - const TokenId Store( const UINT16 nIndex ); - inline const TokenId Store( const INT16 nWert ); - const TokenId Store( const String& rString ); - const TokenId Store( const ScSingleRefData& rTr ); - const TokenId Store( const ScComplexRefData& rTr ); + const TokenId Store( const UINT16 nIndex ); + inline const TokenId Store( const INT16 nWert ); + const TokenId Store( const String& rString ); + const TokenId Store( const ScSingleRefData& rTr ); + const TokenId Store( const ScComplexRefData& rTr ); - const TokenId Store( const DefTokenId eId, const String& rName ); + const TokenId Store( const DefTokenId eId, const String& rName ); // 4 externals (e.g. AddIns, Makros...) - const TokenId StoreNlf( const ScSingleRefData& rTr ); + const TokenId StoreNlf( const ScSingleRefData& rTr ); const TokenId StoreMatrix(); const TokenId StoreExtName( sal_uInt16 nFileId, const String& rName ); const TokenId StoreExtRef( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& rRef ); const TokenId StoreExtRef( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef ); - inline const TokenId LastId( void ) const; - inline const ScTokenArray* operator []( const TokenId nId ); - void Reset( void ); - inline E_TYPE GetType( const TokenId& nId ) const; - BOOL IsSingleOp( const TokenId& nId, const DefTokenId eId ) const; + inline const TokenId LastId( void ) const; + inline const ScTokenArray* operator []( const TokenId nId ); + void Reset( void ); + inline E_TYPE GetType( const TokenId& nId ) const; + BOOL IsSingleOp( const TokenId& nId, const DefTokenId eId ) const; const String* GetExternal( const TokenId& nId ) const; - ScMatrix* GetMatrix( unsigned int n ) const; + ScMatrix* GetMatrix( unsigned int n ) const; }; @@ -225,22 +225,22 @@ class TokenPool class TokenStack // Stack fuer Token-Ids: Id 0 sollte reserviert bleiben als - // fehlerhafte Id, da z.B. Get() im Fehlerfall 0 liefert + // fehlerhafte Id, da z.B. Get() im Fehlerfall 0 liefert { private: - TokenId* pStack; // Stack als Array - UINT16 nPos; // Schreibmarke - UINT16 nSize; // Erster Index ausserhalb des Stacks + TokenId* pStack; // Stack als Array + UINT16 nPos; // Schreibmarke + UINT16 nSize; // Erster Index ausserhalb des Stacks public: TokenStack( UINT16 nNewSize = 1024 ); ~TokenStack(); - inline TokenStack& operator <<( const TokenId nNewId ); - inline void operator >>( TokenId &rId ); + inline TokenStack& operator <<( const TokenId nNewId ); + inline void operator >>( TokenId &rId ); - inline void Reset( void ); + inline void Reset( void ); inline bool HasMoreTokens() const { return nPos > 0; } - inline const TokenId Get( void ); + inline const TokenId Get( void ); }; @@ -301,7 +301,7 @@ inline void TokenStack::Reset( void ) inline TokenPool& TokenPool::operator <<( const TokenId nId ) { // POST: nId's werden hintereinander im Pool unter einer neuen Id - // abgelegt. Vorgang wird mit >> oder Store() abgeschlossen + // abgelegt. Vorgang wird mit >> oder Store() abgeschlossen // nId -> ( UINT16 ) nId - 1; DBG_ASSERT( ( UINT16 ) nId < nScTokenOff, "-TokenPool::operator <<: TokenId im DefToken-Bereich!" ); |