summaryrefslogtreecommitdiff
path: root/formula/inc
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-02-28 10:08:33 +0100
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-02-28 10:08:33 +0100
commitde19474011d199d247b2da9d12f12104133a6f26 (patch)
treed146936375b082768d6cd4a18fac27f0ce6e8c1a /formula/inc
parent01fcebb5790e99aabf968d48d5915dbe736c3cb3 (diff)
parent4fba42e5f98fcc0fa9addf41a793c1d7f11602c8 (diff)
dr78: rebase to DEV300_m101
Diffstat (limited to 'formula/inc')
-rw-r--r--formula/inc/formula/FormulaCompiler.hxx56
-rw-r--r--formula/inc/formula/IControlReferenceHandler.hxx2
-rw-r--r--formula/inc/formula/IFunctionDescription.hxx10
-rw-r--r--formula/inc/formula/errorcodes.hxx78
-rw-r--r--formula/inc/formula/formdata.hxx38
-rw-r--r--formula/inc/formula/formula.hxx24
-rw-r--r--formula/inc/formula/formulahelper.hxx12
-rw-r--r--formula/inc/formula/funcutl.hxx2
-rw-r--r--formula/inc/formula/opcode.hxx2
-rw-r--r--formula/inc/formula/token.hxx92
-rw-r--r--formula/inc/formula/tokenarray.hxx48
11 files changed, 182 insertions, 182 deletions
diff --git a/formula/inc/formula/FormulaCompiler.hxx b/formula/inc/formula/FormulaCompiler.hxx
index 8d04084d64d8..75e163061ebe 100644
--- a/formula/inc/formula/FormulaCompiler.hxx
+++ b/formula/inc/formula/FormulaCompiler.hxx
@@ -64,7 +64,7 @@ struct FormulaArrayStack
{
FormulaArrayStack* pNext;
FormulaTokenArray* pArr;
- BOOL bTemp;
+ sal_Bool bTemp;
};
@@ -99,7 +99,7 @@ public:
ExternalHashMap * mpExternalHashMap; /// Hash map of ocExternal, Filter String -> AddIn String
ExternalHashMap * mpReverseExternalHashMap; /// Hash map of ocExternal, AddIn String -> Filter String
FormulaGrammar::Grammar meGrammar; /// Grammar, language and reference convention
- USHORT mnSymbols; /// Count of OpCode symbols
+ sal_uInt16 mnSymbols; /// Count of OpCode symbols
bool mbCore : 1; /// If mapping was setup by core, not filters
bool mbEnglish : 1; /// If English symbols and external names
@@ -109,7 +109,7 @@ public:
public:
- OpCodeMap(USHORT nSymbols, bool bCore, FormulaGrammar::Grammar eGrammar ) :
+ OpCodeMap(sal_uInt16 nSymbols, bool bCore, FormulaGrammar::Grammar eGrammar ) :
mpHashMap( new OpCodeHashMap( nSymbols)),
mpTable( new String[ nSymbols ]),
mpExternalHashMap( new ExternalHashMap),
@@ -135,8 +135,8 @@ public:
/// Get the symbol string matching an OpCode.
inline const String& getSymbol( const OpCode eOp ) const
{
- DBG_ASSERT( USHORT(eOp) < mnSymbols, "OpCodeMap::getSymbol: OpCode out of range");
- if (USHORT(eOp) < mnSymbols)
+ DBG_ASSERT( sal_uInt16(eOp) < mnSymbols, "OpCodeMap::getSymbol: OpCode out of range");
+ if (sal_uInt16(eOp) < mnSymbols)
return mpTable[ eOp ];
static String s_sEmpty;
return s_sEmpty;
@@ -146,7 +146,7 @@ public:
inline FormulaGrammar::Grammar getGrammar() const { return meGrammar; }
/// Get the symbol count.
- inline USHORT getSymbolCount() const { return mnSymbols; }
+ inline sal_uInt16 getSymbolCount() const { return mnSymbols; }
/** Are these English symbols, as opposed to native language (which may
be English as well)? */
@@ -216,23 +216,23 @@ public:
*/
OpCode GetEnglishOpCode( const String& rName ) const;
- void SetCompileForFAP( BOOL bVal )
+ void SetCompileForFAP( sal_Bool bVal )
{ bCompileForFAP = bVal; bIgnoreErrors = bVal; }
- static BOOL DeQuote( String& rStr );
+ static sal_Bool DeQuote( String& rStr );
static const String& GetNativeSymbol( OpCode eOp );
- static BOOL IsMatrixFunction(OpCode _eOpCode); // if a function _always_ returns a Matrix
+ static sal_Bool IsMatrixFunction(OpCode _eOpCode); // if a function _always_ returns a Matrix
short GetNumFormatType() const { return nNumFmt; }
- BOOL CompileTokenArray();
+ sal_Bool CompileTokenArray();
void CreateStringFromTokenArray( String& rFormula );
void CreateStringFromTokenArray( rtl::OUStringBuffer& rBuffer );
FormulaToken* CreateStringFromToken( String& rFormula, FormulaToken* pToken,
- BOOL bAllowArrAdvance = FALSE );
+ sal_Bool bAllowArrAdvance = sal_False );
FormulaToken* CreateStringFromToken( rtl::OUStringBuffer& rBuffer, FormulaToken* pToken,
- BOOL bAllowArrAdvance = FALSE );
+ sal_Bool bAllowArrAdvance = sal_False );
void AppendBoolean( rtl::OUStringBuffer& rBuffer, bool bVal );
void AppendDouble( rtl::OUStringBuffer& rBuffer, double fVal );
@@ -243,18 +243,18 @@ public:
inline FormulaGrammar::Grammar GetGrammar() const { return meGrammar; }
protected:
- virtual String FindAddInFunction( const String& rUpperName, BOOL bLocalFirst ) const;
+ virtual String FindAddInFunction( const String& rUpperName, sal_Bool bLocalFirst ) const;
virtual void fillFromAddInCollectionUpperName( NonConstOpCodeMapPtr xMap ) const;
virtual void fillFromAddInMap( NonConstOpCodeMapPtr xMap, FormulaGrammar::Grammar _eGrammar ) const;
virtual void fillFromAddInCollectionEnglishName( NonConstOpCodeMapPtr xMap ) const;
virtual void fillAddInToken(::std::vector< ::com::sun::star::sheet::FormulaOpCodeMapEntry >& _rVec,bool _bIsEnglish) const;
- virtual void SetError(USHORT nError);
+ virtual void SetError(sal_uInt16 nError);
virtual FormulaTokenRef ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2, bool bReuseDoubleRef );
- virtual BOOL HandleExternalReference(const FormulaToken& _aToken);
- virtual BOOL HandleRange();
- virtual BOOL HandleSingleRef();
- virtual BOOL HandleDbData();
+ virtual sal_Bool HandleExternalReference(const FormulaToken& _aToken);
+ virtual sal_Bool HandleRange();
+ virtual sal_Bool HandleSingleRef();
+ virtual sal_Bool HandleDbData();
virtual void CreateStringFromExternal(rtl::OUStringBuffer& rBuffer, FormulaToken* pTokenP);
virtual void CreateStringFromSingleRef(rtl::OUStringBuffer& rBuffer,FormulaToken* pTokenP);
@@ -262,9 +262,9 @@ protected:
virtual void CreateStringFromMatrix(rtl::OUStringBuffer& rBuffer,FormulaToken* pTokenP);
virtual void CreateStringFromIndex(rtl::OUStringBuffer& rBuffer,FormulaToken* pTokenP);
virtual void LocalizeString( String& rName ); // modify rName - input: exact name
- virtual BOOL IsImportingXML() const;
+ virtual sal_Bool IsImportingXML() const;
- BOOL GetToken();
+ sal_Bool GetToken();
OpCode NextToken();
void PutCode( FormulaTokenRef& );
void Factor();
@@ -281,7 +281,7 @@ protected:
void NotLine();
OpCode Expression();
void PopTokenArray();
- void PushTokenArray( FormulaTokenArray*, BOOL = FALSE );
+ void PushTokenArray( FormulaTokenArray*, sal_Bool = sal_False );
bool MergeRangeReference( FormulaToken * * const pCode1, FormulaToken * const * const pCode2 );
@@ -301,25 +301,25 @@ protected:
OpCode eLastOp;
short nRecursion; // GetToken() recursions
short nNumFmt; // set during CompileTokenArray()
- USHORT pc;
+ sal_uInt16 pc;
FormulaGrammar::Grammar
meGrammar; // The grammar used, language plus convention.
- BOOL bAutoCorrect; // whether to apply AutoCorrection
- BOOL bCorrected; // AutoCorrection was applied
- BOOL bCompileForFAP; //! not real RPN but names, for FunctionAutoPilot,
+ sal_Bool bAutoCorrect; // whether to apply AutoCorrection
+ sal_Bool bCorrected; // AutoCorrection was applied
+ sal_Bool bCompileForFAP; //! not real RPN but names, for FunctionAutoPilot,
// will not be resolved
- BOOL bIgnoreErrors; // on AutoCorrect and CompileForFAP
+ sal_Bool bIgnoreErrors; // on AutoCorrect and CompileForFAP
// ignore errors and create RPN nevertheless
- BOOL glSubTotal; // if code contains one or more subtotal functions
+ sal_Bool glSubTotal; // if code contains one or more subtotal functions
private:
void InitSymbolsNative() const; /// only SymbolsNative, on first document creation
void InitSymbolsEnglish() const; /// only SymbolsEnglish, maybe later
void InitSymbolsPODF() const; /// only SymbolsPODF, on demand
void InitSymbolsODFF() const; /// only SymbolsODFF, on demand
- void loadSymbols(USHORT _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const;
+ void loadSymbols(sal_uInt16 _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const;
static inline void ForceArrayOperator( FormulaTokenRef& rCurr, const FormulaTokenRef& rPrev )
{
diff --git a/formula/inc/formula/IControlReferenceHandler.hxx b/formula/inc/formula/IControlReferenceHandler.hxx
index 5b5a78b0467f..9248040e0bbc 100644
--- a/formula/inc/formula/IControlReferenceHandler.hxx
+++ b/formula/inc/formula/IControlReferenceHandler.hxx
@@ -37,7 +37,7 @@ namespace formula
{
public:
virtual void ShowReference(const String& _sRef) = 0;
- virtual void HideReference( BOOL bDoneRefMode = TRUE ) = 0;
+ virtual void HideReference( sal_Bool bDoneRefMode = sal_True ) = 0;
virtual void ReleaseFocus( RefEdit* pEdit, RefButton* pButton = NULL ) = 0;
virtual void ToggleCollapsed( RefEdit* pEdit, RefButton* pButton = NULL ) = 0;
};
diff --git a/formula/inc/formula/IFunctionDescription.hxx b/formula/inc/formula/IFunctionDescription.hxx
index 8dd3a95ae067..f78c7c09c4af 100644
--- a/formula/inc/formula/IFunctionDescription.hxx
+++ b/formula/inc/formula/IFunctionDescription.hxx
@@ -89,7 +89,7 @@ namespace formula
// GetFormulaString
virtual ::rtl::OUString getFormula(const ::std::vector< ::rtl::OUString >& _aArguments) const = 0;
// GetVisibleArgMapping
- virtual void fillVisibleArgumentMapping(::std::vector<USHORT>& _rArguments) const = 0;
+ virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const = 0;
virtual void initArgumentInfo() const = 0;
virtual ::rtl::OUString getSignature() const = 0;
virtual rtl::OString getHelpId() const = 0;
@@ -117,7 +117,7 @@ namespace formula
public:
IStructHelper(){}
virtual SvLBoxEntry* InsertEntry(const XubString& rText, SvLBoxEntry* pParent,
- USHORT nFlag,ULONG nPos=0,IFormulaToken* pScToken=NULL) = 0;
+ sal_uInt16 nFlag,sal_uLong nPos=0,IFormulaToken* pScToken=NULL) = 0;
virtual String GetEntryText(SvLBoxEntry* pEntry) const = 0;
virtual SvLBoxEntry* GetParent(SvLBoxEntry* pEntry) const = 0;
@@ -152,9 +152,9 @@ namespace formula
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const = 0;
virtual ::com::sun::star::table::CellAddress getReferencePosition() const = 0;
- virtual void setDispatcherLock( BOOL bLock ) = 0;
- virtual void dispatch(BOOL _bOK,BOOL _bMartixChecked) = 0;
- virtual void doClose(BOOL _bOk) = 0;
+ virtual void setDispatcherLock( sal_Bool bLock ) = 0;
+ virtual void dispatch(sal_Bool _bOK,sal_Bool _bMartixChecked) = 0;
+ virtual void doClose(sal_Bool _bOk) = 0;
virtual void insertEntryToLRUList(const IFunctionDescription* pDesc) = 0;
virtual void showReference(const String& _sFormula) = 0;
};
diff --git a/formula/inc/formula/errorcodes.hxx b/formula/inc/formula/errorcodes.hxx
index f08af17e095e..fe8382eced9b 100644
--- a/formula/inc/formula/errorcodes.hxx
+++ b/formula/inc/formula/errorcodes.hxx
@@ -34,60 +34,60 @@
namespace ScErrorCodes
{
-const USHORT errIllegalChar = 501;
-const USHORT errIllegalArgument = 502;
-const USHORT errIllegalFPOperation = 503; // #NUM!
-const USHORT errIllegalParameter = 504;
-const USHORT errIllegalJump = 505;
-const USHORT errSeparator = 506;
-const USHORT errPair = 507;
-const USHORT errPairExpected = 508;
-const USHORT errOperatorExpected = 509;
-const USHORT errVariableExpected = 510;
-const USHORT errParameterExpected = 511;
-const USHORT errCodeOverflow = 512;
-const USHORT errStringOverflow = 513;
-const USHORT errStackOverflow = 514;
-const USHORT errUnknownState = 515;
-const USHORT errUnknownVariable = 516;
-const USHORT errUnknownOpCode = 517;
-const USHORT errUnknownStackVariable = 518;
-const USHORT errNoValue = 519; // #VALUE!
-const USHORT errUnknownToken = 520;
-const USHORT errNoCode = 521; // #NULL!
-const USHORT errCircularReference = 522;
-const USHORT errNoConvergence = 523;
-const USHORT errNoRef = 524; // #REF!
-const USHORT errNoName = 525; // #NAME?
-const USHORT errDoubleRef = 526;
-const USHORT errInterpOverflow = 527;
+const sal_uInt16 errIllegalChar = 501;
+const sal_uInt16 errIllegalArgument = 502;
+const sal_uInt16 errIllegalFPOperation = 503; // #NUM!
+const sal_uInt16 errIllegalParameter = 504;
+const sal_uInt16 errIllegalJump = 505;
+const sal_uInt16 errSeparator = 506;
+const sal_uInt16 errPair = 507;
+const sal_uInt16 errPairExpected = 508;
+const sal_uInt16 errOperatorExpected = 509;
+const sal_uInt16 errVariableExpected = 510;
+const sal_uInt16 errParameterExpected = 511;
+const sal_uInt16 errCodeOverflow = 512;
+const sal_uInt16 errStringOverflow = 513;
+const sal_uInt16 errStackOverflow = 514;
+const sal_uInt16 errUnknownState = 515;
+const sal_uInt16 errUnknownVariable = 516;
+const sal_uInt16 errUnknownOpCode = 517;
+const sal_uInt16 errUnknownStackVariable = 518;
+const sal_uInt16 errNoValue = 519; // #VALUE!
+const sal_uInt16 errUnknownToken = 520;
+const sal_uInt16 errNoCode = 521; // #NULL!
+const sal_uInt16 errCircularReference = 522;
+const sal_uInt16 errNoConvergence = 523;
+const sal_uInt16 errNoRef = 524; // #REF!
+const sal_uInt16 errNoName = 525; // #NAME?
+const sal_uInt16 errDoubleRef = 526;
+const sal_uInt16 errInterpOverflow = 527;
// Not displayed, temporary for TrackFormulas,
// Cell depends on another cell that has errCircularReference
-const USHORT errTrackFromCircRef = 528;
+const sal_uInt16 errTrackFromCircRef = 528;
// ScInterpreter internal: no numeric value but numeric queried. If this is
// set as mnStringNoValueError no error is generated but 0 returned.
-const USHORT errCellNoValue = 529;
+const sal_uInt16 errCellNoValue = 529;
// Interpreter: needed AddIn not found
-const USHORT errNoAddin = 530;
+const sal_uInt16 errNoAddin = 530;
// Interpreter: needed Macro not found
-const USHORT errNoMacro = 531;
+const sal_uInt16 errNoMacro = 531;
// Interpreter: Division by zero
-const USHORT errDivisionByZero = 532; // #DIV/0!
+const sal_uInt16 errDivisionByZero = 532; // #DIV/0!
// Compiler: a non-simple (str,err,val) value was put in an array
-const USHORT errNestedArray = 533;
+const sal_uInt16 errNestedArray = 533;
// ScInterpreter internal: no numeric value but numeric queried. If this is
// temporarily (!) set as mnStringNoValueError, the error is generated and can
// be used to distinguish that condition from all other (inherited) errors. Do
// not use for anything else! Never push or inherit the error otherwise!
-const USHORT errNotNumericString = 534;
+const sal_uInt16 errNotNumericString = 534;
// Interpreter: NA() not available condition, not a real error
-const USHORT NOTAVAILABLE = 0x7fff;
+const sal_uInt16 NOTAVAILABLE = 0x7fff;
/** Unconditionally construct a double value of NAN where the lower bits
represent an interpreter error code. */
-inline double CreateDoubleError( USHORT nErr )
+inline double CreateDoubleError( sal_uInt16 nErr )
{
union
{
@@ -101,17 +101,17 @@ inline double CreateDoubleError( USHORT nErr )
/** Recreate the error code of a coded double error, if any. */
-inline USHORT GetDoubleErrorValue( double fVal )
+inline sal_uInt16 GetDoubleErrorValue( double fVal )
{
if ( ::rtl::math::isFinite( fVal ) )
return 0;
if ( ::rtl::math::isInf( fVal ) )
return errIllegalFPOperation; // normal INF
- UINT32 nErr = reinterpret_cast< sal_math_Double * >(
+ sal_uInt32 nErr = reinterpret_cast< sal_math_Double * >(
&fVal)->nan_parts.fraction_lo;
if ( nErr & 0xffff0000 )
return errNoValue; // just a normal NAN
- return (USHORT)(nErr & 0x0000ffff); // any other error
+ return (sal_uInt16)(nErr & 0x0000ffff); // any other error
}
} // namespace ScErrorCodes
diff --git a/formula/inc/formula/formdata.hxx b/formula/inc/formula/formdata.hxx
index 0db3492a9519..8be0bea12c87 100644
--- a/formula/inc/formula/formdata.hxx
+++ b/formula/inc/formula/formdata.hxx
@@ -43,27 +43,27 @@ public:
virtual void SaveValues();
void RestoreValues();
- BOOL HasParent() const { return pParent != NULL; }
+ sal_Bool HasParent() const { return pParent != NULL; }
- inline USHORT GetMode() const { return nMode; }
+ inline sal_uInt16 GetMode() const { return nMode; }
inline xub_StrLen GetFStart() const { return nFStart; }
- inline USHORT GetCatSel() const { return nCatSel; }
- inline USHORT GetFuncSel() const { return nFuncSel; }
- inline USHORT GetOffset() const { return nOffset; }
- inline USHORT GetEdFocus() const { return nEdFocus; }
+ inline sal_uInt16 GetCatSel() const { return nCatSel; }
+ inline sal_uInt16 GetFuncSel() const { return nFuncSel; }
+ inline sal_uInt16 GetOffset() const { return nOffset; }
+ inline sal_uInt16 GetEdFocus() const { return nEdFocus; }
inline const String& GetUndoStr() const { return aUndoStr; }
- inline BOOL GetMatrixFlag()const{ return bMatrix;}
+ inline sal_Bool GetMatrixFlag()const{ return bMatrix;}
inline rtl::OString GetUniqueId()const { return aUniqueId;}
inline const Selection& GetSelection()const { return aSelection;}
- inline void SetMode( USHORT nNew ) { nMode = nNew; }
+ inline void SetMode( sal_uInt16 nNew ) { nMode = nNew; }
inline void SetFStart( xub_StrLen nNew ) { nFStart = nNew; }
- inline void SetCatSel( USHORT nNew ) { nCatSel = nNew; }
- inline void SetFuncSel( USHORT nNew ) { nFuncSel = nNew; }
- inline void SetOffset( USHORT nNew ) { nOffset = nNew; }
- inline void SetEdFocus( USHORT nNew ) { nEdFocus = nNew; }
+ inline void SetCatSel( sal_uInt16 nNew ) { nCatSel = nNew; }
+ inline void SetFuncSel( sal_uInt16 nNew ) { nFuncSel = nNew; }
+ inline void SetOffset( sal_uInt16 nNew ) { nOffset = nNew; }
+ inline void SetEdFocus( sal_uInt16 nNew ) { nEdFocus = nNew; }
inline void SetUndoStr( const String& rNew ) { aUndoStr = rNew; }
- inline void SetMatrixFlag(BOOL bNew) { bMatrix=bNew;}
+ inline void SetMatrixFlag(sal_Bool bNew) { bMatrix=bNew;}
inline void SetUniqueId(const rtl::OString nNew) { aUniqueId=nNew;}
inline void SetSelection(const Selection& aSel) { aSelection=aSel;}
protected:
@@ -73,14 +73,14 @@ protected:
FormEditData* pParent; // fuer Verschachtelung
private:
- USHORT nMode; // enum ScFormulaDlgMode
+ sal_uInt16 nMode; // enum ScFormulaDlgMode
xub_StrLen nFStart;
- USHORT nCatSel;
- USHORT nFuncSel;
- USHORT nOffset;
- USHORT nEdFocus;
+ sal_uInt16 nCatSel;
+ sal_uInt16 nFuncSel;
+ sal_uInt16 nOffset;
+ sal_uInt16 nEdFocus;
String aUndoStr;
- BOOL bMatrix;
+ sal_Bool bMatrix;
rtl::OString aUniqueId;
Selection aSelection;
};
diff --git a/formula/inc/formula/formula.hxx b/formula/inc/formula/formula.hxx
index c12501f61103..700c9043a02d 100644
--- a/formula/inc/formula/formula.hxx
+++ b/formula/inc/formula/formula.hxx
@@ -79,22 +79,22 @@ protected:
virtual long PreNotify( NotifyEvent& rNEvt );
::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL );
void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL );
- void RefInputDoneAfter( BOOL bForced = FALSE );
+ void RefInputDoneAfter( sal_Bool bForced = sal_False );
rtl::OString FindFocusWin(Window *pWin);
void SetFocusWin(Window *pWin,const rtl::OString& nUniqueId);
void HighlightFunctionParas(const String& aFormula);
void SetMeText(const String& _sText);
- FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate);
+ FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate);
void Update();
- BOOL CheckMatrix(String& aFormula /*IN/OUT*/);
+ sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/);
String GetMeText() const;
void Update(const String& _sExp);
void CheckMatrix();
- void DoEnter(BOOL _bOk);
- BOOL isUserMatrix() const;
+ void DoEnter(sal_Bool _bOk);
+ sal_Bool isUserMatrix() const;
const IFunctionDescription* getCurrentFunctionDescription() const;
- BOOL UpdateParaWin(Selection& _rSelection);
+ sal_Bool UpdateParaWin(Selection& _rSelection);
void UpdateParaWin(const Selection& _rSelection,const String& _sRefStr);
RefEdit* GetActiveEdit();
void SetEdSelection();
@@ -128,22 +128,22 @@ protected:
virtual long PreNotify( NotifyEvent& rNEvt );
::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL );
void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL );
- void RefInputDoneAfter( BOOL bForced = FALSE );
+ void RefInputDoneAfter( sal_Bool bForced = sal_False );
rtl::OString FindFocusWin(Window *pWin);
void SetFocusWin(Window *pWin,const rtl::OString& nUniqueId);
void HighlightFunctionParas(const String& aFormula);
void SetMeText(const String& _sText);
- FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate);
+ FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate);
void Update();
- BOOL CheckMatrix(String& aFormula /*IN/OUT*/);
+ sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/);
String GetMeText() const;
void Update(const String& _sExp);
void CheckMatrix();
- void DoEnter(BOOL _bOk);
- BOOL isUserMatrix() const;
+ void DoEnter(sal_Bool _bOk);
+ sal_Bool isUserMatrix() const;
const IFunctionDescription* getCurrentFunctionDescription() const;
- BOOL UpdateParaWin(Selection& _rSelection);
+ sal_Bool UpdateParaWin(Selection& _rSelection);
void UpdateParaWin(const Selection& _rSelection,const String& _sRefStr);
RefEdit* GetActiveEdit();
void SetEdSelection();
diff --git a/formula/inc/formula/formulahelper.hxx b/formula/inc/formula/formulahelper.hxx
index 54cf27277681..e4eae7cf5de4 100644
--- a/formula/inc/formula/formulahelper.hxx
+++ b/formula/inc/formula/formulahelper.hxx
@@ -54,29 +54,29 @@ namespace formula
inline const CharClass* GetCharClass() const { return m_pCharClass; }
- BOOL GetNextFunc( const String& rFormula,
- BOOL bBack,
+ sal_Bool GetNextFunc( const String& rFormula,
+ sal_Bool bBack,
xub_StrLen& rFStart, // Ein- und Ausgabe
xub_StrLen* pFEnd = NULL,
const IFunctionDescription** ppFDesc = NULL,
::std::vector< ::rtl::OUString>* pArgs = NULL ) const;
xub_StrLen GetFunctionStart( const String& rFormula, xub_StrLen nStart,
- BOOL bBack, String* pFuncName = NULL ) const;
+ sal_Bool bBack, String* pFuncName = NULL ) const;
xub_StrLen GetFunctionEnd ( const String& rFormula, xub_StrLen nStart ) const;
xub_StrLen GetArgStart ( const String& rFormula, xub_StrLen nStart,
- USHORT nArg ) const;
+ sal_uInt16 nArg ) const;
void GetArgStrings ( ::std::vector< ::rtl::OUString >& _rArgs,
const String& rFormula,
xub_StrLen nFuncPos,
- USHORT nArgs ) const;
+ sal_uInt16 nArgs ) const;
void FillArgStrings ( const String& rFormula,
xub_StrLen nFuncPos,
- USHORT nArgs,
+ sal_uInt16 nArgs,
::std::vector< ::rtl::OUString >& _rArgs ) const;
};
// =============================================================================
diff --git a/formula/inc/formula/funcutl.hxx b/formula/inc/formula/funcutl.hxx
index 05c765af50bb..b29982cc2be5 100644
--- a/formula/inc/formula/funcutl.hxx
+++ b/formula/inc/formula/funcutl.hxx
@@ -44,7 +44,7 @@ class FORMULA_DLLPUBLIC RefEdit : public Edit
private:
Timer aTimer;
IControlReferenceHandler* pAnyRefDlg; // parent dialog
- BOOL bSilentFocus; // for SilentGrabFocus()
+ sal_Bool bSilentFocus; // for SilentGrabFocus()
DECL_LINK( UpdateHdl, Timer* );
diff --git a/formula/inc/formula/opcode.hxx b/formula/inc/formula/opcode.hxx
index 09c621df1ef1..0e70ffc01e44 100644
--- a/formula/inc/formula/opcode.hxx
+++ b/formula/inc/formula/opcode.hxx
@@ -400,7 +400,7 @@ enum OpCodeEnum
#ifndef DBG_UTIL
// save memory since compilers tend to int an enum
-typedef USHORT OpCode;
+typedef sal_uInt16 OpCode;
#else
// have enum names in debugger
typedef OpCodeEnum OpCode;
diff --git a/formula/inc/formula/token.hxx b/formula/inc/formula/token.hxx
index eafb2480af8e..30618c67381a 100644
--- a/formula/inc/formula/token.hxx
+++ b/formula/inc/formula/token.hxx
@@ -78,7 +78,7 @@ enum StackVarEnum
#ifndef DBG_UTIL
// save memory since compilers tend to int an enum
-typedef BYTE StackVar;
+typedef sal_uInt8 StackVar;
#else
// have enum names in debugger
typedef StackVarEnum StackVar;
@@ -99,7 +99,7 @@ class FORMULA_DLLPUBLIC FormulaToken : public IFormulaToken
protected:
const StackVar eType; // type of data
- mutable USHORT nRefCnt; // reference count
+ mutable sal_uInt16 nRefCnt; // reference count
public:
FormulaToken( StackVar eTypeP,OpCode e = ocPush ) :
@@ -111,16 +111,16 @@ public:
inline void Delete() { delete this; }
inline StackVar GetType() const { return eType; }
- BOOL IsFunction() const; // pure functions, no operators
- BOOL IsMatrixFunction() const; // if a function _always_ returns a Matrix
- BYTE GetParamCount() const;
+ sal_Bool IsFunction() const; // pure functions, no operators
+ sal_Bool IsMatrixFunction() const; // if a function _always_ returns a Matrix
+ sal_uInt8 GetParamCount() const;
inline void IncRef() const { nRefCnt++; }
inline void DecRef() const
{
if (!--nRefCnt)
const_cast<FormulaToken*>(this)->Delete();
}
- inline USHORT GetRef() const { return nRefCnt; }
+ inline sal_uInt16 GetRef() const { return nRefCnt; }
inline OpCode GetOpCode() const { return eOp; }
/**
@@ -138,26 +138,26 @@ public:
Any other non-overloaded method pops up an assertion.
*/
- virtual BYTE GetByte() const;
- virtual void SetByte( BYTE n );
+ virtual sal_uInt8 GetByte() const;
+ virtual void SetByte( sal_uInt8 n );
virtual bool HasForceArray() const;
virtual void SetForceArray( bool b );
virtual double GetDouble() const;
virtual double& GetDoubleAsReference();
virtual const String& GetString() const;
- virtual USHORT GetIndex() const;
- virtual void SetIndex( USHORT n );
+ virtual sal_uInt16 GetIndex() const;
+ virtual void SetIndex( sal_uInt16 n );
virtual short* GetJump() const;
virtual const String& GetExternal() const;
virtual FormulaToken* GetFAPOrigToken() const;
- virtual USHORT GetError() const;
- virtual void SetError( USHORT );
+ virtual sal_uInt16 GetError() const;
+ virtual void SetError( sal_uInt16 );
virtual FormulaToken* Clone() const { return new FormulaToken(*this); }
- virtual BOOL Is3DRef() const; // reference with 3D flag set
- virtual BOOL TextEqual( const formula::FormulaToken& rToken ) const;
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_Bool Is3DRef() const; // reference with 3D flag set
+ virtual sal_Bool TextEqual( const formula::FormulaToken& rToken ) const;
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
virtual bool isFunction() const
{
@@ -182,17 +182,17 @@ public:
class FORMULA_DLLPUBLIC FormulaByteToken : public FormulaToken
{
private:
- BYTE nByte;
+ sal_uInt8 nByte;
bool bHasForceArray;
protected:
- FormulaByteToken( OpCode e, BYTE n, StackVar v, bool b ) :
+ FormulaByteToken( OpCode e, sal_uInt8 n, StackVar v, bool b ) :
FormulaToken( v,e ), nByte( n ),
bHasForceArray( b ) {}
public:
- FormulaByteToken( OpCode e, BYTE n, bool b ) :
+ FormulaByteToken( OpCode e, sal_uInt8 n, bool b ) :
FormulaToken( svByte,e ), nByte( n ),
bHasForceArray( b ) {}
- FormulaByteToken( OpCode e, BYTE n ) :
+ FormulaByteToken( OpCode e, sal_uInt8 n ) :
FormulaToken( svByte,e ), nByte( n ),
bHasForceArray( false ) {}
FormulaByteToken( OpCode e ) :
@@ -203,11 +203,11 @@ public:
bHasForceArray( r.bHasForceArray ) {}
virtual FormulaToken* Clone() const { return new FormulaByteToken(*this); }
- virtual BYTE GetByte() const;
- virtual void SetByte( BYTE n );
+ virtual sal_uInt8 GetByte() const;
+ virtual void SetByte( sal_uInt8 n );
virtual bool HasForceArray() const;
virtual void SetForceArray( bool b );
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaByteToken )
};
@@ -220,7 +220,7 @@ class FORMULA_DLLPUBLIC FormulaFAPToken : public FormulaByteToken
private:
FormulaTokenRef pOrigToken;
public:
- FormulaFAPToken( OpCode e, BYTE n, FormulaToken* p ) :
+ FormulaFAPToken( OpCode e, sal_uInt8 n, FormulaToken* p ) :
FormulaByteToken( e, n, svFAP, false ),
pOrigToken( p ) {}
FormulaFAPToken( const FormulaFAPToken& r ) :
@@ -228,7 +228,7 @@ public:
virtual FormulaToken* Clone() const { return new FormulaFAPToken(*this); }
virtual FormulaToken* GetFAPOrigToken() const;
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
};
class FORMULA_DLLPUBLIC FormulaDoubleToken : public FormulaToken
@@ -244,7 +244,7 @@ public:
virtual FormulaToken* Clone() const { return new FormulaDoubleToken(*this); }
virtual double GetDouble() const;
virtual double& GetDoubleAsReference();
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaDoubleToken )
};
@@ -262,14 +262,14 @@ public:
virtual FormulaToken* Clone() const { return new FormulaStringToken(*this); }
virtual const String& GetString() const;
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaStringToken )
};
/** Identical to FormulaStringToken, but with explicit OpCode instead of implicit
- ocPush, and an optional BYTE for ocBad tokens. */
+ ocPush, and an optional sal_uInt8 for ocBad tokens. */
class FORMULA_DLLPUBLIC FormulaStringOpToken : public FormulaByteToken
{
private:
@@ -282,23 +282,23 @@ public:
virtual FormulaToken* Clone() const { return new FormulaStringOpToken(*this); }
virtual const String& GetString() const;
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
};
class FORMULA_DLLPUBLIC FormulaIndexToken : public FormulaToken
{
private:
- USHORT nIndex;
+ sal_uInt16 nIndex;
public:
- FormulaIndexToken( OpCode e, USHORT n ) :
+ FormulaIndexToken( OpCode e, sal_uInt16 n ) :
FormulaToken( svIndex, e ), nIndex( n ) {}
FormulaIndexToken( const FormulaIndexToken& r ) :
FormulaToken( r ), nIndex( r.nIndex ) {}
virtual FormulaToken* Clone() const { return new FormulaIndexToken(*this); }
- virtual USHORT GetIndex() const;
- virtual void SetIndex( USHORT n );
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_uInt16 GetIndex() const;
+ virtual void SetIndex( sal_uInt16 n );
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
};
@@ -306,9 +306,9 @@ class FORMULA_DLLPUBLIC FormulaExternalToken : public FormulaToken
{
private:
String aExternal;
- BYTE nByte;
+ sal_uInt8 nByte;
public:
- FormulaExternalToken( OpCode e, BYTE n, const String& r ) :
+ FormulaExternalToken( OpCode e, sal_uInt8 n, const String& r ) :
FormulaToken( svExternal, e ), aExternal( r ),
nByte( n ) {}
FormulaExternalToken( OpCode e, const String& r ) :
@@ -320,9 +320,9 @@ public:
virtual FormulaToken* Clone() const { return new FormulaExternalToken(*this); }
virtual const String& GetExternal() const;
- virtual BYTE GetByte() const;
- virtual void SetByte( BYTE n );
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_uInt8 GetByte() const;
+ virtual void SetByte( sal_uInt8 n );
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
};
@@ -337,7 +337,7 @@ public:
virtual FormulaToken* Clone() const { return new FormulaMissingToken(*this); }
virtual double GetDouble() const;
virtual const String& GetString() const;
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
};
class FORMULA_DLLPUBLIC FormulaJumpToken : public FormulaToken
@@ -359,7 +359,7 @@ public:
}
virtual ~FormulaJumpToken();
virtual short* GetJump() const;
- virtual BOOL operator==( const formula::FormulaToken& rToken ) const;
+ virtual sal_Bool operator==( const formula::FormulaToken& rToken ) const;
virtual FormulaToken* Clone() const { return new FormulaJumpToken(*this); }
};
@@ -373,23 +373,23 @@ public:
FormulaToken( r ) {}
virtual FormulaToken* Clone() const { return new FormulaUnknownToken(*this); }
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
};
class FORMULA_DLLPUBLIC FormulaErrorToken : public FormulaToken
{
- USHORT nError;
+ sal_uInt16 nError;
public:
- FormulaErrorToken( USHORT nErr ) :
+ FormulaErrorToken( sal_uInt16 nErr ) :
FormulaToken( svError ), nError( nErr) {}
FormulaErrorToken( const FormulaErrorToken& r ) :
FormulaToken( r ), nError( r.nError) {}
virtual FormulaToken* Clone() const { return new FormulaErrorToken(*this); }
- virtual USHORT GetError() const;
- virtual void SetError( USHORT nErr );
- virtual BOOL operator==( const FormulaToken& rToken ) const;
+ virtual sal_uInt16 GetError() const;
+ virtual void SetError( sal_uInt16 nErr );
+ virtual sal_Bool operator==( const FormulaToken& rToken ) const;
};
// =============================================================================
diff --git a/formula/inc/formula/tokenarray.hxx b/formula/inc/formula/tokenarray.hxx
index fc379fc4bb05..31d780c81a79 100644
--- a/formula/inc/formula/tokenarray.hxx
+++ b/formula/inc/formula/tokenarray.hxx
@@ -40,7 +40,7 @@ namespace formula
// RecalcMode access only via TokenArray SetRecalcMode / IsRecalcMode...
-typedef BYTE ScRecalcMode;
+typedef sal_uInt8 ScRecalcMode;
// Only one of the exclusive bits can be set,
// handled by TokenArray SetRecalcMode... methods
#define RECALCMODE_NORMAL 0x01 // exclusive
@@ -73,13 +73,13 @@ class FORMULA_DLLPUBLIC FormulaTokenArray
protected:
FormulaToken** pCode; // Token code array
FormulaToken** pRPN; // RPN array
- USHORT nLen; // Length of token array
- USHORT nRPN; // Length of RPN array
- USHORT nIndex; // Current step index
- USHORT nError; // Error code
+ sal_uInt16 nLen; // Length of token array
+ sal_uInt16 nRPN; // Length of RPN array
+ sal_uInt16 nIndex; // Current step index
+ sal_uInt16 nError; // Error code
short nRefs; // Count of cell references
ScRecalcMode nMode; // Flags to indicate when to recalc this code
- BOOL bHyperLink; // If HYPERLINK() occurs in the formula.
+ sal_Bool bHyperLink; // If HYPERLINK() occurs in the formula.
protected:
void Assign( const FormulaTokenArray& );
@@ -116,7 +116,7 @@ public:
FormulaToken* GetNextColRowName();
FormulaToken* GetNextOpCodeRPN( OpCode );
/// Peek at nIdx-1 if not out of bounds, decrements nIdx if successful. Returns NULL if not.
- FormulaToken* PeekPrev( USHORT & nIdx );
+ FormulaToken* PeekPrev( sal_uInt16 & nIdx );
FormulaToken* PeekNext();
FormulaToken* PeekPrevNoSpaces(); /// Only after Reset/First/Next/Last/Prev!
FormulaToken* PeekNextNoSpaces(); /// Only after Reset/First/Next/Last/Prev!
@@ -125,22 +125,22 @@ public:
FormulaToken* LastRPN() { nIndex = nRPN; return PrevRPN(); }
FormulaToken* PrevRPN();
- BOOL HasOpCode( OpCode ) const;
- BOOL HasOpCodeRPN( OpCode ) const;
+ sal_Bool HasOpCode( OpCode ) const;
+ sal_Bool HasOpCodeRPN( OpCode ) const;
/// Token of type svIndex or opcode ocColRowName
- BOOL HasNameOrColRowName() const;
+ sal_Bool HasNameOrColRowName() const;
FormulaToken** GetArray() const { return pCode; }
FormulaToken** GetCode() const { return pRPN; }
- USHORT GetLen() const { return nLen; }
- USHORT GetCodeLen() const { return nRPN; }
+ sal_uInt16 GetLen() const { return nLen; }
+ sal_uInt16 GetCodeLen() const { return nRPN; }
void Reset() { nIndex = 0; }
- USHORT GetCodeError() const { return nError; }
- void SetCodeError( USHORT n ) { nError = n; }
+ sal_uInt16 GetCodeError() const { return nError; }
+ void SetCodeError( sal_uInt16 n ) { nError = n; }
short GetRefs() const { return nRefs; }
void IncrementRefs() { ++nRefs; }
- void SetHyperLink( BOOL bVal ) { bHyperLink = bVal; }
- BOOL IsHyperLink() const { return bHyperLink; }
+ void SetHyperLink( sal_Bool bVal ) { bHyperLink = bVal; }
+ sal_Bool IsHyperLink() const { return bHyperLink; }
inline ScRecalcMode GetRecalcMode() const { return nMode; }
/** Bits aren't set directly but validated and
@@ -165,17 +165,17 @@ public:
{ nMode |= RECALCMODE_ONREFMOVE; }
inline void ClearRecalcModeOnRefMove()
{ nMode &= ~RECALCMODE_ONREFMOVE; }
- inline BOOL IsRecalcModeNormal() const
+ inline sal_Bool IsRecalcModeNormal() const
{ return (nMode & RECALCMODE_NORMAL) != 0; }
- inline BOOL IsRecalcModeAlways() const
+ inline sal_Bool IsRecalcModeAlways() const
{ return (nMode & RECALCMODE_ALWAYS) != 0; }
- inline BOOL IsRecalcModeOnLoad() const
+ inline sal_Bool IsRecalcModeOnLoad() const
{ return (nMode & RECALCMODE_ONLOAD) != 0; }
- inline BOOL IsRecalcModeOnLoadOnce() const
+ inline sal_Bool IsRecalcModeOnLoadOnce() const
{ return (nMode & RECALCMODE_ONLOAD_ONCE) != 0; }
- inline BOOL IsRecalcModeForced() const
+ inline sal_Bool IsRecalcModeForced() const
{ return (nMode & RECALCMODE_FORCED) != 0; }
- inline BOOL IsRecalcModeOnRefMove() const
+ inline sal_Bool IsRecalcModeOnRefMove() const
{ return (nMode & RECALCMODE_ONREFMOVE) != 0; }
/** Get OpCode of the most outer function */
@@ -183,7 +183,7 @@ public:
/** Operators +,-,*,/,^,&,=,<>,<,>,<=,>=
with DoubleRef in Formula? */
- BOOL HasMatrixDoubleRefOps();
+ sal_Bool HasMatrixDoubleRefOps();
virtual FormulaToken* AddOpCode(OpCode e);
@@ -204,7 +204,7 @@ public:
FormulaToken* AddString( const sal_Unicode* pStr );
FormulaToken* AddString( const String& rStr );
FormulaToken* AddDouble( double fVal );
- FormulaToken* AddName( USHORT n );
+ FormulaToken* AddName( sal_uInt16 n );
FormulaToken* AddExternal( const sal_Unicode* pStr );
/** Xcl import may play dirty tricks with OpCode!=ocExternal.
Others don't use! */