From 1cde703528c0dc53f29e51f68e17d84ae0ae66d9 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Fri, 14 Jan 2011 12:18:39 +0100 Subject: removetooltypes01: #i112600# remove tooltypes from formula --- formula/inc/formula/FormulaCompiler.hxx | 54 ++--- formula/inc/formula/IControlReferenceHandler.hxx | 2 +- formula/inc/formula/IFunctionDescription.hxx | 10 +- formula/inc/formula/errorcodes.hxx | 78 +++---- formula/inc/formula/formdata.hxx | 38 ++-- formula/inc/formula/formula.hxx | 24 +-- formula/inc/formula/formulahelper.hxx | 12 +- formula/inc/formula/funcutl.hxx | 2 +- formula/inc/formula/opcode.hxx | 2 +- formula/inc/formula/token.hxx | 92 ++++---- formula/inc/formula/tokenarray.hxx | 48 ++--- formula/source/core/api/FormulaCompiler.cxx | 176 +++++++-------- formula/source/core/api/token.cxx | 156 +++++++------- formula/source/ui/dlg/ControlHelper.hxx | 6 +- formula/source/ui/dlg/FormulaHelper.cxx | 52 ++--- formula/source/ui/dlg/formula.cxx | 260 +++++++++++------------ formula/source/ui/dlg/funcpage.cxx | 26 +-- formula/source/ui/dlg/funcpage.hxx | 14 +- formula/source/ui/dlg/funcutl.cxx | 38 ++-- formula/source/ui/dlg/parawin.cxx | 90 ++++---- formula/source/ui/dlg/parawin.hxx | 46 ++-- formula/source/ui/dlg/structpg.cxx | 24 +-- formula/source/ui/dlg/structpg.hxx | 10 +- formula/source/ui/inc/ModuleHelper.hxx | 2 +- 24 files changed, 631 insertions(+), 631 deletions(-) (limited to 'formula') diff --git a/formula/inc/formula/FormulaCompiler.hxx b/formula/inc/formula/FormulaCompiler.hxx index b67d78abd1..ef618e52a5 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), @@ -136,7 +136,7 @@ public: inline const String& getSymbol( const OpCode eOp ) const { DBG_ASSERT( USHORT(eOp) < mnSymbols, "OpCodeMap::getSymbol: OpCode out of range"); - if (USHORT(eOp) < mnSymbols) + 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 d6574cb5aa..eba12aecfe 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 9ecdff4263..b7dc841785 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& _rArguments) const = 0; + virtual void fillVisibleArgumentMapping(::std::vector& _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 1593f710b4..6d6bbba1b8 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 e9d9f06b37..ee7fcf8792 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 2f59807a34..c383ce6585 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 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 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 063b7b0cc0..18436f23dd 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 a659609600..a470afc421 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 53f387ae76..a54ae12504 100644 --- a/formula/inc/formula/opcode.hxx +++ b/formula/inc/formula/opcode.hxx @@ -396,7 +396,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 be1b2f6acd..9d5621c28e 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(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 54e8179c3f..7bcb7cbc2f 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! */ diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 51e2ca99f1..4a829104bb 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -132,7 +132,7 @@ short lcl_GetRetFormat( OpCode eOpCode ) return NUMBERFORMAT_NUMBER; } -inline void lclPushOpCodeMapEntry( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, USHORT nOpCode ) +inline void lclPushOpCodeMapEntry( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, sal_uInt16 nOpCode ) { sheet::FormulaOpCodeMapEntry aEntry; aEntry.Token.OpCode = nOpCode; @@ -140,15 +140,15 @@ inline void lclPushOpCodeMapEntry( ::std::vector< sheet::FormulaOpCodeMapEntry > rVec.push_back( aEntry); } -void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, USHORT nOpCodeBeg, USHORT nOpCodeEnd ) +void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, sal_uInt16 nOpCodeBeg, sal_uInt16 nOpCodeEnd ) { - for (USHORT nOpCode = nOpCodeBeg; nOpCode < nOpCodeEnd; ++nOpCode) + for (sal_uInt16 nOpCode = nOpCodeBeg; nOpCode < nOpCodeEnd; ++nOpCode) lclPushOpCodeMapEntry( rVec, pTable, nOpCode ); } -void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, const USHORT* pnOpCodes, size_t nCount ) +void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, const sal_uInt16* pnOpCodes, size_t nCount ) { - for (const USHORT* pnEnd = pnOpCodes + nCount; pnOpCodes < pnEnd; ++pnOpCodes) + for (const sal_uInt16* pnEnd = pnOpCodes + nCount; pnOpCodes < pnEnd; ++pnOpCodes) lclPushOpCodeMapEntry( rVec, pTable, *pnOpCodes ); } @@ -156,11 +156,11 @@ class OpCodeList : public Resource // temp object for resource { public: - OpCodeList( USHORT, FormulaCompiler::NonConstOpCodeMapPtr ); + OpCodeList( sal_uInt16, FormulaCompiler::NonConstOpCodeMapPtr ); private: - bool getOpCodeString( String& rStr, USHORT nOp ); - void putDefaultOpCode( FormulaCompiler::NonConstOpCodeMapPtr xMap, USHORT nOp ); + bool getOpCodeString( String& rStr, sal_uInt16 nOp ); + void putDefaultOpCode( FormulaCompiler::NonConstOpCodeMapPtr xMap, sal_uInt16 nOp ); private: enum SeparatorType @@ -171,11 +171,11 @@ private: SeparatorType meSepType; }; -OpCodeList::OpCodeList( USHORT nRID, FormulaCompiler::NonConstOpCodeMapPtr xMap ) : +OpCodeList::OpCodeList( sal_uInt16 nRID, FormulaCompiler::NonConstOpCodeMapPtr xMap ) : Resource( ResId(nRID,*ResourceManager::getResManager()) ) ,meSepType(SEMICOLON_BASE) { - for (USHORT i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; ++i) + for (sal_uInt16 i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; ++i) { String aOpStr; if ( getOpCodeString(aOpStr, i) ) @@ -187,7 +187,7 @@ OpCodeList::OpCodeList( USHORT nRID, FormulaCompiler::NonConstOpCodeMapPtr xMap FreeResource(); } -bool OpCodeList::getOpCodeString( String& rStr, USHORT nOp ) +bool OpCodeList::getOpCodeString( String& rStr, sal_uInt16 nOp ) { switch (nOp) { @@ -238,7 +238,7 @@ bool OpCodeList::getOpCodeString( String& rStr, USHORT nOp ) return false; } -void OpCodeList::putDefaultOpCode( FormulaCompiler::NonConstOpCodeMapPtr xMap, USHORT nOp ) +void OpCodeList::putDefaultOpCode( FormulaCompiler::NonConstOpCodeMapPtr xMap, sal_uInt16 nOp ) { ResId aRes(nOp,*ResourceManager::getResManager()); aRes.SetRT(RSC_STRING); @@ -301,7 +301,7 @@ uno::Sequence< sheet::FormulaToken > FormulaCompiler::OpCodeMap::createSequenceO // interest. } if (!aIntName.getLength()) - aIntName = _rCompiler.FindAddInFunction(*pName, !isEnglish()); // bLocalFirst=FALSE for english + aIntName = _rCompiler.FindAddInFunction(*pName, !isEnglish()); // bLocalFirst=sal_False for english if (!aIntName.getLength()) pToken->OpCode = getOpCodeUnknown(); else @@ -380,7 +380,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create // Anything else but SPECIAL. if ((nGroups & FormulaMapGroup::SEPARATORS) != 0) { - static const USHORT aOpCodes[] = { + static const sal_uInt16 aOpCodes[] = { SC_OPCODE_OPEN, SC_OPCODE_CLOSE, SC_OPCODE_SEP, @@ -389,7 +389,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create } if ((nGroups & FormulaMapGroup::ARRAY_SEPARATORS) != 0) { - static const USHORT aOpCodes[] = { + static const sal_uInt16 aOpCodes[] = { SC_OPCODE_ARRAY_OPEN, SC_OPCODE_ARRAY_CLOSE, SC_OPCODE_ARRAY_ROW_SEP, @@ -406,7 +406,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create if ((nGroups & FormulaMapGroup::BINARY_OPERATORS) == 0) lclPushOpCodeMapEntry( aVec, mpTable, ocAdd ); // regular unary operators - for (USHORT nOp = SC_OPCODE_START_UN_OP; nOp < SC_OPCODE_STOP_UN_OP && nOp < mnSymbols; ++nOp) + for (sal_uInt16 nOp = SC_OPCODE_START_UN_OP; nOp < SC_OPCODE_STOP_UN_OP && nOp < mnSymbols; ++nOp) { switch (nOp) { @@ -422,7 +422,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create } if ((nGroups & FormulaMapGroup::BINARY_OPERATORS) != 0) { - for (USHORT nOp = SC_OPCODE_START_BIN_OP; nOp < SC_OPCODE_STOP_BIN_OP && nOp < mnSymbols; ++nOp) + for (sal_uInt16 nOp = SC_OPCODE_START_BIN_OP; nOp < SC_OPCODE_STOP_BIN_OP && nOp < mnSymbols; ++nOp) { switch (nOp) { @@ -440,10 +440,10 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create { // Function names are not consecutive, skip the gaps between // functions with no parameter, functions with 1 parameter - lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_NO_PAR, ::std::min< USHORT >( SC_OPCODE_STOP_NO_PAR, mnSymbols ) ); - lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_1_PAR, ::std::min< USHORT >( SC_OPCODE_STOP_1_PAR, mnSymbols ) ); + lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_NO_PAR, ::std::min< sal_uInt16 >( SC_OPCODE_STOP_NO_PAR, mnSymbols ) ); + lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_1_PAR, ::std::min< sal_uInt16 >( SC_OPCODE_STOP_1_PAR, mnSymbols ) ); // Additional functions not within range of functions. - static const USHORT aOpCodes[] = { + static const sal_uInt16 aOpCodes[] = { SC_OPCODE_IF, SC_OPCODE_CHOSE, SC_OPCODE_AND, @@ -453,7 +453,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create }; lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, sizeof(aOpCodes)/sizeof(aOpCodes[0]) ); // functions with 2 or more parameters. - for (USHORT nOp = SC_OPCODE_START_2_PAR; nOp < SC_OPCODE_STOP_2_PAR && nOp < mnSymbols; ++nOp) + for (sal_uInt16 nOp = SC_OPCODE_START_2_PAR; nOp < SC_OPCODE_STOP_2_PAR && nOp < mnSymbols; ++nOp) { switch (nOp) { @@ -491,7 +491,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create void FormulaCompiler::OpCodeMap::putOpCode( const String & rStr, const OpCode eOp ) { DBG_ASSERT( 0 < eOp && USHORT(eOp) < mnSymbols, "OpCodeMap::putOpCode: OpCode out of range"); - if (0 < eOp && USHORT(eOp) < mnSymbols) + if (0 < eOp && sal_uInt16(eOp) < mnSymbols) { DBG_ASSERT( (mpTable[eOp].Len() == 0) || (mpTable[eOp] == rStr) || (eOp == ocCurrency), ByteString( "OpCodeMap::putOpCode: reusing OpCode "). @@ -513,10 +513,10 @@ FormulaCompiler::FormulaCompiler(FormulaTokenArray& _rArr) nRecursion(0), nNumFmt( NUMBERFORMAT_UNDEFINED ), meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ), - bAutoCorrect( FALSE ), - bCorrected( FALSE ), - bCompileForFAP( FALSE ), - bIgnoreErrors( FALSE ) + bAutoCorrect( sal_False ), + bCorrected( sal_False ), + bCompileForFAP( sal_False ), + bIgnoreErrors( sal_False ) { DBG_CTOR(FormulaCompiler,NULL); @@ -529,10 +529,10 @@ FormulaCompiler::FormulaCompiler() nRecursion(0), nNumFmt( NUMBERFORMAT_UNDEFINED ), meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ), - bAutoCorrect( FALSE ), - bCorrected( FALSE ), - bCompileForFAP( FALSE ), - bIgnoreErrors( FALSE ) + bAutoCorrect( sal_False ), + bCorrected( sal_False ), + bCompileForFAP( sal_False ), + bIgnoreErrors( sal_False ) { DBG_CTOR(FormulaCompiler,NULL); @@ -575,7 +575,7 @@ FormulaCompiler::OpCodeMapPtr FormulaCompiler::GetOpCodeMap( const sal_Int32 nLa } // ----------------------------------------------------------------------------- -String FormulaCompiler::FindAddInFunction( const String& /*rUpperName*/, BOOL /*bLocalFirst*/ ) const +String FormulaCompiler::FindAddInFunction( const String& /*rUpperName*/, sal_Bool /*bLocalFirst*/ ) const { return String(); } @@ -681,7 +681,7 @@ void FormulaCompiler::InitSymbolsODFF() const mxSymbolsODFF = s_sSymbol; } // ----------------------------------------------------------------------------- -void FormulaCompiler::loadSymbols(USHORT _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const +void FormulaCompiler::loadSymbols(sal_uInt16 _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const { if ( !_xMap.get() ) { @@ -721,7 +721,7 @@ OpCode FormulaCompiler::GetEnglishOpCode( const String& rName ) const } // Remove quotes, escaped quotes are unescaped. -BOOL FormulaCompiler::DeQuote( String& rStr ) +sal_Bool FormulaCompiler::DeQuote( String& rStr ) { xub_StrLen nLen = rStr.Len(); if ( nLen > 1 && rStr.GetChar(0) == '\'' && rStr.GetChar( nLen-1 ) == '\'' ) @@ -734,16 +734,16 @@ BOOL FormulaCompiler::DeQuote( String& rStr ) rStr.Erase( nPos, 1 ); ++nPos; } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------------- void FormulaCompiler::fillAddInToken(::std::vector< sheet::FormulaOpCodeMapEntry >& /*_rVec*/,bool /*_bIsEnglish*/) const { } // ----------------------------------------------------------------------------- -BOOL FormulaCompiler::IsMatrixFunction(OpCode _eOpCode) +sal_Bool FormulaCompiler::IsMatrixFunction(OpCode _eOpCode) { switch ( _eOpCode ) { @@ -757,13 +757,13 @@ BOOL FormulaCompiler::IsMatrixFunction(OpCode _eOpCode) case ocMatMult : case ocMatInv : case ocMatrixUnit : - return TRUE; + return sal_True; default: { // added to avoid warnings } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------------- @@ -781,7 +781,7 @@ sal_Int32 FormulaCompiler::OpCodeMap::getOpCodeUnknown() return kOpCodeUnknown; } // ----------------------------------------------------------------------------- -BOOL FormulaCompiler::GetToken() +sal_Bool FormulaCompiler::GetToken() { static const short nRecursionMax = 42; FormulaCompilerRecursionGuard aRecursionGuard( nRecursion ); @@ -789,16 +789,16 @@ BOOL FormulaCompiler::GetToken() { SetError( errStackOverflow ); pToken = new FormulaByteToken( ocStop ); - return FALSE; + return sal_False; } if ( bAutoCorrect && !pStack ) { // #61426# don't merge stacked subroutine code into entered formula aCorrectedFormula += aCorrectedSymbol; aCorrectedSymbol.Erase(); } - BOOL bStop = FALSE; + sal_Bool bStop = sal_False; if( pArr->GetCodeError() && !bIgnoreErrors ) - bStop = TRUE; + bStop = sal_True; else { short nWasColRowName; @@ -813,11 +813,11 @@ BOOL FormulaCompiler::GetToken() if ( nWasColRowName ) nWasColRowName++; if ( bAutoCorrect && !pStack ) - CreateStringFromToken( aCorrectedFormula, pToken, FALSE ); + CreateStringFromToken( aCorrectedFormula, pToken, sal_False ); pToken = pArr->Next(); } if ( bAutoCorrect && !pStack && pToken ) - CreateStringFromToken( aCorrectedSymbol, pToken, FALSE ); + CreateStringFromToken( aCorrectedSymbol, pToken, sal_False ); if( !pToken ) { if( pStack ) @@ -826,7 +826,7 @@ BOOL FormulaCompiler::GetToken() return GetToken(); } else - bStop = TRUE; + bStop = sal_True; } else { @@ -840,10 +840,10 @@ BOOL FormulaCompiler::GetToken() if( bStop ) { pToken = new FormulaByteToken( ocStop ); - return FALSE; + return sal_False; } if( pToken->GetOpCode() == ocSubTotal ) - glSubTotal = TRUE; + glSubTotal = sal_True; else if ( pToken->GetOpCode() == ocExternalRef ) { return HandleExternalReference(*pToken); @@ -868,7 +868,7 @@ BOOL FormulaCompiler::GetToken() { pArr->nRefs++; } - return TRUE; + return sal_True; } //--------------------------------------------------------------------------- // RPN creation by recursion @@ -900,7 +900,7 @@ void FormulaCompiler::Factor() if ( bAutoCorrect && !pStack ) { // assume multiplication aCorrectedFormula += mxSymbols->getSymbol(ocMul); - bCorrected = TRUE; + bCorrected = sal_True; NextToken(); eOp = Expression(); if( eOp != ocClose ) @@ -970,7 +970,7 @@ void FormulaCompiler::Factor() pArr->SetRecalcModeOnRefMove(); break; case ocHyperLink : - pArr->SetHyperLink(TRUE); + pArr->SetHyperLink(sal_True); break; default: ; // nothing @@ -1047,7 +1047,7 @@ void FormulaCompiler::Factor() } else SetError(errPairExpected); - BYTE nSepCount = 0; + sal_uInt8 nSepCount = 0; if( !bNoParam ) { nSepCount++; @@ -1135,7 +1135,7 @@ void FormulaCompiler::Factor() if ( bAutoCorrect && !pStack ) { aCorrectedSymbol.Erase(); - bCorrected = TRUE; + bCorrected = sal_True; } } else if ( eOp == ocExternalRef ) @@ -1154,7 +1154,7 @@ void FormulaCompiler::Factor() if ( nLen ) aCorrectedFormula.Erase( nLen - 1 ); aCorrectedSymbol.Erase(); - bCorrected = TRUE; + bCorrected = sal_True; } } } @@ -1343,7 +1343,7 @@ OpCode FormulaCompiler::Expression() return pToken->GetOpCode(); } // ----------------------------------------------------------------------------- -void FormulaCompiler::SetError(USHORT /*nError*/) +void FormulaCompiler::SetError(sal_uInt16 /*nError*/) { } // ----------------------------------------------------------------------------- @@ -1374,10 +1374,10 @@ bool FormulaCompiler::MergeRangeReference(FormulaToken * * const pCode1, Formula return true; } // ----------------------------------------------------------------------------- -BOOL FormulaCompiler::CompileTokenArray() +sal_Bool FormulaCompiler::CompileTokenArray() { - glSubTotal = FALSE; - bCorrected = FALSE; + glSubTotal = sal_False; + bCorrected = sal_False; if( !pArr->GetCodeError() || bIgnoreErrors ) { if ( bAutoCorrect ) @@ -1390,7 +1390,7 @@ BOOL FormulaCompiler::CompileTokenArray() pStack = NULL; FormulaToken* pData[ MAXCODE ]; pCode = pData; - BOOL bWasForced = pArr->IsRecalcModeForced(); + sal_Bool bWasForced = pArr->IsRecalcModeForced(); if ( bWasForced ) { if ( bAutoCorrect ) @@ -1406,7 +1406,7 @@ BOOL FormulaCompiler::CompileTokenArray() if (eOp != ocStop) SetError( errOperatorExpected); - USHORT nErrorBeforePop = pArr->GetCodeError(); + sal_uInt16 nErrorBeforePop = pArr->GetCodeError(); while( pStack ) PopTokenArray(); @@ -1424,7 +1424,7 @@ BOOL FormulaCompiler::CompileTokenArray() if( pArr->GetCodeError() && !bIgnoreErrors ) { pArr->DelRPN(); - pArr->SetHyperLink(FALSE); + pArr->SetHyperLink(sal_False); } if ( bWasForced ) @@ -1486,7 +1486,7 @@ void FormulaCompiler::CreateStringFromTokenArray( rtl::OUStringBuffer& rBuffer ) rBuffer.append(sal_Unicode('=')); FormulaToken* t = pArr->First(); while( t ) - t = CreateStringFromToken( rBuffer, t, TRUE ); + t = CreateStringFromToken( rBuffer, t, sal_True ); if (pSaveArr != pArr) { @@ -1495,7 +1495,7 @@ void FormulaCompiler::CreateStringFromTokenArray( rtl::OUStringBuffer& rBuffer ) } } // ----------------------------------------------------------------------------- -FormulaToken* FormulaCompiler::CreateStringFromToken( String& rFormula, FormulaToken* pTokenP,BOOL bAllowArrAdvance ) +FormulaToken* FormulaCompiler::CreateStringFromToken( String& rFormula, FormulaToken* pTokenP,sal_Bool bAllowArrAdvance ) { rtl::OUStringBuffer aBuffer; FormulaToken* p = CreateStringFromToken( aBuffer, pTokenP, bAllowArrAdvance ); @@ -1503,10 +1503,10 @@ FormulaToken* FormulaCompiler::CreateStringFromToken( String& rFormula, FormulaT return p; } -FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuffer, FormulaToken* pTokenP,BOOL bAllowArrAdvance ) +FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuffer, FormulaToken* pTokenP,sal_Bool bAllowArrAdvance ) { - BOOL bNext = TRUE; - BOOL bSpaces = FALSE; + sal_Bool bNext = sal_True; + sal_Bool bSpaces = sal_False; FormulaToken* t = pTokenP; OpCode eOp = t->GetOpCode(); if( eOp >= ocAnd && eOp <= ocOr ) @@ -1516,7 +1516,7 @@ FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuff t = pArr->Next(); else t = pArr->PeekNext(); - bNext = FALSE; + bNext = sal_False; bSpaces = ( !t || t->GetOpCode() != ocOpen ); } if( bSpaces ) @@ -1540,8 +1540,8 @@ FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuff else { // most times it's just one blank - BYTE n = t->GetByte(); - for ( BYTE j=0; jGetByte(); + for ( sal_uInt8 j=0; j= ocInternalBegin && eOp <= ocInternalEnd ) rBuffer.appendAscii( pInternal[ eOp - ocInternalBegin ] ); - else if( (USHORT) eOp < mxSymbols->getSymbolCount()) // Keyword: + else if( (sal_uInt16) eOp < mxSymbols->getSymbolCount()) // Keyword: rBuffer.append(mxSymbols->getSymbol(eOp)); else { @@ -1637,7 +1637,7 @@ void FormulaCompiler::AppendDouble( rtl::OUStringBuffer& rBuffer, double fVal ) { ::rtl::math::doubleToUStringBuffer( rBuffer, fVal, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', TRUE ); + rtl_math_DecimalPlaces_Max, '.', sal_True ); } else { @@ -1646,7 +1646,7 @@ void FormulaCompiler::AppendDouble( rtl::OUStringBuffer& rBuffer, double fVal ) rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, aSysLocale.GetLocaleDataPtr()->getNumDecimalSep().GetChar(0), - TRUE ); + sal_True ); } } // ----------------------------------------------------------------------------- @@ -1655,9 +1655,9 @@ void FormulaCompiler::AppendBoolean( rtl::OUStringBuffer& rBuffer, bool bVal ) rBuffer.append( mxSymbols->getSymbol(static_cast(bVal ? ocTrue : ocFalse)) ); } // ----------------------------------------------------------------------------- -BOOL FormulaCompiler::IsImportingXML() const +sal_Bool FormulaCompiler::IsImportingXML() const { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------------- void FormulaCompiler::AppendString( rtl::OUStringBuffer& rBuffer, const String & rStr ) @@ -1708,7 +1708,7 @@ OpCode FormulaCompiler::NextToken() if ( eOp == eLastOp || eLastOp == ocOpen ) { // throw away duplicated operator aCorrectedSymbol.Erase(); - bCorrected = TRUE; + bCorrected = sal_True; } else { @@ -1725,7 +1725,7 @@ OpCode FormulaCompiler::NextToken() aCorrectedFormula.SetChar( nPos, mxSymbols->getSymbol(ocGreater).GetChar(0) ); aCorrectedSymbol = c; - bCorrected = TRUE; + bCorrected = sal_True; } break; case ocLess: @@ -1734,14 +1734,14 @@ OpCode FormulaCompiler::NextToken() aCorrectedFormula.SetChar( nPos, mxSymbols->getSymbol(ocLess).GetChar(0) ); aCorrectedSymbol = c; - bCorrected = TRUE; + bCorrected = sal_True; } else if ( c == mxSymbols->getSymbol(ocGreater).GetChar(0) ) { // <> instead of >< aCorrectedFormula.SetChar( nPos, mxSymbols->getSymbol(ocLess).GetChar(0) ); aCorrectedSymbol = c; - bCorrected = TRUE; + bCorrected = sal_True; } break; case ocMul: @@ -1750,7 +1750,7 @@ OpCode FormulaCompiler::NextToken() aCorrectedFormula.SetChar( nPos, mxSymbols->getSymbol(ocMul).GetChar(0) ); aCorrectedSymbol = c; - bCorrected = TRUE; + bCorrected = sal_True; } break; case ocDiv: @@ -1759,7 +1759,7 @@ OpCode FormulaCompiler::NextToken() aCorrectedFormula.SetChar( nPos, mxSymbols->getSymbol(ocDiv).GetChar(0) ); aCorrectedSymbol = c; - bCorrected = TRUE; + bCorrected = sal_True; } break; default: @@ -1796,24 +1796,24 @@ void FormulaCompiler::PutCode( FormulaTokenRef& p ) } // ----------------------------------------------------------------------------- -BOOL FormulaCompiler::HandleExternalReference(const FormulaToken& /*_aToken*/) +sal_Bool FormulaCompiler::HandleExternalReference(const FormulaToken& /*_aToken*/) { - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL FormulaCompiler::HandleRange() +sal_Bool FormulaCompiler::HandleRange() { - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL FormulaCompiler::HandleSingleRef() +sal_Bool FormulaCompiler::HandleSingleRef() { - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL FormulaCompiler::HandleDbData() +sal_Bool FormulaCompiler::HandleDbData() { - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void FormulaCompiler::CreateStringFromSingleRef(rtl::OUStringBuffer& /*rBuffer*/,FormulaToken* /*pTokenP*/) @@ -1839,7 +1839,7 @@ void FormulaCompiler::CreateStringFromExternal(rtl::OUStringBuffer& /*rBuffer*/, void FormulaCompiler::LocalizeString( String& /*rName*/ ) { } -void FormulaCompiler::PushTokenArray( FormulaTokenArray* pa, BOOL bTemp ) +void FormulaCompiler::PushTokenArray( FormulaTokenArray* pa, sal_Bool bTemp ) { if ( bAutoCorrect && !pStack ) { // #61426# don't merge stacked subroutine code into entered formula diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index ccc740633c..7485714be5 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -62,19 +62,19 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ImpTokenIterator, 32, 16 ) // Align MemPools on 4k boundaries - 64 bytes (4k is a MUST for OS/2) // Need a lot of FormulaDoubleToken -const USHORT nMemPoolDoubleToken = (0x3000 - 64) / sizeof(FormulaDoubleToken); +const sal_uInt16 nMemPoolDoubleToken = (0x3000 - 64) / sizeof(FormulaDoubleToken); IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaDoubleToken, nMemPoolDoubleToken, nMemPoolDoubleToken ) // Need a lot of FormulaByteToken -const USHORT nMemPoolByteToken = (0x3000 - 64) / sizeof(FormulaByteToken); +const sal_uInt16 nMemPoolByteToken = (0x3000 - 64) / sizeof(FormulaByteToken); IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaByteToken, nMemPoolByteToken, nMemPoolByteToken ) // Need several FormulaStringToken -const USHORT nMemPoolStringToken = (0x1000 - 64) / sizeof(FormulaStringToken); +const sal_uInt16 nMemPoolStringToken = (0x1000 - 64) / sizeof(FormulaStringToken); IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaStringToken, nMemPoolStringToken, nMemPoolStringToken ) // --- helpers -------------------------------------------------------------- -inline BOOL lcl_IsReference( OpCode eOp, StackVar eType ) +inline sal_Bool lcl_IsReference( OpCode eOp, StackVar eType ) { return (eOp == ocPush && (eType == svSingleRef || eType == svDoubleRef)) @@ -89,12 +89,12 @@ FormulaToken::~FormulaToken() { } -BOOL FormulaToken::Is3DRef() const +sal_Bool FormulaToken::Is3DRef() const { - return FALSE; + return sal_False; } -BOOL FormulaToken::IsFunction() const +sal_Bool FormulaToken::IsFunction() const { // OpCode eOp = GetOpCode(); return (eOp != ocPush && eOp != ocBad && eOp != ocColRowName && @@ -113,14 +113,14 @@ BOOL FormulaToken::IsFunction() const } -BYTE FormulaToken::GetParamCount() const +sal_uInt8 FormulaToken::GetParamCount() const { // OpCode eOp = GetOpCode(); if ( eOp < SC_OPCODE_STOP_DIV && eOp != ocExternal && eOp != ocMacro && eOp != ocIf && eOp != ocChose && eOp != ocPercentSign ) return 0; // parameters and specials // ocIf and ocChose not for FAP, have cByte then -//2do: BOOL parameter whether FAP or not? +//2do: sal_Bool parameter whether FAP or not? else if ( GetByte() ) return GetByte(); // all functions, also ocExternal and ocMacro else if (SC_OPCODE_START_BIN_OP <= eOp && eOp < SC_OPCODE_STOP_BIN_OP) @@ -140,12 +140,12 @@ BYTE FormulaToken::GetParamCount() const } -BOOL FormulaToken::IsMatrixFunction() const +sal_Bool FormulaToken::IsMatrixFunction() const { return formula::FormulaCompiler::IsMatrixFunction(GetOpCode()); } -BOOL FormulaToken::operator==( const FormulaToken& rToken ) const +sal_Bool FormulaToken::operator==( const FormulaToken& rToken ) const { // don't compare reference count! return eType == rToken.eType && GetOpCode() == rToken.GetOpCode(); @@ -154,13 +154,13 @@ BOOL FormulaToken::operator==( const FormulaToken& rToken ) const // --- virtual dummy methods ------------------------------------------------- -BYTE FormulaToken::GetByte() const +sal_uInt8 FormulaToken::GetByte() const { // ok to be called for any derived class return 0; } -void FormulaToken::SetByte( BYTE ) +void FormulaToken::SetByte( sal_uInt8 ) { DBG_ERRORFILE( "FormulaToken::SetByte: virtual dummy called" ); } @@ -196,13 +196,13 @@ const String& FormulaToken::GetString() const return aDummyString; } -USHORT FormulaToken::GetIndex() const +sal_uInt16 FormulaToken::GetIndex() const { DBG_ERRORFILE( "FormulaToken::GetIndex: virtual dummy called" ); return 0; } -void FormulaToken::SetIndex( USHORT ) +void FormulaToken::SetIndex( sal_uInt16 ) { DBG_ERRORFILE( "FormulaToken::SetIndex: virtual dummy called" ); } @@ -227,17 +227,17 @@ FormulaToken* FormulaToken::GetFAPOrigToken() const return NULL; } -USHORT FormulaToken::GetError() const +sal_uInt16 FormulaToken::GetError() const { DBG_ERRORFILE( "FormulaToken::GetError: virtual dummy called" ); return 0; } -void FormulaToken::SetError( USHORT ) +void FormulaToken::SetError( sal_uInt16 ) { DBG_ERRORFILE( "FormulaToken::SetError: virtual dummy called" ); } -BOOL FormulaToken::TextEqual( const FormulaToken& rToken ) const +sal_Bool FormulaToken::TextEqual( const FormulaToken& rToken ) const { return *this == rToken; } @@ -246,11 +246,11 @@ BOOL FormulaToken::TextEqual( const FormulaToken& rToken ) const // -------------------------------------------------------------------------- -BYTE FormulaByteToken::GetByte() const { return nByte; } -void FormulaByteToken::SetByte( BYTE n ) { nByte = n; } +sal_uInt8 FormulaByteToken::GetByte() const { return nByte; } +void FormulaByteToken::SetByte( sal_uInt8 n ) { nByte = n; } bool FormulaByteToken::HasForceArray() const { return bHasForceArray; } void FormulaByteToken::SetForceArray( bool b ) { bHasForceArray = b; } -BOOL FormulaByteToken::operator==( const FormulaToken& r ) const +sal_Bool FormulaByteToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && nByte == r.GetByte() && bHasForceArray == r.HasForceArray(); @@ -258,12 +258,12 @@ BOOL FormulaByteToken::operator==( const FormulaToken& r ) const FormulaToken* FormulaFAPToken::GetFAPOrigToken() const { return pOrigToken; } -BOOL FormulaFAPToken::operator==( const FormulaToken& r ) const +sal_Bool FormulaFAPToken::operator==( const FormulaToken& r ) const { return FormulaByteToken::operator==( r ) && pOrigToken == r.GetFAPOrigToken(); } short* FormulaJumpToken::GetJump() const { return pJump; } -BOOL FormulaJumpToken::operator==( const FormulaToken& r ) const +sal_Bool FormulaJumpToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && pJump[0] == r.GetJump()[0] && memcmp( pJump+1, r.GetJump()+1, pJump[0] * sizeof(short) ) == 0; @@ -298,9 +298,9 @@ bool FormulaTokenArray::AddFormulaToken(const sheet::FormulaToken& _aToken,Exter // long is svIndex, used for name / database area, or "byte" for spaces sal_Int32 nValue = _aToken.Data.get(); if ( eOpCode == ocName || eOpCode == ocDBArea ) - AddToken( formula::FormulaIndexToken( eOpCode, static_cast(nValue) ) ); + AddToken( formula::FormulaIndexToken( eOpCode, static_cast(nValue) ) ); else if ( eOpCode == ocSpaces ) - AddToken( formula::FormulaByteToken( ocSpaces, static_cast(nValue) ) ); + AddToken( formula::FormulaByteToken( ocSpaces, static_cast(nValue) ) ); else bError = true; } @@ -493,7 +493,7 @@ void FormulaTokenArray::DelRPN() if( nRPN ) { FormulaToken** p = pRPN; - for( USHORT i = 0; i < nRPN; i++ ) + for( sal_uInt16 i = 0; i < nRPN; i++ ) { (*p++)->DecRef(); } @@ -503,7 +503,7 @@ void FormulaTokenArray::DelRPN() nRPN = nIndex = 0; } -FormulaToken* FormulaTokenArray::PeekPrev( USHORT & nIdx ) +FormulaToken* FormulaTokenArray::PeekPrev( sal_uInt16 & nIdx ) { if (0 < nIdx && nIdx <= nLen) return pCode[--nIdx]; @@ -522,7 +522,7 @@ FormulaToken* FormulaTokenArray::PeekNextNoSpaces() { if( pCode && nIndex < nLen ) { - USHORT j = nIndex; + sal_uInt16 j = nIndex; while ( pCode[j]->GetOpCode() == ocSpaces && j < nLen ) j++; if ( j < nLen ) @@ -538,7 +538,7 @@ FormulaToken* FormulaTokenArray::PeekPrevNoSpaces() { if( pCode && nIndex > 1 ) { - USHORT j = nIndex - 2; + sal_uInt16 j = nIndex - 2; while ( pCode[j]->GetOpCode() == ocSpaces && j > 0 ) j--; if ( j > 0 || pCode[j]->GetOpCode() != ocSpaces ) @@ -550,34 +550,34 @@ FormulaToken* FormulaTokenArray::PeekPrevNoSpaces() return NULL; } -BOOL FormulaTokenArray::HasOpCode( OpCode eOp ) const +sal_Bool FormulaTokenArray::HasOpCode( OpCode eOp ) const { - for ( USHORT j=0; j < nLen; j++ ) + for ( sal_uInt16 j=0; j < nLen; j++ ) { if ( pCode[j]->GetOpCode() == eOp ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL FormulaTokenArray::HasOpCodeRPN( OpCode eOp ) const +sal_Bool FormulaTokenArray::HasOpCodeRPN( OpCode eOp ) const { - for ( USHORT j=0; j < nRPN; j++ ) + for ( sal_uInt16 j=0; j < nRPN; j++ ) { if ( pRPN[j]->GetOpCode() == eOp ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL FormulaTokenArray::HasNameOrColRowName() const +sal_Bool FormulaTokenArray::HasNameOrColRowName() const { - for ( USHORT j=0; j < nLen; j++ ) + for ( sal_uInt16 j=0; j < nLen; j++ ) { if( pCode[j]->GetType() == svIndex || pCode[j]->GetOpCode() == ocColRowName ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } //////////////////////////////////////////////////////////////////////////// @@ -586,7 +586,7 @@ FormulaTokenArray::FormulaTokenArray() { pCode = NULL; pRPN = NULL; nError = nLen = nIndex = nRPN = nRefs = 0; - bHyperLink = FALSE; + bHyperLink = sal_False; ClearRecalcMode(); } @@ -616,14 +616,14 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r ) { pp = pCode = new FormulaToken*[ nLen ]; memcpy( pp, r.pCode, nLen * sizeof( FormulaToken* ) ); - for( USHORT i = 0; i < nLen; i++ ) + for( sal_uInt16 i = 0; i < nLen; i++ ) (*pp++)->IncRef(); } if( nRPN ) { pp = pRPN = new FormulaToken*[ nRPN ]; memcpy( pp, r.pRPN, nRPN * sizeof( FormulaToken* ) ); - for( USHORT i = 0; i < nRPN; i++ ) + for( sal_uInt16 i = 0; i < nRPN; i++ ) (*pp++)->IncRef(); } } @@ -649,7 +649,7 @@ FormulaTokenArray* FormulaTokenArray::Clone() const { pp = p->pCode = new FormulaToken*[ nLen ]; memcpy( pp, pCode, nLen * sizeof( FormulaToken* ) ); - for( USHORT i = 0; i < nLen; i++, pp++ ) + for( sal_uInt16 i = 0; i < nLen; i++, pp++ ) { *pp = (*pp)->Clone(); (*pp)->IncRef(); @@ -659,14 +659,14 @@ FormulaTokenArray* FormulaTokenArray::Clone() const { pp = p->pRPN = new FormulaToken*[ nRPN ]; memcpy( pp, pRPN, nRPN * sizeof( FormulaToken* ) ); - for( USHORT i = 0; i < nRPN; i++, pp++ ) + for( sal_uInt16 i = 0; i < nRPN; i++, pp++ ) { FormulaToken* t = *pp; if( t->GetRef() > 1 ) { FormulaToken** p2 = pCode; - USHORT nIdx = 0xFFFF; - for( USHORT j = 0; j < nLen; j++, p2++ ) + sal_uInt16 nIdx = 0xFFFF; + for( sal_uInt16 j = 0; j < nLen; j++, p2++ ) { if( *p2 == t ) { @@ -692,7 +692,7 @@ void FormulaTokenArray::Clear() if( pCode ) { FormulaToken** p = pCode; - for( USHORT i = 0; i < nLen; i++ ) + for( sal_uInt16 i = 0; i < nLen; i++ ) { (*p++)->DecRef(); } @@ -700,7 +700,7 @@ void FormulaTokenArray::Clear() } pCode = NULL; pRPN = NULL; nError = nLen = nIndex = nRPN = nRefs = 0; - bHyperLink = FALSE; + bHyperLink = sal_False; ClearRecalcMode(); } @@ -758,7 +758,7 @@ FormulaToken* FormulaTokenArray::AddDouble( double fVal ) return Add( new FormulaDoubleToken( fVal ) ); } -FormulaToken* FormulaTokenArray::AddName( USHORT n ) +FormulaToken* FormulaTokenArray::AddName( sal_uInt16 n ) { return Add( new FormulaIndexToken( ocName, n ) ); } @@ -802,7 +802,7 @@ void FormulaTokenArray::AddRecalcMode( ScRecalcMode nBits ) } -BOOL FormulaTokenArray::HasMatrixDoubleRefOps() +sal_Bool FormulaTokenArray::HasMatrixDoubleRefOps() { if ( pRPN && nRPN ) { @@ -811,11 +811,11 @@ BOOL FormulaTokenArray::HasMatrixDoubleRefOps() FormulaToken** pStack = new FormulaToken* [nRPN]; FormulaToken* pResult = new FormulaDoubleToken( 0.0 ); short sp = 0; - for ( USHORT j = 0; j < nRPN; j++ ) + for ( sal_uInt16 j = 0; j < nRPN; j++ ) { FormulaToken* t = pRPN[j]; OpCode eOp = t->GetOpCode(); - BYTE nParams = t->GetParamCount(); + sal_uInt8 nParams = t->GetParamCount(); switch ( eOp ) { case ocAdd : @@ -832,13 +832,13 @@ BOOL FormulaTokenArray::HasMatrixDoubleRefOps() case ocLessEqual : case ocGreaterEqual : { - for ( BYTE k = nParams; k; k-- ) + for ( sal_uInt8 k = nParams; k; k-- ) { if ( sp >= k && pStack[sp-k]->GetType() == svDoubleRef ) { pResult->Delete(); delete [] pStack; - return TRUE; + return sal_True; } } } @@ -870,7 +870,7 @@ BOOL FormulaTokenArray::HasMatrixDoubleRefOps() delete [] pStack; } - return FALSE; + return sal_False; } @@ -932,21 +932,21 @@ void FormulaMissingContext::AddMoreArgs( FormulaTokenArray *pNewArr, const Missi if (mnCurArg == 2) { pNewArr->AddOpCode( ocSep ); - pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=TRUE() + pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=sal_True() } break; case ocPoissonDist: if (mnCurArg == 1) { pNewArr->AddOpCode( ocSep ); - pNewArr->AddDouble( 1.0 ); // 3rd, Cumulative=TRUE() + pNewArr->AddDouble( 1.0 ); // 3rd, Cumulative=sal_True() } break; case ocNormDist: if ( mnCurArg == 2 ) { pNewArr->AddOpCode( ocSep ); - pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=TRUE() + pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=sal_True() } break; case ocLogNormDist: @@ -1086,7 +1086,7 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissingToPof( const MissingConvent FormulaMissingContext aCtx[ nAlloc ]; int aOpCodeAddressStack[ nAlloc ]; // use of ADDRESS() function const int nOmitAddressArg = 3; // ADDRESS() 4th parameter A1/R1C1 - USHORT nTokens = GetLen() + 1; + sal_uInt16 nTokens = GetLen() + 1; FormulaMissingContext* pCtx = (nAlloc < nTokens ? new FormulaMissingContext[nTokens] : &aCtx[0]); int* pOcas = (nAlloc < nTokens ? new int[nTokens] : &aOpCodeAddressStack[0]); // Never go below 0, never use 0, mpFunc always NULL. @@ -1168,7 +1168,7 @@ bool FormulaTokenArray::MayReferenceFollow() if ( pCode && nLen > 0 ) { // ignore trailing spaces - USHORT i = nLen - 1; + sal_uInt16 i = nLen - 1; while ( i > 0 && pCode[i]->GetOpCode() == SC_OPCODE_SPACES ) { --i; @@ -1209,7 +1209,7 @@ FormulaToken* FormulaTokenArray::AddOpCode( OpCode eOp ) } break; default: - pRet = new FormulaByteToken( eOp, 0, FALSE ); + pRet = new FormulaByteToken( eOp, 0, sal_False ); break; } return AddToken( *pRet ); @@ -1297,7 +1297,7 @@ void FormulaTokenIterator::Jump( short nStart, short nNext, short nStop ) bool FormulaTokenIterator::IsEndOfPath() const { - USHORT nTest = pCur->nPC + 1; + sal_uInt16 nTest = pCur->nPC + 1; if( nTest < pCur->pArr->nRPN && nTest < pCur->nStop ) { const FormulaToken* t = pCur->pArr->pRPN[ nTest ]; @@ -1313,44 +1313,44 @@ bool FormulaTokenIterator::IsEndOfPath() const double FormulaDoubleToken::GetDouble() const { return fDouble; } double & FormulaDoubleToken::GetDoubleAsReference() { return fDouble; } -BOOL FormulaDoubleToken::operator==( const FormulaToken& r ) const +sal_Bool FormulaDoubleToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && fDouble == r.GetDouble(); } const String& FormulaStringToken::GetString() const { return aString; } -BOOL FormulaStringToken::operator==( const FormulaToken& r ) const +sal_Bool FormulaStringToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && aString == r.GetString(); } const String& FormulaStringOpToken::GetString() const { return aString; } -BOOL FormulaStringOpToken::operator==( const FormulaToken& r ) const +sal_Bool FormulaStringOpToken::operator==( const FormulaToken& r ) const { return FormulaByteToken::operator==( r ) && aString == r.GetString(); } -USHORT FormulaIndexToken::GetIndex() const { return nIndex; } -void FormulaIndexToken::SetIndex( USHORT n ) { nIndex = n; } -BOOL FormulaIndexToken::operator==( const FormulaToken& r ) const +sal_uInt16 FormulaIndexToken::GetIndex() const { return nIndex; } +void FormulaIndexToken::SetIndex( sal_uInt16 n ) { nIndex = n; } +sal_Bool FormulaIndexToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && nIndex == r.GetIndex(); } const String& FormulaExternalToken::GetExternal() const { return aExternal; } -BYTE FormulaExternalToken::GetByte() const { return nByte; } -void FormulaExternalToken::SetByte( BYTE n ) { nByte = n; } -BOOL FormulaExternalToken::operator==( const FormulaToken& r ) const +sal_uInt8 FormulaExternalToken::GetByte() const { return nByte; } +void FormulaExternalToken::SetByte( sal_uInt8 n ) { nByte = n; } +sal_Bool FormulaExternalToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && nByte == r.GetByte() && aExternal == r.GetExternal(); } -USHORT FormulaErrorToken::GetError() const { return nError; } -void FormulaErrorToken::SetError( USHORT nErr ) { nError = nErr; } -BOOL FormulaErrorToken::operator==( const FormulaToken& r ) const +sal_uInt16 FormulaErrorToken::GetError() const { return nError; } +void FormulaErrorToken::SetError( sal_uInt16 nErr ) { nError = nErr; } +sal_Bool FormulaErrorToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ) && nError == static_cast< const FormulaErrorToken & >(r).GetError(); @@ -1361,13 +1361,13 @@ const String& FormulaMissingToken::GetString() const static String aDummyString; return aDummyString; } -BOOL FormulaMissingToken::operator==( const FormulaToken& r ) const +sal_Bool FormulaMissingToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ); } -BOOL FormulaUnknownToken::operator==( const FormulaToken& r ) const +sal_Bool FormulaUnknownToken::operator==( const FormulaToken& r ) const { return FormulaToken::operator==( r ); } diff --git a/formula/source/ui/dlg/ControlHelper.hxx b/formula/source/ui/dlg/ControlHelper.hxx index e0472000d1..6bca1d8208 100644 --- a/formula/source/ui/dlg/ControlHelper.hxx +++ b/formula/source/ui/dlg/ControlHelper.hxx @@ -58,7 +58,7 @@ private: MultiLineEdit* pMEdit; Link aSelChangedLink; Selection aOldSel; - BOOL bMouseFlag; + sal_Bool bMouseFlag; DECL_LINK( ChangedHdl, EditBox* ); protected: @@ -93,7 +93,7 @@ public: ArgEdit( Window* pParent, const ResId& rResId ); void Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit, - ScrollBar& rArgSlider, USHORT nArgCount ); + ScrollBar& rArgSlider, sal_uInt16 nArgCount ); protected: virtual void KeyInput( const KeyEvent& rKEvt ); @@ -102,7 +102,7 @@ private: ArgEdit* pEdPrev; ArgEdit* pEdNext; ScrollBar* pSlider; - USHORT nArgs; + sal_uInt16 nArgs; }; diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 5f5f2b8623..bd17ea6c45 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -47,7 +47,7 @@ namespace formula virtual ::rtl::OUString getDescription() const { return ::rtl::OUString(); } virtual xub_StrLen getSuppressedArgumentCount() const { return 0; } virtual ::rtl::OUString getFormula(const ::std::vector< ::rtl::OUString >& ) const { return ::rtl::OUString(); } - virtual void fillVisibleArgumentMapping(::std::vector& ) const {} + virtual void fillVisibleArgumentMapping(::std::vector& ) const {} virtual void initArgumentInfo() const {} virtual ::rtl::OUString getSignature() const { return ::rtl::OUString(); } virtual rtl::OString getHelpId() const { return ""; } @@ -74,14 +74,14 @@ FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager) { m_pCharClass = m_pSysLocale->GetCharClassPtr(); } -BOOL FormulaHelper::GetNextFunc( const String& rFormula, - BOOL bBack, +sal_Bool FormulaHelper::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 ) const // = NULL { - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; xub_StrLen nOldStart = rFStart; String aFname; @@ -114,7 +114,7 @@ BOOL FormulaHelper::GetNextFunc( const String& rFormula, } if ( *ppFDesc && pArgs ) { - GetArgStrings( *pArgs,rFormula, rFStart, static_cast((*ppFDesc)->getParameterCount() )); + GetArgStrings( *pArgs,rFormula, rFStart, static_cast((*ppFDesc)->getParameterCount() )); } else { @@ -133,13 +133,13 @@ BOOL FormulaHelper::GetNextFunc( const String& rFormula, void FormulaHelper::FillArgStrings( const String& rFormula, xub_StrLen nFuncPos, - USHORT nArgs, + sal_uInt16 nArgs, ::std::vector< ::rtl::OUString >& _rArgs ) const { xub_StrLen nStart = 0; xub_StrLen nEnd = 0; - USHORT i; - BOOL bLast = FALSE; + sal_uInt16 i; + sal_Bool bLast = sal_False; for ( i=0; i& _rArgs ,const String& rFormula, xub_StrLen nFuncPos, - USHORT nArgs ) const + sal_uInt16 nArgs ) const { if (nArgs) { @@ -184,10 +184,10 @@ void FormulaHelper::GetArgStrings( ::std::vector< ::rtl::OUString >& _rArgs //------------------------------------------------------------------------ -inline BOOL IsFormulaText( const CharClass* _pCharClass,const String& rStr, xub_StrLen nPos ) +inline sal_Bool IsFormulaText( const CharClass* _pCharClass,const String& rStr, xub_StrLen nPos ) { if( _pCharClass->isLetterNumeric( rStr, nPos ) ) - return TRUE; + return sal_True; else { // In internationalized versions function names may contain a dot // and in every version also an underscore... ;-) @@ -199,7 +199,7 @@ inline BOOL IsFormulaText( const CharClass* _pCharClass,const String& rStr, xub_ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, xub_StrLen nStart, - BOOL bBack, + sal_Bool bBack, String* pFuncName ) const { xub_StrLen nStrLen = rFormula.Len(); @@ -210,11 +210,11 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, xub_StrLen nFStart = FUNC_NOTFOUND; xub_StrLen nParPos = nStart; - BOOL bRepeat, bFound; + sal_Bool bRepeat, bFound; do { - bFound = FALSE; - bRepeat = FALSE; + bFound = sal_False; + bRepeat = sal_False; if ( bBack ) { @@ -228,7 +228,7 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, if (nParPos > 0) nParPos--; } - else if ( (bFound = ( rFormula.GetChar(nParPos) == '(' ) ) == FALSE ) + else if ( (bFound = ( rFormula.GetChar(nParPos) == '(' ) ) == sal_False ) nParPos--; } } @@ -243,7 +243,7 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, nParPos++; nParPos++; } - else if ( (bFound = ( rFormula.GetChar(nParPos) == '(' ) ) == FALSE ) + else if ( (bFound = ( rFormula.GetChar(nParPos) == '(' ) ) == sal_False ) nParPos++; } } @@ -268,13 +268,13 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, } else // Klammern ohne Funktion -> weitersuchen { - bRepeat = TRUE; + bRepeat = sal_True; if ( !bBack ) nParPos++; else if (nParPos > 0) nParPos--; else - bRepeat = FALSE; + bRepeat = sal_False; } } else // keine Klammern gefunden @@ -300,7 +300,7 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart short nParCount = 0; bool bInArray = false; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; while ( !bFound && (nStart < nStrLen) ) { @@ -318,10 +318,10 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart { nParCount--; if ( nParCount == 0 ) - bFound = TRUE; + bFound = sal_True; else if ( nParCount < 0 ) { - bFound = TRUE; + bFound = sal_True; nStart--; // einen zu weit gelesen } } @@ -337,7 +337,7 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart { if ( !bInArray && nParCount == 0 ) { - bFound = TRUE; + bFound = sal_True; nStart--; // einen zu weit gelesen } } @@ -349,7 +349,7 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart //------------------------------------------------------------------ -xub_StrLen FormulaHelper::GetArgStart( const String& rStr, xub_StrLen nStart, USHORT nArg ) const +xub_StrLen FormulaHelper::GetArgStart( const String& rStr, xub_StrLen nStart, sal_uInt16 nArg ) const { xub_StrLen nStrLen = rStr.Len(); @@ -358,7 +358,7 @@ xub_StrLen FormulaHelper::GetArgStart( const String& rStr, xub_StrLen nStart, US short nParCount = 0; bool bInArray = false; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; while ( !bFound && (nStart < nStrLen) ) { diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index eaca92a81d..ac3fb877f6 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -99,9 +99,9 @@ namespace formula ::std::pair RefInputStartBefore( RefEdit* pEdit, RefButton* pButton ); void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton ); - void RefInputDoneAfter( BOOL bForced ); - BOOL CalcValue( const String& rStrExp, String& rStrResult ); - BOOL CalcStruct( const String& rStrExp); + void RefInputDoneAfter( sal_Bool bForced ); + sal_Bool CalcValue( const String& rStrExp, String& rStrResult ); + sal_Bool CalcStruct( const String& rStrExp); void UpdateValues(); void DeleteArgs(); xub_StrLen GetFunctionPos(xub_StrLen nPos); @@ -111,32 +111,32 @@ namespace formula void fillTree(IStructHelper* _pTree); void UpdateTokenArray( const String& rStrExp); String RepairFormula(const String& aFormula); - void FillDialog(BOOL nFlag=TRUE); - void EditNextFunc( BOOL bForward, xub_StrLen nFStart=NOT_FOUND ); + void FillDialog(sal_Bool nFlag=sal_True); + void EditNextFunc( sal_Bool bForward, xub_StrLen nFStart=NOT_FOUND ); void EditThisFunc(xub_StrLen nFStart); void EditFuncParas(xub_StrLen nEditPos); - void UpdateArgInput( USHORT nOffset, USHORT nInput ); + void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 nInput ); void Update(); void Update(const String& _sExp); - void SaveArg( USHORT nEd ); + void SaveArg( sal_uInt16 nEd ); void UpdateSelection(); - void DoEnter( BOOL bOk ); + void DoEnter( sal_Bool bOk ); void UpdateFunctionDesc(); void ResizeArgArr( const IFunctionDescription* pNewFunc ); void FillListboxes(); - void FillControls(BOOL &rbNext, BOOL &rbPrev); + void FillControls(sal_Bool &rbNext, sal_Bool &rbPrev); - 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 SetMeText(const String& _sText); - BOOL CheckMatrix(String& aFormula /*IN/OUT*/); + sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/); void SetEdSelection(); - BOOL UpdateParaWin(Selection& _rSelection); + sal_Bool UpdateParaWin(Selection& _rSelection); void UpdateParaWin(const Selection& _rSelection,const String& _sRefStr); void SetData(xub_StrLen nFStart,xub_StrLen nNextFStart,xub_StrLen nNextFEnd,xub_StrLen& PrivStart,xub_StrLen& PrivEnd); @@ -214,9 +214,9 @@ namespace formula FuncPage* pFuncPage; StructPage* pStructPage; String aOldFormula; - BOOL bStructUpdate; + sal_Bool bStructUpdate; MultiLineEdit* pMEdit; - BOOL bUserMatrixFlag; + sal_Bool bUserMatrixFlag; Timer aTimer; const String aTitle1; @@ -231,15 +231,15 @@ namespace formula rtl::OString aOldHelp; rtl::OString aOldUnique; rtl::OString aActivWinId; - BOOL bIsShutDown; + sal_Bool bIsShutDown; Font aFntBold; Font aFntLight; - USHORT nEdFocus; + sal_uInt16 nEdFocus; // Selection theCurSel; - BOOL bEditFlag; + sal_Bool bEditFlag; const IFunctionDescription* pFuncDesc; xub_StrLen nArgs; ::std::vector< ::rtl::OUString > m_aArguments; @@ -292,7 +292,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent // pTheRefEdit (NULL), pMEdit (NULL), - bUserMatrixFlag (FALSE), + bUserMatrixFlag (sal_False), // aTitle1 ( ModuleRes( STR_TITLE1 ) ), // lokale Resource aTitle2 ( ModuleRes( STR_TITLE2 ) ), // lokale Resource @@ -300,7 +300,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aTxtOk ( aBtnEnd.GetText() ), m_aFormulaHelper(_pFunctionMgr), // - bIsShutDown (FALSE), + bIsShutDown (sal_False), nEdFocus (0), pFuncDesc (NULL), nArgs (0) @@ -316,8 +316,8 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent m_aEditHelpId = pMEdit->GetHelpId(); pMEdit->SetUniqueId( m_aEditHelpId ); - bEditFlag=FALSE; - bStructUpdate=TRUE; + bEditFlag=sal_False; + bStructUpdate=sal_True; Point aPos=aGEdit.GetPosPixel(); pParaWin->SetPosPixel(aPos); pParaWin->SetArgModifiedHdl(LINK( this, FormulaDlg_Impl, ModifyHdl ) ); @@ -356,7 +356,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aMEFormula.SetSelChangedHdl( LINK( this, FormulaDlg_Impl, FormulaCursorHdl ) ); aFntLight = aFtFormula.GetFont(); - aFntLight.SetTransparent( TRUE ); + aFntLight.SetTransparent( sal_True ); aFntBold = aFntLight; aFntBold.SetWeight( WEIGHT_BOLD ); @@ -375,7 +375,7 @@ FormulaDlg_Impl::~FormulaDlg_Impl() aTimer.SetTimeoutHdl(Link()); aTimer.Stop(); } // if(aTimer.IsActive()) - bIsShutDown=TRUE;// Setzen, damit PreNotify keinen GetFocus speichert. + bIsShutDown=sal_True;// Setzen, damit PreNotify keinen GetFocus speichert. FormEditData* pData = m_pHelper->getFormEditData(); if (pData) // wird nicht ueber Close zerstoert; { @@ -383,9 +383,9 @@ FormulaDlg_Impl::~FormulaDlg_Impl() pData->SetSelection(pMEdit->GetSelection()); if(aTabCtrl.GetCurPageId()==TP_FUNCTION) - pData->SetMode( (USHORT) FORMULA_FORMDLG_FORMULA ); + pData->SetMode( (sal_uInt16) FORMULA_FORMDLG_FORMULA ); else - pData->SetMode( (USHORT) FORMULA_FORMDLG_EDIT ); + pData->SetMode( (sal_uInt16) FORMULA_FORMDLG_EDIT ); pData->SetUndoStr(pMEdit->GetText()); pData->SetMatrixFlag(aBtnMatrix.IsChecked()); } @@ -401,7 +401,7 @@ FormulaDlg_Impl::~FormulaDlg_Impl() // ----------------------------------------------------------------------------- void FormulaDlg_Impl::PreNotify( NotifyEvent& rNEvt ) { - USHORT nSwitch=rNEvt.GetType(); + sal_uInt16 nSwitch=rNEvt.GetType(); if(nSwitch==EVENT_GETFOCUS && !bIsShutDown) { Window* pWin=rNEvt.GetWindow(); @@ -485,7 +485,7 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos) xub_StrLen nFuncPos=STRING_NOTFOUND; //@ Testweise xub_StrLen nPrevFuncPos=1; short nBracketCount=0; - BOOL bFlag=FALSE; + sal_Bool bFlag=sal_False; String aFormString = pMEdit->GetText(); m_aFormulaHelper.GetCharClass()->toUpper( aFormString ); @@ -543,12 +543,12 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos) if ( eOp == m_aSeparatorsOpCodes[TOKEN_OPEN].OpCode ) { nBracketCount++; - bFlag=TRUE; + bFlag=sal_True; } else if ( eOp == m_aSeparatorsOpCodes[TOKEN_CLOSE].OpCode ) { nBracketCount--; - bFlag=FALSE; + bFlag=sal_False; nFuncPos=nPrevFuncPos; } bool bIsFunction = ::std::find_if(m_aFunctionOpCodes.getConstArray(),m_pFunctionOpCodesEnd,::std::bind2nd(OpCodeCompare(),boost::cref(eOp))) != m_pFunctionOpCodesEnd; @@ -588,9 +588,9 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos) return nFuncPos; } // ----------------------------------------------------------------------------- -BOOL FormulaDlg_Impl::CalcValue( const String& rStrExp, String& rStrResult ) +sal_Bool FormulaDlg_Impl::CalcValue( const String& rStrExp, String& rStrResult ) { - BOOL bResult = TRUE; + sal_Bool bResult = sal_True; if ( rStrExp.Len() > 0 ) { @@ -601,7 +601,7 @@ BOOL FormulaDlg_Impl::CalcValue( const String& rStrExp, String& rStrResult ) bResult = m_pHelper->calculateValue(rStrExp,rStrResult); } else - bResult = FALSE; + bResult = sal_False; } return bResult; @@ -625,9 +625,9 @@ void FormulaDlg_Impl::UpdateValues() CalcStruct(pMEdit->GetText()); } -BOOL FormulaDlg_Impl::CalcStruct( const String& rStrExp) +sal_Bool FormulaDlg_Impl::CalcStruct( const String& rStrExp) { - BOOL bResult = TRUE; + sal_Bool bResult = sal_True; xub_StrLen nLength=rStrExp.Len(); if ( rStrExp.Len() > 0 && aOldFormula!=rStrExp && bStructUpdate) @@ -658,7 +658,7 @@ BOOL FormulaDlg_Impl::CalcStruct( const String& rStrExp) UpdateTokenArray(rStrExp); } else - bResult = FALSE; + bResult = sal_False; } return bResult; } @@ -766,13 +766,13 @@ void FormulaDlg_Impl::UpdateTokenArray( const String& rStrExp) } // if ( pTokens && nLen == m_aTokenList.getLength() ) FormulaCompiler aCompiler(*m_pTokenArray.get()); - aCompiler.SetCompileForFAP(TRUE); // #i101512# special handling is needed + aCompiler.SetCompileForFAP(sal_True); // #i101512# special handling is needed aCompiler.CompileTokenArray(); } -void FormulaDlg_Impl::FillDialog(BOOL nFlag) +void FormulaDlg_Impl::FillDialog(sal_Bool nFlag) { - BOOL bNext=TRUE, bPrev=TRUE; + sal_Bool bNext=sal_True, bPrev=sal_True; if(nFlag) FillControls(bNext, bPrev); FillListboxes(); @@ -803,9 +803,9 @@ void FormulaDlg_Impl::FillListboxes() if ( pFuncDesc && pFuncDesc->getCategory() ) { if( pFuncPage->GetCategory() != pFuncDesc->getCategory()->getNumber() + 1 ) - pFuncPage->SetCategory(static_cast(pFuncDesc->getCategory()->getNumber() + 1)); + pFuncPage->SetCategory(static_cast(pFuncDesc->getCategory()->getNumber() + 1)); - USHORT nPos=pFuncPage->GetFuncPos(pFuncDesc); + sal_uInt16 nPos=pFuncPage->GetFuncPos(pFuncDesc); pFuncPage->SetFunction(nPos); } @@ -819,7 +819,7 @@ void FormulaDlg_Impl::FillListboxes() // ResizeArgArr jetzt schon in UpdateFunctionDesc - m_pHelper->setDispatcherLock( TRUE);// Modal-Modus einschalten + m_pHelper->setDispatcherLock( sal_True);// Modal-Modus einschalten aNewTitle = aTitle1; @@ -828,7 +828,7 @@ void FormulaDlg_Impl::FillListboxes() m_pParent->SetUniqueId( aOldUnique ); } // ----------------------------------------------------------------------------- -void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) +void FormulaDlg_Impl::FillControls(sal_Bool &rbNext, sal_Bool &rbPrev) { // Umschalten zwischen den "Seiten" FormEditData* pData = m_pHelper->getFormEditData(); @@ -846,9 +846,9 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) aFormula.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " )" )); DeleteArgs(); const IFunctionDescription* pOldFuncDesc = pFuncDesc; - BOOL bTestFlag = FALSE; + sal_Bool bTestFlag = sal_False; - if ( m_aFormulaHelper.GetNextFunc( aFormula, FALSE, + if ( m_aFormulaHelper.GetNextFunc( aFormula, sal_False, nNextFStart, &nNextFEnd, &pFuncDesc, &m_aArguments ) ) { bTestFlag = (pOldFuncDesc != pFuncDesc); @@ -883,26 +883,26 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) pMEdit->SetSelection( Selection(PrivStart, PrivEnd)); nArgs = pFuncDesc->getSuppressedArgumentCount(); - USHORT nOffset = pData->GetOffset(); + sal_uInt16 nOffset = pData->GetOffset(); nEdFocus = pData->GetEdFocus(); // Verkettung der Edit's fuer Focus-Kontrolle if(bTestFlag) pParaWin->SetArgumentOffset(nOffset); - USHORT nActiv=0; + sal_uInt16 nActiv=0; xub_StrLen nArgPos= m_aFormulaHelper.GetArgStart( aFormula, nFStart, 0 ); xub_StrLen nEditPos=(xub_StrLen) pMEdit->GetSelection().Min(); - BOOL bFlag=FALSE; + sal_Bool bFlag=sal_False; - for(USHORT i=0;iSetArgument(i,m_aArguments[i]); if(nArgPos<=nEditPos && nEditPos( nArgPos + nLength ); } @@ -924,10 +924,10 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) // Test, ob vorne/hinten noch mehr Funktionen sind xub_StrLen nTempStart = m_aFormulaHelper.GetArgStart( aFormula, nFStart, 0 ); - rbNext = m_aFormulaHelper.GetNextFunc( aFormula, FALSE, nTempStart ); + rbNext = m_aFormulaHelper.GetNextFunc( aFormula, sal_False, nTempStart ); nTempStart=(xub_StrLen)pMEdit->GetSelection().Min(); pData->SetFStart(nTempStart); - rbPrev = m_aFormulaHelper.GetNextFunc( aFormula, TRUE, nTempStart ); + rbPrev = m_aFormulaHelper.GetNextFunc( aFormula, sal_True, nTempStart ); } // ----------------------------------------------------------------------------- @@ -945,7 +945,7 @@ void FormulaDlg_Impl::ClearAllParas() aFtEditName.Hide(); pParaWin->Hide(); - aBtnForward.Enable(TRUE); //@new + aBtnForward.Enable(sal_True); //@new aFtHeadLine.Show(); aFtFuncName.Show(); aFtFuncDesc.Show(); @@ -976,7 +976,7 @@ String FormulaDlg_Impl::RepairFormula(const String& aFormula) return aResult; } -void FormulaDlg_Impl::DoEnter(BOOL bOk) +void FormulaDlg_Impl::DoEnter(sal_Bool bOk) { // Eingabe ins Dokument uebernehmen oder abbrechen if ( bOk) @@ -1003,11 +1003,11 @@ IMPL_LINK( FormulaDlg_Impl, BtnHdl, PushButton*, pBtn ) { if ( pBtn == &aBtnCancel ) { - DoEnter(FALSE); // schliesst den Dialog + DoEnter(sal_False); // schliesst den Dialog } else if ( pBtn == &aBtnEnd ) { - DoEnter(TRUE); // schliesst den Dialog + DoEnter(sal_True); // schliesst den Dialog } else if ( pBtn == &aBtnForward ) { @@ -1015,19 +1015,19 @@ IMPL_LINK( FormulaDlg_Impl, BtnHdl, PushButton*, pBtn ) const IFunctionDescription* pDesc =pFuncPage->GetFuncDesc( pFuncPage->GetFunction() ); if(pDesc==pFuncDesc || !pFuncPage->IsVisible()) - EditNextFunc( TRUE ); + EditNextFunc( sal_True ); else { DblClkHdl(pFuncPage); //new - aBtnForward.Enable(FALSE); //new + aBtnForward.Enable(sal_False); //new } - //@EditNextFunc( TRUE ); + //@EditNextFunc( sal_True ); } else if ( pBtn == &aBtnBackward ) { - bEditFlag=FALSE; - aBtnForward.Enable(TRUE); - EditNextFunc( FALSE ); + bEditFlag=sal_False; + aBtnForward.Enable(sal_True); + EditNextFunc( sal_False ); aMEFormula.Invalidate(); aMEFormula.Update(); } @@ -1061,11 +1061,11 @@ void FormulaDlg_Impl::UpdateFunctionDesc() FormEditData* pData = m_pHelper->getFormEditData(); if (!pData) return; - USHORT nCat = pFuncPage->GetCategory(); + sal_uInt16 nCat = pFuncPage->GetCategory(); if ( nCat == LISTBOX_ENTRY_NOTFOUND ) nCat = 0; pData->SetCatSel( nCat ); - USHORT nFunc = pFuncPage->GetFunction(); + sal_uInt16 nFunc = pFuncPage->GetFunction(); if ( nFunc == LISTBOX_ENTRY_NOTFOUND ) nFunc = 0; pData->SetFuncSel( nFunc ); @@ -1104,7 +1104,7 @@ void FormulaDlg_Impl::UpdateFunctionDesc() IMPL_LINK( FormulaDlg_Impl, DblClkHdl, FuncPage*, EMPTYARG ) { - USHORT nFunc = pFuncPage->GetFunction(); + sal_uInt16 nFunc = pFuncPage->GetFunction(); // ex-UpdateLRUList const IFunctionDescription* pDesc = pFuncPage->GetFuncDesc(nFunc); @@ -1130,7 +1130,7 @@ IMPL_LINK( FormulaDlg_Impl, DblClkHdl, FuncPage*, EMPTYARG ) } pParaWin->SetEdFocus(0); - aBtnForward.Enable(FALSE); //@New + aBtnForward.Enable(sal_False); //@New return 0; } @@ -1184,11 +1184,11 @@ void FormulaDlg_Impl::EditThisFunc(xub_StrLen nFStart) xub_StrLen nNextFStart = nFStart; xub_StrLen nNextFEnd = 0; - BOOL bFound; + sal_Bool bFound; - //@bFound = m_pHelper->getNextFunction( aFormula, FALSE, nNextFStart, &nNextFEnd, &pFuncDesc ); + //@bFound = m_pHelper->getNextFunction( aFormula, sal_False, nNextFStart, &nNextFEnd, &pFuncDesc ); - bFound = m_aFormulaHelper.GetNextFunc( aFormula, FALSE, nNextFStart, &nNextFEnd); + bFound = m_aFormulaHelper.GetNextFunc( aFormula, sal_False, nNextFStart, &nNextFEnd); if ( bFound ) { xub_StrLen PrivStart, PrivEnd; @@ -1201,7 +1201,7 @@ void FormulaDlg_Impl::EditThisFunc(xub_StrLen nFStart) } } -void FormulaDlg_Impl::EditNextFunc( BOOL bForward, xub_StrLen nFStart ) +void FormulaDlg_Impl::EditNextFunc( sal_Bool bForward, xub_StrLen nFStart ) { FormEditData* pData = m_pHelper->getFormEditData(); if (!pData) @@ -1221,18 +1221,18 @@ void FormulaDlg_Impl::EditNextFunc( BOOL bForward, xub_StrLen nFStart ) xub_StrLen nNextFStart = 0; xub_StrLen nNextFEnd = 0; - BOOL bFound; + sal_Bool bFound; if ( bForward ) { nNextFStart = m_aFormulaHelper.GetArgStart( aFormula, nFStart, 0 ); - //@bFound = m_pHelper->getNextFunction( aFormula, FALSE, nNextFStart, &nNextFEnd, &pFuncDesc ); - bFound = m_aFormulaHelper.GetNextFunc( aFormula, FALSE, nNextFStart, &nNextFEnd); + //@bFound = m_pHelper->getNextFunction( aFormula, sal_False, nNextFStart, &nNextFEnd, &pFuncDesc ); + bFound = m_aFormulaHelper.GetNextFunc( aFormula, sal_False, nNextFStart, &nNextFEnd); } else { nNextFStart = nFStart; - //@bFound = m_pHelper->getNextFunction( aFormula, TRUE, nNextFStart, &nNextFEnd, &pFuncDesc ); - bFound = m_aFormulaHelper.GetNextFunc( aFormula, TRUE, nNextFStart, &nNextFEnd); + //@bFound = m_pHelper->getNextFunction( aFormula, sal_True, nNextFStart, &nNextFEnd, &pFuncDesc ); + bFound = m_aFormulaHelper.GetNextFunc( aFormula, sal_True, nNextFStart, &nNextFEnd); } if ( bFound ) @@ -1261,18 +1261,18 @@ void FormulaDlg_Impl::EditFuncParas(xub_StrLen nEditPos) m_aFormulaHelper.GetArgStrings(m_aArguments,aFormula, nFStart, nArgs ); // m_aArguments = ScFormulaUtil::GetArgStrings( aFormula, nFStart, nArgs ); - USHORT nActiv=pParaWin->GetSliderPos(); - BOOL bFlag=FALSE; + sal_uInt16 nActiv=pParaWin->GetSliderPos(); + sal_Bool bFlag=sal_False; ::std::vector< ::rtl::OUString >::iterator aIter = m_aArguments.begin(); ::std::vector< ::rtl::OUString >::iterator aEnd = m_aArguments.end(); - for(USHORT i=0;aIter != aEnd;i++,++aIter) + for(sal_uInt16 i=0;aIter != aEnd;i++,++aIter) { sal_Int32 nLength=(*aIter).getLength(); pParaWin->SetArgument(i,(*aIter)); if(nArgPos<=nEditPos && nEditPosGetArgument(nEd).Len()!=0) m_aArguments[nEd] = pParaWin->GetArgument(nEd); - USHORT nClearPos=nEd+1; + sal_uInt16 nClearPos=nEd+1; for(i=nEd+1;iGetArgument(i).Len()!=0) @@ -1321,14 +1321,14 @@ IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin*, pPtr ) { if(pPtr==pParaWin) { - aBtnForward.Enable(TRUE); //@ Damit eine neue Fkt eingegeben werden kann. + aBtnForward.Enable(sal_True); //@ Damit eine neue Fkt eingegeben werden kann. aTabCtrl.SetCurPageId(TP_FUNCTION); String aUndoStr = m_pHelper->getCurrentFormula(); // bevor unten ein ";" eingefuegt wird FormEditData* pData = m_pHelper->getFormEditData(); if (!pData) return 0; - USHORT nArgNo = pParaWin->GetActiveLine(); + sal_uInt16 nArgNo = pParaWin->GetActiveLine(); nEdFocus=nArgNo; SaveArg(nArgNo); @@ -1341,12 +1341,12 @@ IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin*, pPtr ) pData->SetEdFocus( nEdFocus ); pData->SaveValues(); - pData->SetMode( (USHORT) FORMULA_FORMDLG_FORMULA ); + pData->SetMode( (sal_uInt16) FORMULA_FORMDLG_FORMULA ); pData->SetFStart( n1 ); pData->SetUndoStr( aUndoStr ); ClearAllParas(); - FillDialog(FALSE); + FillDialog(sal_False); pFuncPage->SetFocus(); //Da Parawin nicht mehr sichtbar } return 0; @@ -1371,7 +1371,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaHdl, MultiLineEdit*, EMPTYARG ) FormEditData* pData = m_pHelper->getFormEditData(); if (!pData) return 0; - bEditFlag=TRUE; + bEditFlag=sal_True; String aInputFormula=m_pHelper->getCurrentFormula(); String aString=pMEdit->GetText(); @@ -1418,7 +1418,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaHdl, MultiLineEdit*, EMPTYARG ) if(nPossetSelection((xub_StrLen)aSel.Min(),(xub_StrLen)aSel.Max()); - bEditFlag=FALSE; + bEditFlag=sal_False; return 0; } @@ -1436,7 +1436,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaCursorHdl, EditBox*, EMPTYARG ) if (!pData) return 0; xub_StrLen nFStart = pData->GetFStart(); - bEditFlag=TRUE; + bEditFlag=sal_True; String aInputFormula=m_pHelper->getCurrentFormula(); String aString=pMEdit->GetText(); @@ -1479,7 +1479,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaCursorHdl, EditBox*, EMPTYARG ) } if(nCount==0) { - nFStart=m_aFormulaHelper.GetFunctionStart(aString,n,TRUE); + nFStart=m_aFormulaHelper.GetFunctionStart(aString,n,sal_True); EditThisFunc(nFStart); } else @@ -1495,7 +1495,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaCursorHdl, EditBox*, EMPTYARG ) } m_pHelper->setSelection((xub_StrLen)aSel.Min(),(xub_StrLen)aSel.Max()); - bEditFlag=FALSE; + bEditFlag=sal_False; return 0; } @@ -1514,16 +1514,16 @@ void FormulaDlg_Impl::UpdateSelection() String aFormula=pMEdit->GetText(); sal_Int32 nArgPos=m_aFormulaHelper.GetArgStart( aFormula,PrivStart,0); - USHORT nPos=pParaWin->GetActiveLine(); + sal_uInt16 nPos=pParaWin->GetActiveLine(); - for(USHORT i=0;isetSelection((USHORT)nArgPos,(USHORT)(nArgPos+nLength)); + m_pHelper->setSelection((sal_uInt16)nArgPos,(sal_uInt16)(nArgPos+nLength)); pMEdit->SetSelection(aSel); aMEFormula.UpdateOldSel(); } @@ -1569,7 +1569,7 @@ void FormulaDlg_Impl::RefInputStartAfter( RefEdit* /*pEdit*/, RefButton* /*pButt m_pParent->SetText( MnemonicGenerator::EraseAllMnemonicChars( aStr ) ); } } -void FormulaDlg_Impl::RefInputDoneAfter( BOOL bForced ) +void FormulaDlg_Impl::RefInputDoneAfter( sal_Bool bForced ) { aRefBtn.SetStartImage(); if( bForced || !aRefBtn.IsVisible() ) @@ -1584,7 +1584,7 @@ void FormulaDlg_Impl::RefInputDoneAfter( BOOL bForced ) if( pTheRefButton ) pTheRefButton->SetStartImage(); - USHORT nPrivActiv = pParaWin->GetActiveLine(); + sal_uInt16 nPrivActiv = pParaWin->GetActiveLine(); pParaWin->SetArgument( nPrivActiv, aEdRef.GetText() ); ModifyHdl( pParaWin ); pTheRefEdit = NULL; @@ -1617,7 +1617,7 @@ void FormulaDlg_Impl::Update(const String& _sExp) { CalcStruct(_sExp); FillDialog(); - //aBtnForward.Enable(TRUE); //@New + //aBtnForward.Enable(sal_True); //@New FuncSelHdl(NULL); } void FormulaDlg_Impl::SetMeText(const String& _sText) @@ -1627,7 +1627,7 @@ void FormulaDlg_Impl::SetMeText(const String& _sText) pMEdit->SetSelection( pData->GetSelection()); aMEFormula.UpdateOldSel(); } -FormulaDlgMode FormulaDlg_Impl::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate) +FormulaDlgMode FormulaDlg_Impl::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate) { FormulaDlgMode eMode = FORMULA_FORMDLG_FORMULA; if(!bEditFlag) @@ -1646,11 +1646,11 @@ FormulaDlgMode FormulaDlg_Impl::SetMeText(const String& _sText,xub_StrLen PrivSt } // if ( _bUpdate ) return eMode; } -BOOL FormulaDlg_Impl::CheckMatrix(String& aFormula) +sal_Bool FormulaDlg_Impl::CheckMatrix(String& aFormula) { pMEdit->GrabFocus(); xub_StrLen nLen = aFormula.Len(); - BOOL bMatrix = nLen > 3 // Matrix-Formel ? + sal_Bool bMatrix = nLen > 3 // Matrix-Formel ? && aFormula.GetChar(0) == '{' && aFormula.GetChar(1) == '=' && aFormula.GetChar(nLen-1) == '}'; @@ -1667,8 +1667,8 @@ BOOL FormulaDlg_Impl::CheckMatrix(String& aFormula) } IMPL_LINK( FormulaDlg_Impl, StructSelHdl, StructPage*, pStruP ) { - bStructUpdate=FALSE; - if(pStructPage->IsVisible()) aBtnForward.Enable(FALSE); //@New + bStructUpdate=sal_False; + if(pStructPage->IsVisible()) aBtnForward.Enable(sal_False); //@New if(pStructPage==pStruP) { @@ -1705,20 +1705,20 @@ IMPL_LINK( FormulaDlg_Impl, StructSelHdl, StructPage*, pStruP ) //} } - bStructUpdate=TRUE; + bStructUpdate=sal_True; return 0; } IMPL_LINK( FormulaDlg_Impl, MatrixHdl, CheckBox *, EMPTYARG ) { - bUserMatrixFlag=TRUE; + bUserMatrixFlag=sal_True; return 0; } IMPL_LINK( FormulaDlg_Impl, FuncSelHdl, FuncPage*, EMPTYARG ) { - USHORT nCat = pFuncPage->GetCategory(); + sal_uInt16 nCat = pFuncPage->GetCategory(); if ( nCat == LISTBOX_ENTRY_NOTFOUND ) nCat = 0; - USHORT nFunc = pFuncPage->GetFunction(); + sal_uInt16 nFunc = pFuncPage->GetFunction(); if ( nFunc == LISTBOX_ENTRY_NOTFOUND ) nFunc = 0; if ( (pFuncPage->GetFunctionEntryCount() > 0) @@ -1726,7 +1726,7 @@ IMPL_LINK( FormulaDlg_Impl, FuncSelHdl, FuncPage*, EMPTYARG ) { const IFunctionDescription* pDesc =pFuncPage->GetFuncDesc( pFuncPage->GetFunction() ); - if(pDesc!=pFuncDesc) aBtnForward.Enable(TRUE); //new + if(pDesc!=pFuncDesc) aBtnForward.Enable(sal_True); //new if (pDesc) { @@ -1757,7 +1757,7 @@ void FormulaDlg_Impl::UpdateParaWin(const Selection& _rSelection,const String& _ //------------------------------------- // Manuelles Update der Ergebnisfelder: //------------------------------------- - USHORT nPrivActiv = pParaWin->GetActiveLine(); + sal_uInt16 nPrivActiv = pParaWin->GetActiveLine(); pParaWin->SetArgument(nPrivActiv,aEdRef.GetText()); pParaWin->UpdateParas(); @@ -1765,11 +1765,11 @@ void FormulaDlg_Impl::UpdateParaWin(const Selection& _rSelection,const String& _ if( pEd != NULL ) pEd->SetSelection( theSel ); - pParaWin->SetRefMode(FALSE); + pParaWin->SetRefMode(sal_False); } -BOOL FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection) +sal_Bool FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection) { - pParaWin->SetRefMode(TRUE); + pParaWin->SetRefMode(sal_True); String aStrEd; Edit* pEd = GetCurrRefEdit(); @@ -1810,9 +1810,9 @@ rtl::OString FormulaDlg_Impl::FindFocusWin(Window *pWin) } else { - USHORT nCount=pWin->GetChildCount(); + sal_uInt16 nCount=pWin->GetChildCount(); - for(USHORT i=0;iGetChild(i); aUniqueId=FindFocusWin(pChild); @@ -1873,7 +1873,7 @@ void FormulaModalDialog::SetMeText(const String& _sText) } // ----------------------------------------------------------------------------- -FormulaDlgMode FormulaModalDialog::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate) +FormulaDlgMode FormulaModalDialog::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate) { return m_pImpl->SetMeText(_sText,PrivStart, PrivEnd,bMatrix,_bSelect,_bUpdate); } @@ -1883,7 +1883,7 @@ void FormulaModalDialog::CheckMatrix() m_pImpl->aBtnMatrix.Check(); } // ----------------------------------------------------------------------------- -BOOL FormulaModalDialog::CheckMatrix(String& aFormula) +sal_Bool FormulaModalDialog::CheckMatrix(String& aFormula) { return m_pImpl->CheckMatrix(aFormula); } @@ -1903,11 +1903,11 @@ const FormulaHelper& FormulaModalDialog::GetFormulaHelper() const return m_pImpl->GetFormulaHelper(); } // ----------------------------------------------------------------------------- -BOOL FormulaModalDialog::isUserMatrix() const +sal_Bool FormulaModalDialog::isUserMatrix() const { return m_pImpl->bUserMatrixFlag; } -void FormulaModalDialog::DoEnter(BOOL _bOk) +void FormulaModalDialog::DoEnter(sal_Bool _bOk) { m_pImpl->DoEnter(_bOk); } @@ -1919,7 +1919,7 @@ void FormulaModalDialog::RefInputStartAfter( RefEdit* pEdit, RefButton* pButton { m_pImpl->RefInputStartAfter( pEdit, pButton ); } -void FormulaModalDialog::RefInputDoneAfter( BOOL bForced ) +void FormulaModalDialog::RefInputDoneAfter( sal_Bool bForced ) { m_pImpl->RefInputDoneAfter( bForced ); } @@ -1937,9 +1937,9 @@ void FormulaModalDialog::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId) } else { - USHORT nCount=pWin->GetChildCount(); + sal_uInt16 nCount=pWin->GetChildCount(); - for(USHORT i=0;iGetChild(i); SetFocusWin(pChild,nUniqueId); @@ -1975,7 +1975,7 @@ void FormulaModalDialog::UpdateParaWin(const Selection& _rSelection,const String { m_pImpl->UpdateParaWin(_rSelection,_sRefStr); } -BOOL FormulaModalDialog::UpdateParaWin(Selection& _rSelection) +sal_Bool FormulaModalDialog::UpdateParaWin(Selection& _rSelection) { return m_pImpl->UpdateParaWin(_rSelection); } @@ -2029,7 +2029,7 @@ void FormulaDlg::SetMeText(const String& _sText) } // ----------------------------------------------------------------------------- -FormulaDlgMode FormulaDlg::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate) +FormulaDlgMode FormulaDlg::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate) { return m_pImpl->SetMeText(_sText,PrivStart, PrivEnd,bMatrix,_bSelect,_bUpdate); } @@ -2039,7 +2039,7 @@ void FormulaDlg::CheckMatrix() m_pImpl->aBtnMatrix.Check(); } // ----------------------------------------------------------------------------- -BOOL FormulaDlg::CheckMatrix(String& aFormula) +sal_Bool FormulaDlg::CheckMatrix(String& aFormula) { return m_pImpl->CheckMatrix(aFormula); } @@ -2058,11 +2058,11 @@ void FormulaDlg::Update() } // ----------------------------------------------------------------------------- -BOOL FormulaDlg::isUserMatrix() const +sal_Bool FormulaDlg::isUserMatrix() const { return m_pImpl->bUserMatrixFlag; } -void FormulaDlg::DoEnter(BOOL _bOk) +void FormulaDlg::DoEnter(sal_Bool _bOk) { m_pImpl->DoEnter(_bOk); } @@ -2074,7 +2074,7 @@ void FormulaDlg::RefInputStartAfter( RefEdit* pEdit, RefButton* pButton ) { m_pImpl->RefInputStartAfter( pEdit, pButton ); } -void FormulaDlg::RefInputDoneAfter( BOOL bForced ) +void FormulaDlg::RefInputDoneAfter( sal_Bool bForced ) { m_pImpl->RefInputDoneAfter( bForced ); } @@ -2092,9 +2092,9 @@ void FormulaDlg::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId) } else { - USHORT nCount=pWin->GetChildCount(); + sal_uInt16 nCount=pWin->GetChildCount(); - for(USHORT i=0;iGetChild(i); SetFocusWin(pChild,nUniqueId); @@ -2129,7 +2129,7 @@ void FormulaDlg::UpdateParaWin(const Selection& _rSelection,const String& _sRefS { m_pImpl->UpdateParaWin(_rSelection,_sRefStr); } -BOOL FormulaDlg::UpdateParaWin(Selection& _rSelection) +sal_Bool FormulaDlg::UpdateParaWin(Selection& _rSelection) { return m_pImpl->UpdateParaWin(_rSelection); } @@ -2180,7 +2180,7 @@ void FormEditData::Reset() nFuncSel = 0; nOffset = 0; nEdFocus = 0; - bMatrix =FALSE; + bMatrix =sal_False; aUniqueId=rtl::OString(); aSelection.Min()=0; aSelection.Max()=0; diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index cd06ea99ce..986fce1972 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -69,7 +69,7 @@ long FormulaListBox::PreNotify( NotifyEvent& rNEvt ) long nResult=ListBox::PreNotify(rNEvt); - USHORT nSwitch=aNotifyEvt.GetType(); + sal_uInt16 nSwitch=aNotifyEvt.GetType(); if(nSwitch==EVENT_KEYINPUT) { KeyInput(*aNotifyEvt.GetKeyEvent()); @@ -81,7 +81,7 @@ long FormulaListBox::PreNotify( NotifyEvent& rNEvt ) //============================================================================ -inline USHORT Lb2Cat( USHORT nLbPos ) +inline sal_uInt16 Lb2Cat( sal_uInt16 nLbPos ) { // Kategorie 0 == LRU, sonst Categories == LbPos-1 if ( nLbPos > 0 ) @@ -134,15 +134,15 @@ void FuncPage::impl_addFunctions(const IFunctionCategory* _pCategory) void FuncPage::UpdateFunctionList() { - USHORT nSelPos = aLbCategory.GetSelectEntryPos(); + sal_uInt16 nSelPos = aLbCategory.GetSelectEntryPos(); const IFunctionCategory* pCategory = static_cast(aLbCategory.GetEntryData(nSelPos)); - USHORT nCategory = ( LISTBOX_ENTRY_NOTFOUND != nSelPos ) + sal_uInt16 nCategory = ( LISTBOX_ENTRY_NOTFOUND != nSelPos ) ? Lb2Cat( nSelPos ) : 0; (void)nCategory; aLbFunction.Clear(); - aLbFunction.SetUpdateMode( FALSE ); + aLbFunction.SetUpdateMode( sal_False ); //------------------------------------------------------ if ( nSelPos > 0 ) @@ -177,7 +177,7 @@ void FuncPage::UpdateFunctionList() } //------------------------------------------------------ - aLbFunction.SetUpdateMode( TRUE ); + aLbFunction.SetUpdateMode( sal_True ); aLbFunction.SelectEntryPos(0); if(IsVisible()) SelHdl(&aLbFunction); @@ -210,16 +210,16 @@ IMPL_LINK( FuncPage, DblClkHdl, ListBox*, EMPTYARG ) return 0; } -void FuncPage::SetCategory(USHORT nCat) +void FuncPage::SetCategory(sal_uInt16 nCat) { aLbCategory.SelectEntryPos(nCat); UpdateFunctionList(); } -USHORT FuncPage::GetFuncPos(const IFunctionDescription* _pDesc) +sal_uInt16 FuncPage::GetFuncPos(const IFunctionDescription* _pDesc) { return aLbFunction.GetEntryPos(_pDesc); } -void FuncPage::SetFunction(USHORT nFunc) +void FuncPage::SetFunction(sal_uInt16 nFunc) { aLbFunction.SelectEntryPos(nFunc); } @@ -229,17 +229,17 @@ void FuncPage::SetFocus() aLbFunction.GrabFocus(); } -USHORT FuncPage::GetCategory() +sal_uInt16 FuncPage::GetCategory() { return aLbCategory.GetSelectEntryPos(); } -USHORT FuncPage::GetFunction() +sal_uInt16 FuncPage::GetFunction() { return aLbFunction.GetSelectEntryPos(); } -USHORT FuncPage::GetFunctionEntryCount() +sal_uInt16 FuncPage::GetFunctionEntryCount() { return aLbFunction.GetSelectEntryCount(); } @@ -248,7 +248,7 @@ String FuncPage::GetSelFunctionName() const { return aLbFunction.GetSelectEntry(); } -const IFunctionDescription* FuncPage::GetFuncDesc( USHORT nPos ) const +const IFunctionDescription* FuncPage::GetFuncDesc( sal_uInt16 nPos ) const { // nicht schoen, aber hoffentlich selten return (const IFunctionDescription*) aLbFunction.GetEntryData(nPos); diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx index 51e3609351..4e90a70dff 100644 --- a/formula/source/ui/dlg/funcpage.hxx +++ b/formula/source/ui/dlg/funcpage.hxx @@ -99,15 +99,15 @@ public: FuncPage( Window* pParent,const IFunctionManager* _pFunctionManager); - void SetCategory(USHORT nCat); - void SetFunction(USHORT nFunc); + void SetCategory(sal_uInt16 nCat); + void SetFunction(sal_uInt16 nFunc); void SetFocus(); - USHORT GetCategory(); - USHORT GetFunction(); - USHORT GetFunctionEntryCount(); + sal_uInt16 GetCategory(); + sal_uInt16 GetFunction(); + sal_uInt16 GetFunctionEntryCount(); - USHORT GetFuncPos(const IFunctionDescription* _pDesc); - const IFunctionDescription* GetFuncDesc( USHORT nPos ) const; + sal_uInt16 GetFuncPos(const IFunctionDescription* _pDesc); + const IFunctionDescription* GetFuncDesc( sal_uInt16 nPos ) const; String GetSelFunctionName() const; void SetDoubleClickHdl( const Link& rLink ) { aDoubleClickLink = rLink; } diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx index d41a051e47..828874c17e 100644 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -49,7 +49,7 @@ namespace formula ValWnd::ValWnd( Window* pParent, const ResId& rId ) : Window( pParent, rId ) { Font aFnt( GetFont() ); - aFnt.SetTransparent( TRUE ); + aFnt.SetTransparent( sal_True ); aFnt.SetWeight( WEIGHT_LIGHT ); if ( pParent->IsBackground() ) { @@ -110,7 +110,7 @@ ArgEdit::ArgEdit( Window* pParent, const ResId& rResId ) //---------------------------------------------------------------------------- void ArgEdit::Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit, - ScrollBar& rArgSlider, USHORT nArgCount ) + ScrollBar& rArgSlider, sal_uInt16 nArgCount ) { pEdPrev = pPrevEdit; pEdNext = pNextEdit; @@ -125,8 +125,8 @@ void ArgEdit::Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit, void __EXPORT ArgEdit::KeyInput( const KeyEvent& rKEvt ) { KeyCode aCode = rKEvt.GetKeyCode(); - BOOL bUp = (aCode.GetCode() == KEY_UP); - BOOL bDown = (aCode.GetCode() == KEY_DOWN); + sal_Bool bUp = (aCode.GetCode() == KEY_UP); + sal_Bool bDown = (aCode.GetCode() == KEY_DOWN); ArgEdit* pEd = NULL; if ( pSlider @@ -136,8 +136,8 @@ void __EXPORT ArgEdit::KeyInput( const KeyEvent& rKEvt ) if ( nArgs > 1 ) { long nThumb = pSlider->GetThumbPos(); - BOOL bDoScroll = FALSE; - BOOL bChangeFocus = FALSE; + sal_Bool bDoScroll = sal_False; + sal_Bool bChangeFocus = sal_False; if ( bDown ) { @@ -151,13 +151,13 @@ void __EXPORT ArgEdit::KeyInput( const KeyEvent& rKEvt ) else { pEd = pEdNext; - bChangeFocus = TRUE; + bChangeFocus = sal_True; } } else if ( pEdNext ) { pEd = pEdNext; - bChangeFocus = TRUE; + bChangeFocus = sal_True; } } else // if ( bUp ) @@ -172,13 +172,13 @@ void __EXPORT ArgEdit::KeyInput( const KeyEvent& rKEvt ) else { pEd = pEdPrev; - bChangeFocus = TRUE; + bChangeFocus = sal_True; } } else if ( pEdPrev ) { pEd = pEdPrev; - bChangeFocus = TRUE; + bChangeFocus = sal_True; } } @@ -743,7 +743,7 @@ EditBox::EditBox( Window* pParent,WinBits nWinStyle) #************************************************************************/ EditBox::EditBox( Window* pParent, const ResId& rResId ) :Control(pParent,rResId), - bMouseFlag(FALSE) + bMouseFlag(sal_False) { WinBits nStyle=GetStyle(); SetStyle( nStyle| WB_DIALOGCONTROL); @@ -849,15 +849,15 @@ void EditBox::GetFocus() #************************************************************************/ long EditBox::PreNotify( NotifyEvent& rNEvt ) { - long nResult=TRUE; + long nResult=sal_True; if(pMEdit==NULL) return nResult; - USHORT nSwitch=rNEvt.GetType(); + sal_uInt16 nSwitch=rNEvt.GetType(); if(nSwitch==EVENT_KEYINPUT)// || nSwitch==EVENT_KEYUP) { const KeyCode& aKeyCode=rNEvt.GetKeyEvent()->GetKeyCode(); - USHORT nKey=aKeyCode.GetCode(); + sal_uInt16 nKey=aKeyCode.GetCode(); if( (nKey==KEY_RETURN && !aKeyCode.IsShift()) || nKey==KEY_TAB ) { nResult=GetParent()->Notify(rNEvt); @@ -875,7 +875,7 @@ long EditBox::PreNotify( NotifyEvent& rNEvt ) if(nSwitch==EVENT_MOUSEBUTTONDOWN || nSwitch==EVENT_MOUSEBUTTONUP) { - bMouseFlag=TRUE; + bMouseFlag=sal_True; Application::PostUserEvent( LINK( this, EditBox, ChangedHdl ) ); } } @@ -930,7 +930,7 @@ void EditBox::UpdateOldSel() RefEdit::RefEdit( Window* _pParent,IControlReferenceHandler* pParent, const ResId& rResId ) : Edit( _pParent, rResId ), pAnyRefDlg( pParent ), - bSilentFocus( FALSE ) + bSilentFocus( sal_False ) { aTimer.SetTimeoutHdl( LINK( this, RefEdit, UpdateHdl ) ); aTimer.SetTimeout( SC_ENABLE_TIME ); @@ -939,7 +939,7 @@ RefEdit::RefEdit( Window* _pParent,IControlReferenceHandler* pParent, const ResI RefEdit::RefEdit( Window* pParent, const ResId& rResId ) : Edit( pParent, rResId ), pAnyRefDlg( NULL ), - bSilentFocus( FALSE ) + bSilentFocus( sal_False ) { } @@ -967,9 +967,9 @@ void RefEdit::StartUpdateData() void RefEdit::SilentGrabFocus() { - bSilentFocus = TRUE; + bSilentFocus = sal_True; GrabFocus(); - bSilentFocus = FALSE; + bSilentFocus = sal_False; } void RefEdit::SetRefDialog( IControlReferenceHandler* pDlg ) diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index adb3681345..5ca04eb5a7 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -79,7 +79,7 @@ ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos): aSlider ( this, ModuleRes( WND_SLIDER ) ), m_sOptional ( ModuleRes( STR_OPTIONAL ) ), m_sRequired ( ModuleRes( STR_REQUIRED ) ), - bRefMode (FALSE) + bRefMode (sal_False) { Image aFxHC( ModuleRes( IMG_FX_H ) ); FreeResource(); @@ -106,13 +106,13 @@ ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos): ClearAll(); } -void ParaWin::UpdateArgDesc( USHORT nArg ) +void ParaWin::UpdateArgDesc( sal_uInt16 nArg ) { if (nArg==NOT_FOUND) return; if ( nArgs > 4 ) - nArg = sal::static_int_cast( nArg + GetSliderPos() ); - //@ nArg += (USHORT)aSlider.GetThumbPos(); + nArg = sal::static_int_cast( nArg + GetSliderPos() ); + //@ nArg += (sal_uInt16)aSlider.GetThumbPos(); if ( (nArgs > 0) && (nArggetParameterDescription(nRealArg); aArgName = pFuncDesc->getParameterName(nRealArg); aArgName += ' '; @@ -132,9 +132,9 @@ void ParaWin::UpdateArgDesc( USHORT nArg ) } else { - USHORT nFix = nArgs - VAR_ARGS; - USHORT nPos = ( nArg < nFix ? nArg : nFix ); - USHORT nRealArg = (nPos < aVisibleArgMapping.size() ? + sal_uInt16 nFix = nArgs - VAR_ARGS; + sal_uInt16 nPos = ( nArg < nFix ? nArg : nFix ); + sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ? aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); aArgDesc = pFuncDesc->getParameterDescription(nRealArg); aArgName = pFuncDesc->getParameterName(nRealArg); @@ -150,14 +150,14 @@ void ParaWin::UpdateArgDesc( USHORT nArg ) } } -void ParaWin::UpdateArgInput( USHORT nOffset, USHORT i ) +void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ) { - USHORT nArg = nOffset + i; + sal_uInt16 nArg = nOffset + i; if ( nArgs < VAR_ARGS) { if(nArgisParameterOptional(nRealArg)) ? aFntLight : aFntBold ); SetArgName (i,pFuncDesc->getParameterName(nRealArg)); @@ -165,9 +165,9 @@ void ParaWin::UpdateArgInput( USHORT nOffset, USHORT i ) } else { - USHORT nFix = nArgs - VAR_ARGS; - USHORT nPos = ( nArg < nFix ? nArg : nFix ); - USHORT nRealArg = (nPos < aVisibleArgMapping.size() ? + sal_uInt16 nFix = nArgs - VAR_ARGS; + sal_uInt16 nPos = ( nArg < nFix ? nArg : nFix ); + sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ? aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); SetArgNameFont( i, (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? @@ -197,12 +197,12 @@ ParaWin::~ParaWin() aBtnFx4.SetGetFocusHdl( aEmptyLink ); } -USHORT ParaWin::GetActiveLine() +sal_uInt16 ParaWin::GetActiveLine() { return nActiveLine; } -void ParaWin::SetActiveLine(USHORT no) +void ParaWin::SetActiveLine(sal_uInt16 no) { if(no3) { nOffset+=nNewEdPos; - SetSliderPos((USHORT) nOffset); + SetSliderPos((sal_uInt16) nOffset); nOffset=GetSliderPos(); } - nEdFocus=no-(USHORT)nOffset; + nEdFocus=no-(sal_uInt16)nOffset; UpdateArgDesc( nEdFocus ); } } @@ -233,7 +233,7 @@ RefEdit* ParaWin::GetActiveEdit() } -String ParaWin::GetArgument(USHORT no) +String ParaWin::GetArgument(sal_uInt16 no) { String aStr; if(no 0 ) { @@ -446,19 +446,19 @@ void ParaWin::UpdateParas() } -USHORT ParaWin::GetSliderPos() +sal_uInt16 ParaWin::GetSliderPos() { - return (USHORT) aSlider.GetThumbPos(); + return (sal_uInt16) aSlider.GetThumbPos(); } -void ParaWin::SetSliderPos(USHORT nSliderPos) +void ParaWin::SetSliderPos(sal_uInt16 nSliderPos) { - USHORT nOffset = GetSliderPos(); + sal_uInt16 nOffset = GetSliderPos(); if(aSlider.IsVisible() && nOffset!=nSliderPos) { aSlider.SetThumbPos(nSliderPos); - for ( USHORT i=0; i<4; i++ ) + for ( sal_uInt16 i=0; i<4; i++ ) { UpdateArgInput( nSliderPos, i ); } @@ -467,9 +467,9 @@ void ParaWin::SetSliderPos(USHORT nSliderPos) void ParaWin::SliderMoved() { - USHORT nOffset = GetSliderPos(); + sal_uInt16 nOffset = GetSliderPos(); - for ( USHORT i=0; i<4; i++ ) + for ( sal_uInt16 i=0; i<4; i++ ) { UpdateArgInput( nOffset, i ); } @@ -496,9 +496,9 @@ void ParaWin::FxClick() IMPL_LINK( ParaWin, GetFxHdl, ArgInput*, pPtr ) { - USHORT nOffset = GetSliderPos(); + sal_uInt16 nOffset = GetSliderPos(); nEdFocus=NOT_FOUND; - for ( USHORT nPos=0; nPos<5;nPos++) + for ( sal_uInt16 nPos=0; nPos<5;nPos++) { if(pPtr == &aArgInput[nPos]) { @@ -518,9 +518,9 @@ IMPL_LINK( ParaWin, GetFxHdl, ArgInput*, pPtr ) IMPL_LINK( ParaWin, GetFxFocusHdl, ArgInput*, pPtr ) { - USHORT nOffset = GetSliderPos(); + sal_uInt16 nOffset = GetSliderPos(); nEdFocus=NOT_FOUND; - for ( USHORT nPos=0; nPos<5;nPos++) + for ( sal_uInt16 nPos=0; nPos<5;nPos++) { if(pPtr == &aArgInput[nPos]) { @@ -542,9 +542,9 @@ IMPL_LINK( ParaWin, GetFxFocusHdl, ArgInput*, pPtr ) IMPL_LINK( ParaWin, GetEdFocusHdl, ArgInput*, pPtr ) { - USHORT nOffset = GetSliderPos(); + sal_uInt16 nOffset = GetSliderPos(); nEdFocus=NOT_FOUND; - for ( USHORT nPos=0; nPos<5;nPos++) + for ( sal_uInt16 nPos=0; nPos<5;nPos++) { if(pPtr == &aArgInput[nPos]) { @@ -574,9 +574,9 @@ IMPL_LINK( ParaWin, ScrollHdl, ScrollBar*, EMPTYARG ) IMPL_LINK( ParaWin, ModifyHdl, ArgInput*, pPtr ) { - USHORT nOffset = GetSliderPos(); + sal_uInt16 nOffset = GetSliderPos(); nEdFocus=NOT_FOUND; - for ( USHORT nPos=0; nPos<5;nPos++) + for ( sal_uInt16 nPos=0; nPos<5;nPos++) { if(pPtr == &aArgInput[nPos]) { diff --git a/formula/source/ui/dlg/parawin.hxx b/formula/source/ui/dlg/parawin.hxx index 8f128e5ad4..fabeebd321 100644 --- a/formula/source/ui/dlg/parawin.hxx +++ b/formula/source/ui/dlg/parawin.hxx @@ -57,10 +57,10 @@ private: Link aFxLink; Link aArgModifiedLink; - ::std::vector aVisibleArgMapping; + ::std::vector aVisibleArgMapping; const IFunctionDescription* pFuncDesc; IControlReferenceHandler* pMyParent; - USHORT nArgs; // unsuppressed arguments + sal_uInt16 nArgs; // unsuppressed arguments Font aFntBold; Font aFntLight; @@ -91,10 +91,10 @@ private: ScrollBar aSlider; String m_sOptional; String m_sRequired; - BOOL bRefMode; + sal_Bool bRefMode; - USHORT nEdFocus; - USHORT nActiveLine; + sal_uInt16 nEdFocus; + sal_uInt16 nActiveLine; ArgInput aArgInput[4]; String aDefaultString; @@ -113,7 +113,7 @@ protected: virtual void ArgumentModified(); virtual void FxClick(); - void InitArgInput( USHORT nPos, FixedText& rFtArg, ImageButton& rBtnFx, + void InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx, ArgEdit& rEdArg, RefButton& rRefBtn); void DelParaArray(); @@ -121,40 +121,40 @@ protected: void SetArgumentText(const String& aText); - void SetArgName (USHORT no,const String &aArg); - void SetArgNameFont (USHORT no,const Font&); - void SetArgVal (USHORT no,const String &aArg); + void SetArgName (sal_uInt16 no,const String &aArg); + void SetArgNameFont (sal_uInt16 no,const Font&); + void SetArgVal (sal_uInt16 no,const String &aArg); - void HideParaLine(USHORT no); - void ShowParaLine(USHORT no); - void UpdateArgDesc( USHORT nArg ); - void UpdateArgInput( USHORT nOffset, USHORT i ); + void HideParaLine(sal_uInt16 no); + void ShowParaLine(sal_uInt16 no); + void UpdateArgDesc( sal_uInt16 nArg ); + void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ); public: ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos); ~ParaWin(); void SetFunctionDesc(const IFunctionDescription* pFDesc); - void SetArgumentOffset(USHORT nOffset); + void SetArgumentOffset(sal_uInt16 nOffset); void SetEditDesc(const String& aText); void UpdateParas(); void ClearAll(); - BOOL IsRefMode() {return bRefMode;} - void SetRefMode(BOOL bFlag) {bRefMode=bFlag;} + sal_Bool IsRefMode() {return bRefMode;} + void SetRefMode(sal_Bool bFlag) {bRefMode=bFlag;} - USHORT GetActiveLine(); - void SetActiveLine(USHORT no); + sal_uInt16 GetActiveLine(); + void SetActiveLine(sal_uInt16 no); RefEdit* GetActiveEdit(); String GetActiveArgName(); - String GetArgument(USHORT no); - void SetArgument(USHORT no, const String& aString); + String GetArgument(sal_uInt16 no); + void SetArgument(sal_uInt16 no, const String& aString); void SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont); - void SetEdFocus(USHORT nEditLine); //Sichtbare Editzeilen - USHORT GetSliderPos(); - void SetSliderPos(USHORT nSliderPos); + void SetEdFocus(sal_uInt16 nEditLine); //Sichtbare Editzeilen + sal_uInt16 GetSliderPos(); + void SetSliderPos(sal_uInt16 nSliderPos); void SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; } const Link& GetScrollHdl() const { return aScrollLink; } diff --git a/formula/source/ui/dlg/structpg.cxx b/formula/source/ui/dlg/structpg.cxx index 95b8b59442..2bb415609a 100644 --- a/formula/source/ui/dlg/structpg.cxx +++ b/formula/source/ui/dlg/structpg.cxx @@ -49,7 +49,7 @@ namespace formula StructListBox::StructListBox(Window* pParent, const ResId& rResId ): SvTreeListBox(pParent,rResId ) { - bActiveFlag=FALSE; + bActiveFlag=sal_False; Font aFont( GetFont() ); Size aSize = aFont.GetSize(); @@ -61,9 +61,9 @@ StructListBox::StructListBox(Window* pParent, const ResId& rResId ): SvLBoxEntry* StructListBox::InsertStaticEntry( const XubString& rText, const Image& rEntryImg, const Image& rEntryImgHC, - SvLBoxEntry* pParent, ULONG nPos, IFormulaToken* pToken ) + SvLBoxEntry* pParent, sal_uLong nPos, IFormulaToken* pToken ) { - SvLBoxEntry* pEntry = InsertEntry( rText, rEntryImg, rEntryImg, pParent, FALSE, nPos, pToken ); + SvLBoxEntry* pEntry = InsertEntry( rText, rEntryImg, rEntryImg, pParent, sal_False, nPos, pToken ); SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ) ); DBG_ASSERT( pBmpItem, "StructListBox::InsertStaticEntry - missing item" ); pBmpItem->SetBitmap1( rEntryImgHC, BMP_COLOR_HIGHCONTRAST ); @@ -71,31 +71,31 @@ SvLBoxEntry* StructListBox::InsertStaticEntry( return pEntry; } -void StructListBox::SetActiveFlag(BOOL bFlag) +void StructListBox::SetActiveFlag(sal_Bool bFlag) { bActiveFlag=bFlag; } -BOOL StructListBox::GetActiveFlag() +sal_Bool StructListBox::GetActiveFlag() { return bActiveFlag; } void StructListBox::MouseButtonDown( const MouseEvent& rMEvt ) { - bActiveFlag=TRUE; + bActiveFlag=sal_True; SvTreeListBox::MouseButtonDown(rMEvt); } void StructListBox::GetFocus() { - bActiveFlag=TRUE; + bActiveFlag=sal_True; SvTreeListBox::GetFocus(); } void StructListBox::LoseFocus() { - bActiveFlag=FALSE; + bActiveFlag=sal_False; SvTreeListBox::LoseFocus(); } @@ -128,20 +128,20 @@ StructPage::StructPage(Window* pParent): void StructPage::ClearStruct() { - aTlbStruct.SetActiveFlag(FALSE); + aTlbStruct.SetActiveFlag(sal_False); aTlbStruct.Clear(); } SvLBoxEntry* StructPage::InsertEntry( const XubString& rText, SvLBoxEntry* pParent, - USHORT nFlag,ULONG nPos,IFormulaToken* pIFormulaToken) + sal_uInt16 nFlag,sal_uLong nPos,IFormulaToken* pIFormulaToken) { - aTlbStruct.SetActiveFlag( FALSE ); + aTlbStruct.SetActiveFlag( sal_False ); SvLBoxEntry* pEntry = NULL; switch( nFlag ) { case STRUCT_FOLDER: - pEntry = aTlbStruct.InsertEntry( rText, pParent, FALSE, nPos, pIFormulaToken ); + pEntry = aTlbStruct.InsertEntry( rText, pParent, sal_False, nPos, pIFormulaToken ); break; case STRUCT_END: pEntry = aTlbStruct.InsertStaticEntry( rText, maImgEnd, maImgEndHC, pParent, nPos, pIFormulaToken ); diff --git a/formula/source/ui/dlg/structpg.hxx b/formula/source/ui/dlg/structpg.hxx index a71ca68008..7dfb0bb0e9 100644 --- a/formula/source/ui/dlg/structpg.hxx +++ b/formula/source/ui/dlg/structpg.hxx @@ -49,7 +49,7 @@ class StructListBox : public SvTreeListBox { private: - BOOL bActiveFlag; + sal_Bool bActiveFlag; protected: virtual void MouseButtonDown( const MouseEvent& rMEvt ); @@ -64,11 +64,11 @@ public: const Image& rEntryImg, const Image& rEntryImgHC, SvLBoxEntry* pParent = NULL, - ULONG nPos = LIST_APPEND, + sal_uLong nPos = LIST_APPEND, IFormulaToken* pToken = NULL ); - void SetActiveFlag(BOOL bFlag=TRUE); - BOOL GetActiveFlag(); + void SetActiveFlag(sal_Bool bFlag=sal_True); + sal_Bool GetActiveFlag(); void GetFocus(); void LoseFocus(); }; @@ -105,7 +105,7 @@ public: void ClearStruct(); virtual SvLBoxEntry* InsertEntry(const XubString& rText, SvLBoxEntry* pParent, - USHORT nFlag,ULONG nPos=0,IFormulaToken* pScToken=NULL); + sal_uInt16 nFlag,sal_uLong nPos=0,IFormulaToken* pScToken=NULL); virtual String GetEntryText(SvLBoxEntry* pEntry) const; virtual SvLBoxEntry* GetParent(SvLBoxEntry* pEntry) const; diff --git a/formula/source/ui/inc/ModuleHelper.hxx b/formula/source/ui/inc/ModuleHelper.hxx index de80a167a1..df630315e0 100644 --- a/formula/source/ui/inc/ModuleHelper.hxx +++ b/formula/source/ui/inc/ModuleHelper.hxx @@ -88,7 +88,7 @@ namespace formula class FORMULA_DLLPUBLIC ModuleRes : public ::ResId { public: - ModuleRes(USHORT _nId) : ResId(_nId, *OModule::getResManager()) { } + ModuleRes(sal_uInt16 _nId) : ResId(_nId, *OModule::getResManager()) { } }; //......................................................................... } // namespace formula -- cgit v1.2.3 From c815f972183ac80ed52fb16e3480677e78f07bc6 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Fri, 21 Jan 2011 13:06:20 +0100 Subject: removetooltypes01: #i112600# Fix build problems on non-pro --- formula/inc/formula/FormulaCompiler.hxx | 2 +- formula/source/core/api/FormulaCompiler.cxx | 2 +- sfx2/source/bastyp/bitset.cxx | 2 +- sfx2/source/dialog/templdlg.cxx | 2 +- svx/source/dialog/rlrcitem.cxx | 20 ++++++++++---------- svx/source/svdraw/svdmodel.cxx | 2 +- svx/source/svdraw/svdopath.cxx | 2 +- svx/source/svdraw/svdpoev.cxx | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) (limited to 'formula') diff --git a/formula/inc/formula/FormulaCompiler.hxx b/formula/inc/formula/FormulaCompiler.hxx index ef618e52a5..29c15dea9a 100644 --- a/formula/inc/formula/FormulaCompiler.hxx +++ b/formula/inc/formula/FormulaCompiler.hxx @@ -135,7 +135,7 @@ 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"); + DBG_ASSERT( sal_uInt16(eOp) < mnSymbols, "OpCodeMap::getSymbol: OpCode out of range"); if (sal_uInt16(eOp) < mnSymbols) return mpTable[ eOp ]; static String s_sEmpty; diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 4a829104bb..8396ebd5b2 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -490,7 +490,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create void FormulaCompiler::OpCodeMap::putOpCode( const String & rStr, const OpCode eOp ) { - DBG_ASSERT( 0 < eOp && USHORT(eOp) < mnSymbols, "OpCodeMap::putOpCode: OpCode out of range"); + DBG_ASSERT( 0 < eOp && sal_uInt16(eOp) < mnSymbols, "OpCodeMap::putOpCode: OpCode out of range"); if (0 < eOp && sal_uInt16(eOp) < mnSymbols) { DBG_ASSERT( (mpTable[eOp].Len() == 0) || (mpTable[eOp] == rStr) || (eOp == ocCurrency), diff --git a/sfx2/source/bastyp/bitset.cxx b/sfx2/source/bastyp/bitset.cxx index 0c9022dddd..b185173df9 100644 --- a/sfx2/source/bastyp/bitset.cxx +++ b/sfx2/source/bastyp/bitset.cxx @@ -388,7 +388,7 @@ sal_uInt16 IndexBitSet::GetFreeIndex() *this|=i; return i; } - DBG_ASSERT(FALSE, "IndexBitSet enthaelt mehr als USHRT_MAX Eintraege"); + DBG_ASSERT(sal_False, "IndexBitSet enthaelt mehr als USHRT_MAX Eintraege"); return 0; } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 407c03f387..9bfd381e87 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -2257,7 +2257,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, MenuSelectHdl, Menu *, pMenu ) void SfxCommonTemplateDialog_Impl::ExecuteContextMenu_Impl( const Point& rPos, Window* pWin ) { // Bug# 94152: This part should never be called, because before this happens, the TreeListBox should captured this! - DBG_ASSERT( FALSE, "+SfxCommonTemplateDialog_Impl::ExecuteContextMenu_Impl(): How could this happen? Please infirm developer ASAP!" ); + DBG_ASSERT( sal_False, "+SfxCommonTemplateDialog_Impl::ExecuteContextMenu_Impl(): How could this happen? Please infirm developer ASAP!" ); PopupMenu* pMenu = CreateContextMenu(); pMenu->Execute( pWin, rPos ); diff --git a/svx/source/dialog/rlrcitem.cxx b/svx/source/dialog/rlrcitem.cxx index 6457ee5cbe..0585a558aa 100644 --- a/svx/source/dialog/rlrcitem.cxx +++ b/svx/source/dialog/rlrcitem.cxx @@ -76,14 +76,14 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_ATTR_LONG_LRSPACE: { const SvxLongLRSpaceItem *pItem = PTR_CAST(SvxLongLRSpaceItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SvxLRSpaceItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxLRSpaceItem erwartet"); rRuler.UpdateFrame(pItem); break; } case SID_ATTR_LONG_ULSPACE: { const SvxLongULSpaceItem *pItem = PTR_CAST(SvxLongULSpaceItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SvxULSpaceItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxULSpaceItem erwartet"); rRuler.UpdateFrame(pItem); break; } @@ -91,7 +91,7 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_ATTR_TABSTOP: { const SvxTabStopItem *pItem = PTR_CAST(SvxTabStopItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SvxTabStopItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxTabStopItem erwartet"); rRuler.Update(pItem); break; } @@ -99,7 +99,7 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_ATTR_PARA_LRSPACE: { const SvxLRSpaceItem *pItem = PTR_CAST(SvxLRSpaceItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SvxLRSpaceItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxLRSpaceItem erwartet"); rRuler.UpdatePara(pItem); break; } @@ -109,7 +109,7 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_RULER_ROWS_VERTICAL: { const SvxColumnItem *pItem = PTR_CAST(SvxColumnItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SvxColumnItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxColumnItem erwartet"); #ifdef DBG_UTIL if(pItem) { @@ -128,35 +128,35 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_RULER_PAGE_POS: { // Position Seite, Seitenbreite const SvxPagePosSizeItem *pItem = PTR_CAST(SvxPagePosSizeItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SvxPagePosSizeItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxPagePosSizeItem erwartet"); rRuler.Update(pItem); break; } case SID_RULER_OBJECT: { // Object-Selektion const SvxObjectItem *pItem = PTR_CAST(SvxObjectItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SvxObjectItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxObjectItem erwartet"); rRuler.Update(pItem); break; } case SID_RULER_PROTECT: { const SvxProtectItem *pItem = PTR_CAST(SvxProtectItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SvxProtectItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxProtectItem erwartet"); rRuler.Update(pItem); break; } case SID_RULER_BORDER_DISTANCE: { const SvxLRSpaceItem *pItem = PTR_CAST(SvxLRSpaceItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SvxLRSpaceItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxLRSpaceItem erwartet"); rRuler.UpdateParaBorder(pItem); } break; case SID_RULER_TEXT_RIGHT_TO_LEFT : { const SfxBoolItem *pItem = PTR_CAST(SfxBoolItem, pState); - DBG_ASSERT(pState? 0 != pItem: TRUE, "SfxBoolItem erwartet"); + DBG_ASSERT(pState? 0 != pItem: sal_True, "SfxBoolItem erwartet"); rRuler.UpdateTextRTL(pItem); } break; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index a88d70edd6..2a80b3baba 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1866,7 +1866,7 @@ void SdrModel::SetStarDrawPreviewMode(sal_Bool bPreview) if (!bPreview && bStarDrawPreviewMode && GetPageCount()) { // Das Zuruecksetzen ist nicht erlaubt, da das Model ev. nicht vollstaendig geladen wurde - DBG_ASSERT(FALSE,"SdrModel::SetStarDrawPreviewMode(): Zuruecksetzen nicht erlaubt, da Model ev. nicht vollstaendig"); + DBG_ASSERT(sal_False,"SdrModel::SetStarDrawPreviewMode(): Zuruecksetzen nicht erlaubt, da Model ev. nicht vollstaendig"); } else { diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index e46a9b6475..df2a0fafde 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2479,7 +2479,7 @@ Point SdrPathObj::GetSnapPoint(sal_uInt32 nSnapPnt) const sal_uInt32 nPoly,nPnt; if(!PolyPolygonEditor::GetRelativePolyPoint(GetPathPoly(), nSnapPnt, nPoly, nPnt)) { - DBG_ASSERT(FALSE,"SdrPathObj::GetSnapPoint: Punkt nSnapPnt nicht vorhanden!"); + DBG_ASSERT(sal_False,"SdrPathObj::GetSnapPoint: Punkt nSnapPnt nicht vorhanden!"); } const basegfx::B2DPoint aB2DPoint(GetPathPoly().getB2DPolygon(nPoly).getB2DPoint(nPnt)); diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx index cf5d4a3a99..2d004ca397 100644 --- a/svx/source/svdraw/svdpoev.cxx +++ b/svx/source/svdraw/svdpoev.cxx @@ -406,7 +406,7 @@ void SdrPolyEditView::RipUpAtMarkedPoints() if(nNewPt0Idx) { // Korrektur notwendig? - DBG_ASSERT(bKorregFlag==FALSE,"Mehrfache Indexkorrektur bei SdrPolyEditView::RipUp()"); + DBG_ASSERT(bKorregFlag==sal_False,"Mehrfache Indexkorrektur bei SdrPolyEditView::RipUp()"); if(!bKorregFlag) { bKorregFlag = sal_True; -- cgit v1.2.3