diff options
Diffstat (limited to 'formula')
58 files changed, 817 insertions, 768 deletions
diff --git a/formula/inc/AddressConvention.hxx b/formula/inc/AddressConvention.hxx index bf98438acc2c..bf98438acc2c 100644..100755 --- a/formula/inc/AddressConvention.hxx +++ b/formula/inc/AddressConvention.hxx diff --git a/formula/inc/formula/ExternalReferenceHelper.hxx b/formula/inc/formula/ExternalReferenceHelper.hxx index 206dbc7685ea..206dbc7685ea 100644..100755 --- a/formula/inc/formula/ExternalReferenceHelper.hxx +++ b/formula/inc/formula/ExternalReferenceHelper.hxx diff --git a/formula/inc/formula/FormulaCompiler.hxx b/formula/inc/formula/FormulaCompiler.hxx index 2a8881e4226f..9ff456beb4d2 100644..100755 --- a/formula/inc/formula/FormulaCompiler.hxx +++ b/formula/inc/formula/FormulaCompiler.hxx @@ -65,7 +65,7 @@ struct FormulaArrayStack { FormulaArrayStack* pNext; FormulaTokenArray* pArr; - BOOL bTemp; + sal_Bool bTemp; }; @@ -100,7 +100,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 @@ -110,7 +110,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), @@ -137,8 +137,8 @@ public: /// Get the symbol string matching an OpCode. inline const String& getSymbol( const OpCode eOp ) const { - DBG_ASSERT( USHORT(eOp) < mnSymbols, "OpCodeMap::getSymbol: OpCode out of range"); - if (USHORT(eOp) < mnSymbols) + DBG_ASSERT( sal_uInt16(eOp) < mnSymbols, "OpCodeMap::getSymbol: OpCode out of range"); + if (sal_uInt16(eOp) < mnSymbols) return mpTable[ eOp ]; static String s_sEmpty; return s_sEmpty; @@ -148,7 +148,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)? */ @@ -218,25 +218,26 @@ public: */ OpCode GetEnglishOpCode( const String& rName ) const; - void SetCompileForFAP( BOOL bVal ) + void SetCompileForFAP( sal_Bool bVal ) { bCompileForFAP = bVal; bIgnoreErrors = bVal; } static bool IsOpCodeVolatile( OpCode eOp ); - 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 ); @@ -250,18 +251,18 @@ public: static void ResetNativeSymbols(); static void SetNativeSymbols( const OpCodeMapPtr& xMap ); 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); @@ -269,9 +270,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(); @@ -288,7 +289,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 ); @@ -308,18 +309,18 @@ 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 @@ -327,7 +328,7 @@ private: void InitSymbolsODFF() const; /// only SymbolsODFF, on demand void InitSymbolsEnglishXL() const; /// only SymbolsEnglishXL, 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/FormulaOpCodeMapperObj.hxx b/formula/inc/formula/FormulaOpCodeMapperObj.hxx index 78d44e91892a..78d44e91892a 100644..100755 --- a/formula/inc/formula/FormulaOpCodeMapperObj.hxx +++ b/formula/inc/formula/FormulaOpCodeMapperObj.hxx diff --git a/formula/inc/formula/IControlReferenceHandler.hxx b/formula/inc/formula/IControlReferenceHandler.hxx index cc3e58a6f301..f078544f9527 100644..100755 --- a/formula/inc/formula/IControlReferenceHandler.hxx +++ b/formula/inc/formula/IControlReferenceHandler.hxx @@ -38,7 +38,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 c705bdff66e1..bf1500ac45a3 100644..100755 --- a/formula/inc/formula/IFunctionDescription.hxx +++ b/formula/inc/formula/IFunctionDescription.hxx @@ -90,10 +90,10 @@ namespace formula // GetFormulaString virtual ::rtl::OUString getFormula(const ::std::vector< ::rtl::OUString >& _aArguments) const = 0; // GetVisibleArgMapping - virtual void fillVisibleArgumentMapping(::std::vector<USHORT>& _rArguments) const = 0; + virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const = 0; virtual void initArgumentInfo() const = 0; virtual ::rtl::OUString getSignature() const = 0; - virtual long getHelpId() const = 0; + virtual rtl::OString getHelpId() const = 0; // parameter virtual sal_uInt32 getParameterCount() const = 0; @@ -118,7 +118,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; @@ -153,9 +153,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/compiler.hrc b/formula/inc/formula/compiler.hrc index e4dc05aca4e9..e4dc05aca4e9 100644..100755 --- a/formula/inc/formula/compiler.hrc +++ b/formula/inc/formula/compiler.hrc diff --git a/formula/inc/formula/errorcodes.hxx b/formula/inc/formula/errorcodes.hxx index 71fb5fcd144d..d5dea4ca4ff0 100644..100755 --- a/formula/inc/formula/errorcodes.hxx +++ b/formula/inc/formula/errorcodes.hxx @@ -35,60 +35,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 { @@ -102,17 +102,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 0bc228eb4b6e..b8540a7ecfc1 100644..100755 --- a/formula/inc/formula/formdata.hxx +++ b/formula/inc/formula/formdata.hxx @@ -44,28 +44,28 @@ 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 ULONG GetUniqueId()const { return nUniqueId;} + 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 SetUniqueId(ULONG nNew) { nUniqueId=nNew;} + 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: void Reset(); @@ -74,15 +74,15 @@ 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; - ULONG nUniqueId; + sal_Bool bMatrix; + rtl::OString aUniqueId; Selection aSelection; }; diff --git a/formula/inc/formula/formula.hxx b/formula/inc/formula/formula.hxx index 82a5f12f88ea..8da444308d93 100644..100755 --- a/formula/inc/formula/formula.hxx +++ b/formula/inc/formula/formula.hxx @@ -79,22 +79,22 @@ protected: virtual long PreNotify( NotifyEvent& rNEvt ); ::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL ); - void RefInputDoneAfter( BOOL bForced = FALSE ); - ULONG FindFocusWin(Window *pWin); - void SetFocusWin(Window *pWin,ULONG nUniqueId); + void RefInputDoneAfter( sal_Bool bForced = sal_False ); + rtl::OString FindFocusWin(Window *pWin); + void SetFocusWin(Window *pWin,const rtl::OString& nUniqueId); void HighlightFunctionParas(const String& aFormula); void SetMeText(const String& _sText); - FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate); + FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate); void Update(); - BOOL CheckMatrix(String& aFormula /*IN/OUT*/); + sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/); String GetMeText() const; void Update(const String& _sExp); void CheckMatrix(); - void DoEnter(BOOL _bOk); - BOOL isUserMatrix() const; + void DoEnter(sal_Bool _bOk); + sal_Bool isUserMatrix() const; const IFunctionDescription* getCurrentFunctionDescription() const; - BOOL UpdateParaWin(Selection& _rSelection); + sal_Bool UpdateParaWin(Selection& _rSelection); void UpdateParaWin(const Selection& _rSelection,const String& _sRefStr); RefEdit* GetActiveEdit(); void SetEdSelection(); @@ -128,22 +128,22 @@ protected: virtual long PreNotify( NotifyEvent& rNEvt ); ::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL ); - void RefInputDoneAfter( BOOL bForced = FALSE ); - ULONG FindFocusWin(Window *pWin); - void SetFocusWin(Window *pWin,ULONG nUniqueId); + 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/formuladllapi.h b/formula/inc/formula/formuladllapi.h index a6de776f6401..a6de776f6401 100644..100755 --- a/formula/inc/formula/formuladllapi.h +++ b/formula/inc/formula/formuladllapi.h diff --git a/formula/inc/formula/formulahelper.hxx b/formula/inc/formula/formulahelper.hxx index 27967f8dffc2..d6b70977caba 100644..100755 --- a/formula/inc/formula/formulahelper.hxx +++ b/formula/inc/formula/formulahelper.hxx @@ -55,29 +55,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 6f7d23d3d3f7..fd6c3a76032e 100644..100755 --- a/formula/inc/formula/funcutl.hxx +++ b/formula/inc/formula/funcutl.hxx @@ -43,7 +43,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/grammar.hxx b/formula/inc/formula/grammar.hxx index d49c36f24ffe..d49c36f24ffe 100644..100755 --- a/formula/inc/formula/grammar.hxx +++ b/formula/inc/formula/grammar.hxx diff --git a/formula/inc/formula/opcode.hxx b/formula/inc/formula/opcode.hxx index ecabc6c70673..240f97401314 100644..100755 --- a/formula/inc/formula/opcode.hxx +++ b/formula/inc/formula/opcode.hxx @@ -397,7 +397,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 b29bbf9f0c9c..6341be555062 100644..100755 --- 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; @@ -98,7 +98,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 ) : @@ -110,17 +110,17 @@ 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 + sal_Bool IsFunction() const; // pure functions, no operators + sal_Bool IsMatrixFunction() const; // if a function _always_ returns a Matrix bool IsExternalRef() const; - BYTE GetParamCount() const; + sal_uInt8 GetParamCount() const; inline void IncRef() const { nRefCnt++; } inline void DecRef() const { if (!--nRefCnt) const_cast<FormulaToken*>(this)->Delete(); } - inline USHORT GetRef() const { return nRefCnt; } + inline sal_uInt16 GetRef() const { return nRefCnt; } inline OpCode GetOpCode() const { return eOp; } /** @@ -138,26 +138,26 @@ public: Any other non-overloaded method pops up an assertion. */ - virtual BYTE GetByte() const; - virtual void SetByte( BYTE n ); + virtual sal_uInt8 GetByte() const; + virtual void SetByte( sal_uInt8 n ); virtual bool HasForceArray() const; virtual void SetForceArray( bool b ); virtual double GetDouble() const; virtual double& GetDoubleAsReference(); virtual const String& GetString() const; - virtual USHORT GetIndex() const; - virtual void SetIndex( USHORT n ); + virtual sal_uInt16 GetIndex() const; + virtual void SetIndex( sal_uInt16 n ); virtual short* GetJump() const; virtual const String& GetExternal() const; virtual FormulaToken* GetFAPOrigToken() const; - virtual USHORT GetError() const; - virtual void SetError( USHORT ); + virtual sal_uInt16 GetError() const; + virtual void SetError( sal_uInt16 ); virtual FormulaToken* Clone() const { return new FormulaToken(*this); } - virtual BOOL Is3DRef() const; // reference with 3D flag set - virtual BOOL TextEqual( const formula::FormulaToken& rToken ) const; - virtual BOOL operator==( const FormulaToken& rToken ) const; + virtual sal_Bool Is3DRef() const; // reference with 3D flag set + virtual sal_Bool TextEqual( const formula::FormulaToken& rToken ) const; + virtual sal_Bool operator==( const FormulaToken& rToken ) const; virtual bool isFunction() const { @@ -192,17 +192,17 @@ inline void intrusive_ptr_release(const FormulaToken* p) 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 ) : @@ -213,11 +213,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 ) }; @@ -230,7 +230,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 ) : @@ -238,7 +238,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 @@ -254,7 +254,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 ) }; @@ -272,14 +272,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: @@ -292,23 +292,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; }; @@ -316,9 +316,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 ) : @@ -330,9 +330,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; }; @@ -347,7 +347,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 @@ -369,7 +369,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); } }; @@ -383,23 +383,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 8e723958fd32..092cbda78673 100644..100755 --- a/formula/inc/formula/tokenarray.hxx +++ b/formula/inc/formula/tokenarray.hxx @@ -42,7 +42,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 @@ -75,13 +75,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& ); @@ -118,7 +118,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! @@ -128,22 +128,22 @@ public: FormulaToken* PrevRPN(); bool HasExternalRef() const; - 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 @@ -168,17 +168,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 */ @@ -186,7 +186,7 @@ public: /** Operators +,-,*,/,^,&,=,<>,<,>,<=,>= with DoubleRef in Formula? */ - BOOL HasMatrixDoubleRefOps(); + sal_Bool HasMatrixDoubleRefOps(); virtual FormulaToken* AddOpCode(OpCode e); @@ -207,7 +207,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/inc/helpids.hrc b/formula/inc/helpids.hrc index ff51f806b734..5502c4370d58 100644..100755 --- a/formula/inc/helpids.hrc +++ b/formula/inc/helpids.hrc @@ -27,36 +27,26 @@ #ifndef FORMULA_HELPID_HRC #define FORMULA_HELPID_HRC -#ifndef _SOLAR_HRC -#include <svl/solar.hrc> // HID_FORMULA_START -#endif - -#define HID_FORMULADLG_FORMULA (HID_FORMULA_START + 0) -#define HID_FORMULA_FAP_FORMULA (HID_FORMULA_START + 1) -#define HID_FORMULA_FAP_STRUCT (HID_FORMULA_START + 2) -#define HID_FORMULA_FAP_PAGE (HID_FORMULA_START + 3) -#define HID_FORMULA_FAP_EDIT1 (HID_FORMULA_START + 4) -#define HID_FORMULA_FAP_EDIT2 (HID_FORMULA_START + 5) -#define HID_FORMULA_FAP_EDIT3 (HID_FORMULA_START + 6) -#define HID_FORMULA_FAP_EDIT4 (HID_FORMULA_START + 7) -#define HID_FORMULA_FAP_BTN_FX1 (HID_FORMULA_START + 8) -#define HID_FORMULA_FAP_BTN_FX2 (HID_FORMULA_START + 9) -#define HID_FORMULA_FAP_BTN_FX3 (HID_FORMULA_START +10) -#define HID_FORMULA_FAP_BTN_FX4 (HID_FORMULA_START +11) -#define HID_FORMULA_FAP_BTN_REF1 (HID_FORMULA_START +12) -#define HID_FORMULA_FAP_BTN_REF2 (HID_FORMULA_START +13) -#define HID_FORMULA_FAP_BTN_REF3 (HID_FORMULA_START +14) -#define HID_FORMULA_FAP_BTN_REF4 (HID_FORMULA_START +15) -#define HID_FORMULA_LB_CATEGORY (HID_FORMULA_START +16) -#define HID_FORMULA_LB_FUNCTION (HID_FORMULA_START +17) -#define HID_FORMULATAB_FUNCTION (HID_FORMULA_START +18) -#define HID_FORMULATAB_STRUCT (HID_FORMULA_START +19) - - -#if HID_FORMULATAB_STRUCT > HID_FORMULA_END -#error Help-Id Ueberlauf in #file, #line -#endif -// don't forget to update the file util/hidother.src +#define HID_FORMULADLG_FORMULA "FORMULA_HID_FORMULADLG_FORMULA" +#define HID_FORMULA_FAP_FORMULA "FORMULA_HID_FORMULA_FAP_FORMULA" +#define HID_FORMULA_FAP_STRUCT "FORMULA_HID_FORMULA_FAP_STRUCT" +#define HID_FORMULA_FAP_PAGE "FORMULA_HID_FORMULA_FAP_PAGE" +#define HID_FORMULA_FAP_EDIT1 "FORMULA_HID_FORMULA_FAP_EDIT1" +#define HID_FORMULA_FAP_EDIT2 "FORMULA_HID_FORMULA_FAP_EDIT2" +#define HID_FORMULA_FAP_EDIT3 "FORMULA_HID_FORMULA_FAP_EDIT3" +#define HID_FORMULA_FAP_EDIT4 "FORMULA_HID_FORMULA_FAP_EDIT4" +#define HID_FORMULA_FAP_BTN_FX1 "FORMULA_HID_FORMULA_FAP_BTN_FX1" +#define HID_FORMULA_FAP_BTN_FX2 "FORMULA_HID_FORMULA_FAP_BTN_FX2" +#define HID_FORMULA_FAP_BTN_FX3 "FORMULA_HID_FORMULA_FAP_BTN_FX3" +#define HID_FORMULA_FAP_BTN_FX4 "FORMULA_HID_FORMULA_FAP_BTN_FX4" +#define HID_FORMULA_FAP_BTN_REF1 "FORMULA_HID_FORMULA_FAP_BTN_REF1" +#define HID_FORMULA_FAP_BTN_REF2 "FORMULA_HID_FORMULA_FAP_BTN_REF2" +#define HID_FORMULA_FAP_BTN_REF3 "FORMULA_HID_FORMULA_FAP_BTN_REF3" +#define HID_FORMULA_FAP_BTN_REF4 "FORMULA_HID_FORMULA_FAP_BTN_REF4" +#define HID_FORMULA_LB_CATEGORY "FORMULA_HID_FORMULA_LB_CATEGORY" +#define HID_FORMULA_LB_FUNCTION "FORMULA_HID_FORMULA_LB_FUNCTION" +#define HID_FORMULATAB_FUNCTION "FORMULA_HID_FORMULATAB_FUNCTION" +#define HID_FORMULATAB_STRUCT "FORMULA_HID_FORMULATAB_STRUCT" #endif //FORMULA_HELPID_HRC diff --git a/formula/inc/makefile.mk b/formula/inc/makefile.mk index dfe7226e082a..dfe7226e082a 100644..100755 --- a/formula/inc/makefile.mk +++ b/formula/inc/makefile.mk diff --git a/formula/inc/pch/precompiled_formula.cxx b/formula/inc/pch/precompiled_formula.cxx index 8e7562f762ef..8e7562f762ef 100644..100755 --- a/formula/inc/pch/precompiled_formula.cxx +++ b/formula/inc/pch/precompiled_formula.cxx diff --git a/formula/inc/pch/precompiled_formula.hxx b/formula/inc/pch/precompiled_formula.hxx index 6d5785ad20dd..6d5785ad20dd 100644..100755 --- a/formula/inc/pch/precompiled_formula.hxx +++ b/formula/inc/pch/precompiled_formula.hxx diff --git a/formula/prj/build.lst b/formula/prj/build.lst index f26377c4578d..109a798ea3eb 100644..100755 --- a/formula/prj/build.lst +++ b/formula/prj/build.lst @@ -1,4 +1,4 @@ -fml formula : BOOST:boost comphelper svx NULL +fml formula : BOOST:boost LIBXSLT:libxslt comphelper svx NULL fml formula usr1 - all fml_mkout NULL fml formula\inc nmake - all fml_inc NULL fml formula\source\core\api nmake - all fml_api fml_inc NULL diff --git a/formula/prj/d.lst b/formula/prj/d.lst index c80df46d31b2..0fe5a1fe7198 100644..100755 --- a/formula/prj/d.lst +++ b/formula/prj/d.lst @@ -34,3 +34,4 @@ mkdir: %_DEST%\inc%_EXT%\formula +..\%__SRC%\misc\for.component %_DEST%\xml%_EXT%\for.component diff --git a/formula/prj/for.xml b/formula/prj/for.xml index d153b3bf5cfe..d153b3bf5cfe 100644..100755 --- a/formula/prj/for.xml +++ b/formula/prj/for.xml diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index bb464d519453..84df812ca1ac 100644..100755 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -134,7 +134,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; @@ -142,15 +142,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 ); } @@ -158,11 +158,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 @@ -173,11 +173,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) ) @@ -189,7 +189,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) { @@ -240,7 +240,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); @@ -303,7 +303,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 @@ -382,7 +382,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, @@ -391,7 +391,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, @@ -408,7 +408,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) { @@ -424,7 +424,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) { @@ -442,10 +442,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, @@ -455,7 +455,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create }; lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, SAL_N_ELEMENTS(aOpCodes) ); // 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) { @@ -492,8 +492,8 @@ 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) + 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), ByteString( "OpCodeMap::putOpCode: reusing OpCode "). @@ -515,10 +515,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); @@ -531,10 +531,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); @@ -582,7 +582,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(); } @@ -687,7 +687,7 @@ void FormulaCompiler::InitSymbolsEnglishXL() const } // ----------------------------------------------------------------------------- -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() ) { @@ -751,7 +751,7 @@ bool FormulaCompiler::IsOpCodeVolatile( OpCode eOp ) } // 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 ) == '\'' ) @@ -764,16 +764,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 ) { @@ -787,13 +787,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; } // ----------------------------------------------------------------------------- @@ -827,7 +827,7 @@ sal_Int32 FormulaCompiler::OpCodeMap::getOpCodeUnknown() return kOpCodeUnknown; } // ----------------------------------------------------------------------------- -BOOL FormulaCompiler::GetToken() +sal_Bool FormulaCompiler::GetToken() { static const short nRecursionMax = 42; FormulaCompilerRecursionGuard aRecursionGuard( nRecursion ); @@ -835,16 +835,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; @@ -859,11 +859,11 @@ BOOL FormulaCompiler::GetToken() if ( nWasColRowName ) nWasColRowName++; if ( bAutoCorrect && !pStack ) - CreateStringFromToken( aCorrectedFormula, pToken.get(), FALSE ); + CreateStringFromToken( aCorrectedFormula, pToken.get(), false ); pToken = pArr->Next(); } if ( bAutoCorrect && !pStack && pToken ) - CreateStringFromToken( aCorrectedSymbol, pToken.get(), FALSE ); + CreateStringFromToken( aCorrectedSymbol, pToken.get(), false ); if( !pToken ) { if( pStack ) @@ -872,7 +872,7 @@ BOOL FormulaCompiler::GetToken() return GetToken(); } else - bStop = TRUE; + bStop = sal_True; } else { @@ -886,10 +886,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->IsExternalRef() ) { return HandleExternalReference(*pToken); @@ -914,7 +914,7 @@ BOOL FormulaCompiler::GetToken() { pArr->nRefs++; } - return TRUE; + return sal_True; } //--------------------------------------------------------------------------- // RPN creation by recursion @@ -946,7 +946,7 @@ void FormulaCompiler::Factor() if ( bAutoCorrect && !pStack ) { // assume multiplication aCorrectedFormula += mxSymbols->getSymbol(ocMul); - bCorrected = TRUE; + bCorrected = sal_True; NextToken(); eOp = Expression(); if( eOp != ocClose ) @@ -1003,7 +1003,7 @@ void FormulaCompiler::Factor() pArr->SetRecalcModeOnRefMove(); break; case ocHyperLink : - pArr->SetHyperLink(TRUE); + pArr->SetHyperLink(sal_True); break; default: ; // nothing @@ -1081,7 +1081,7 @@ void FormulaCompiler::Factor() } else SetError(errPairExpected); - BYTE nSepCount = 0; + sal_uInt8 nSepCount = 0; if( !bNoParam ) { nSepCount++; @@ -1169,7 +1169,7 @@ void FormulaCompiler::Factor() if ( bAutoCorrect && !pStack ) { aCorrectedSymbol.Erase(); - bCorrected = TRUE; + bCorrected = sal_True; } } else if ( pToken->IsExternalRef() ) @@ -1188,7 +1188,7 @@ void FormulaCompiler::Factor() if ( nLen ) aCorrectedFormula.Erase( nLen - 1 ); aCorrectedSymbol.Erase(); - bCorrected = TRUE; + bCorrected = sal_True; } } } @@ -1377,7 +1377,7 @@ OpCode FormulaCompiler::Expression() return pToken->GetOpCode(); } // ----------------------------------------------------------------------------- -void FormulaCompiler::SetError(USHORT /*nError*/) +void FormulaCompiler::SetError(sal_uInt16 /*nError*/) { } // ----------------------------------------------------------------------------- @@ -1408,10 +1408,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 ) @@ -1424,7 +1424,7 @@ BOOL FormulaCompiler::CompileTokenArray() pStack = NULL; FormulaToken* pData[ MAXCODE ]; pCode = pData; - BOOL bWasForced = pArr->IsRecalcModeForced(); + sal_Bool bWasForced = pArr->IsRecalcModeForced(); if ( bWasForced ) { if ( bAutoCorrect ) @@ -1440,7 +1440,7 @@ BOOL FormulaCompiler::CompileTokenArray() if (eOp != ocStop) SetError( errOperatorExpected); - USHORT nErrorBeforePop = pArr->GetCodeError(); + sal_uInt16 nErrorBeforePop = pArr->GetCodeError(); while( pStack ) PopTokenArray(); @@ -1458,7 +1458,7 @@ BOOL FormulaCompiler::CompileTokenArray() if( pArr->GetCodeError() && !bIgnoreErrors ) { pArr->DelRPN(); - pArr->SetHyperLink(FALSE); + pArr->SetHyperLink(sal_False); } if ( bWasForced ) @@ -1520,7 +1520,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) { @@ -1529,7 +1529,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 ); @@ -1537,10 +1537,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 ) @@ -1550,7 +1550,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 ) @@ -1574,8 +1574,8 @@ FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuff else { // most times it's just one blank - BYTE n = t->GetByte(); - for ( BYTE j=0; j<n; ++j ) + sal_uInt8 n = t->GetByte(); + for ( sal_uInt8 j=0; j<n; ++j ) { rBuffer.append(sal_Unicode(' ')); } @@ -1583,7 +1583,7 @@ FormulaToken* FormulaCompiler::CreateStringFromToken( rtl::OUStringBuffer& rBuff } else if( eOp >= 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 { @@ -1671,7 +1671,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 { @@ -1680,7 +1680,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 ); } } // ----------------------------------------------------------------------------- @@ -1689,9 +1689,9 @@ void FormulaCompiler::AppendBoolean( rtl::OUStringBuffer& rBuffer, bool bVal ) rBuffer.append( mxSymbols->getSymbol(static_cast<OpCode>(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 ) @@ -1767,7 +1767,7 @@ OpCode FormulaCompiler::NextToken() if ( eOp == eLastOp || eLastOp == ocOpen ) { // throw away duplicated operator aCorrectedSymbol.Erase(); - bCorrected = TRUE; + bCorrected = sal_True; } else { @@ -1784,7 +1784,7 @@ OpCode FormulaCompiler::NextToken() aCorrectedFormula.SetChar( nPos, mxSymbols->getSymbol(ocGreater).GetChar(0) ); aCorrectedSymbol = c; - bCorrected = TRUE; + bCorrected = sal_True; } break; case ocLess: @@ -1793,14 +1793,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: @@ -1809,7 +1809,7 @@ OpCode FormulaCompiler::NextToken() aCorrectedFormula.SetChar( nPos, mxSymbols->getSymbol(ocMul).GetChar(0) ); aCorrectedSymbol = c; - bCorrected = TRUE; + bCorrected = sal_True; } break; case ocDiv: @@ -1818,7 +1818,7 @@ OpCode FormulaCompiler::NextToken() aCorrectedFormula.SetChar( nPos, mxSymbols->getSymbol(ocDiv).GetChar(0) ); aCorrectedSymbol = c; - bCorrected = TRUE; + bCorrected = sal_True; } break; default: @@ -1855,24 +1855,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*/) @@ -1898,7 +1898,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/FormulaOpCodeMapperObj.cxx b/formula/source/core/api/FormulaOpCodeMapperObj.cxx index 50ed85868538..50ed85868538 100644..100755 --- a/formula/source/core/api/FormulaOpCodeMapperObj.cxx +++ b/formula/source/core/api/FormulaOpCodeMapperObj.cxx diff --git a/formula/source/core/api/makefile.mk b/formula/source/core/api/makefile.mk index a99f9184acc2..a99f9184acc2 100644..100755 --- a/formula/source/core/api/makefile.mk +++ b/formula/source/core/api/makefile.mk diff --git a/formula/source/core/api/services.cxx b/formula/source/core/api/services.cxx index 039d796c6e9c..0155ede9c661 100644..100755 --- a/formula/source/core/api/services.cxx +++ b/formula/source/core/api/services.cxx @@ -67,12 +67,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * serviceManager, void * registryKey) -{ - return cppu::component_writeInfoHelper( - serviceManager, registryKey, entries); -} } // extern "C" /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 5fe52957c8b7..83f4e7436f50 100644..100755 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -52,19 +52,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)) @@ -79,12 +79,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 && @@ -103,14 +103,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) @@ -130,7 +130,7 @@ BYTE FormulaToken::GetParamCount() const } -BOOL FormulaToken::IsMatrixFunction() const +sal_Bool FormulaToken::IsMatrixFunction() const { return formula::FormulaCompiler::IsMatrixFunction(GetOpCode()); } @@ -147,7 +147,7 @@ bool FormulaToken::IsExternalRef() const return false; } -BOOL FormulaToken::operator==( const FormulaToken& rToken ) const +bool FormulaToken::operator==( const FormulaToken& rToken ) const { // don't compare reference count! return eType == rToken.eType && GetOpCode() == rToken.GetOpCode(); @@ -156,13 +156,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" ); } @@ -198,13 +198,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" ); } @@ -229,17 +229,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; } @@ -248,11 +248,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(); @@ -260,12 +260,12 @@ BOOL FormulaByteToken::operator==( const FormulaToken& r ) const FormulaToken* FormulaFAPToken::GetFAPOrigToken() const { return pOrigToken.get(); } -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; @@ -300,9 +300,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<sal_Int32>(); if ( eOpCode == ocName || eOpCode == ocDBArea ) - AddToken( formula::FormulaIndexToken( eOpCode, static_cast<USHORT>(nValue) ) ); + AddToken( formula::FormulaIndexToken( eOpCode, static_cast<sal_uInt16>(nValue) ) ); else if ( eOpCode == ocSpaces ) - AddToken( formula::FormulaByteToken( ocSpaces, static_cast<BYTE>(nValue) ) ); + AddToken( formula::FormulaByteToken( ocSpaces, static_cast<sal_uInt8>(nValue) ) ); else bError = true; } @@ -495,7 +495,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(); } @@ -505,7 +505,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]; @@ -524,7 +524,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 ) @@ -540,7 +540,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 ) @@ -562,34 +562,34 @@ bool FormulaTokenArray::HasExternalRef() const return false; } -BOOL FormulaTokenArray::HasOpCode( OpCode eOp ) const +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; } //////////////////////////////////////////////////////////////////////////// @@ -598,7 +598,7 @@ FormulaTokenArray::FormulaTokenArray() { pCode = NULL; pRPN = NULL; nError = nLen = nIndex = nRPN = nRefs = 0; - bHyperLink = FALSE; + bHyperLink = sal_False; ClearRecalcMode(); } @@ -628,14 +628,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(); } } @@ -661,7 +661,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(); @@ -671,14 +671,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 ) { @@ -704,7 +704,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(); } @@ -712,7 +712,7 @@ void FormulaTokenArray::Clear() } pCode = NULL; pRPN = NULL; nError = nLen = nIndex = nRPN = nRefs = 0; - bHyperLink = FALSE; + bHyperLink = sal_False; ClearRecalcMode(); } @@ -770,7 +770,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 ) ); } @@ -814,7 +814,7 @@ void FormulaTokenArray::AddRecalcMode( ScRecalcMode nBits ) } -BOOL FormulaTokenArray::HasMatrixDoubleRefOps() +sal_Bool FormulaTokenArray::HasMatrixDoubleRefOps() { if ( pRPN && nRPN ) { @@ -823,11 +823,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 : @@ -844,13 +844,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; } } } @@ -882,7 +882,7 @@ BOOL FormulaTokenArray::HasMatrixDoubleRefOps() delete [] pStack; } - return FALSE; + return sal_False; } @@ -931,21 +931,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: @@ -1085,7 +1085,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. @@ -1167,7 +1167,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; @@ -1208,7 +1208,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 ); @@ -1296,7 +1296,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 ]; @@ -1312,44 +1312,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(); @@ -1360,13 +1360,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/core/inc/core_resource.hrc b/formula/source/core/inc/core_resource.hrc index 9808a99c3680..9808a99c3680 100644..100755 --- a/formula/source/core/inc/core_resource.hrc +++ b/formula/source/core/inc/core_resource.hrc diff --git a/formula/source/core/inc/core_resource.hxx b/formula/source/core/inc/core_resource.hxx index 9ede1af6b953..9ede1af6b953 100644..100755 --- a/formula/source/core/inc/core_resource.hxx +++ b/formula/source/core/inc/core_resource.hxx diff --git a/formula/source/core/resource/core_resource.cxx b/formula/source/core/resource/core_resource.cxx index 62b2bc02e357..62b2bc02e357 100644..100755 --- a/formula/source/core/resource/core_resource.cxx +++ b/formula/source/core/resource/core_resource.cxx diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src index d2996e78fba7..d2996e78fba7 100644..100755 --- a/formula/source/core/resource/core_resource.src +++ b/formula/source/core/resource/core_resource.src diff --git a/formula/source/core/resource/makefile.mk b/formula/source/core/resource/makefile.mk index 96e2dfd5a841..96e2dfd5a841 100644..100755 --- a/formula/source/core/resource/makefile.mk +++ b/formula/source/core/resource/makefile.mk diff --git a/formula/source/ui/dlg/ControlHelper.hxx b/formula/source/ui/dlg/ControlHelper.hxx index 9d33dfa06198..63c0a7eebebf 100644..100755 --- a/formula/source/ui/dlg/ControlHelper.hxx +++ b/formula/source/ui/dlg/ControlHelper.hxx @@ -59,7 +59,7 @@ private: MultiLineEdit* pMEdit; Link aSelChangedLink; Selection aOldSel; - BOOL bMouseFlag; + sal_Bool bMouseFlag; DECL_LINK( ChangedHdl, EditBox* ); protected: @@ -94,7 +94,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 ); @@ -103,7 +103,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 927d882345dc..70839ecd7103 100644..100755 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -48,10 +48,10 @@ 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<USHORT>& ) const {} + virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& ) const {} virtual void initArgumentInfo() const {} virtual ::rtl::OUString getSignature() const { return ::rtl::OUString(); } - virtual long getHelpId() const { return 0; } + virtual rtl::OString getHelpId() const { return ""; } virtual sal_uInt32 getParameterCount() const { return 0; } virtual ::rtl::OUString getParameterName(sal_uInt32 ) const { return ::rtl::OUString(); } virtual ::rtl::OUString getParameterDescription(sal_uInt32 ) const { return ::rtl::OUString(); } @@ -75,14 +75,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, // Input and output 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; @@ -115,7 +115,7 @@ BOOL FormulaHelper::GetNextFunc( const String& rFormula, } if ( *ppFDesc && pArgs ) { - GetArgStrings( *pArgs,rFormula, rFStart, static_cast<USHORT>((*ppFDesc)->getParameterCount() )); + GetArgStrings( *pArgs,rFormula, rFStart, static_cast<sal_uInt16>((*ppFDesc)->getParameterCount() )); } else { @@ -134,13 +134,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<nArgs && !bLast; i++ ) { @@ -153,7 +153,7 @@ void FormulaHelper::FillArgStrings( const String& rFormula, if ( nEnd != nStart ) _rArgs.push_back(rFormula.Copy( nStart, nEnd-1-nStart )); else - _rArgs.push_back(String()), bLast = TRUE; + _rArgs.push_back(String()), bLast = sal_True; } else { @@ -175,7 +175,7 @@ void FormulaHelper::FillArgStrings( const String& rFormula, void FormulaHelper::GetArgStrings( ::std::vector< ::rtl::OUString >& _rArgs ,const String& rFormula, xub_StrLen nFuncPos, - USHORT nArgs ) const + sal_uInt16 nArgs ) const { if (nArgs) { @@ -185,10 +185,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... ;-) @@ -200,7 +200,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(); @@ -211,11 +211,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 ) { @@ -229,7 +229,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--; } } @@ -244,7 +244,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++; } } @@ -269,13 +269,13 @@ xub_StrLen FormulaHelper::GetFunctionStart( const String& rFormula, } else // Brackets without function -> keep searching { - bRepeat = TRUE; + bRepeat = sal_True; if ( !bBack ) nParPos++; else if (nParPos > 0) nParPos--; else - bRepeat = FALSE; + bRepeat = sal_False; } } else // No brackets found @@ -301,7 +301,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) ) { @@ -319,10 +319,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--; // read one too far } } @@ -338,7 +338,7 @@ xub_StrLen FormulaHelper::GetFunctionEnd( const String& rStr, xub_StrLen nStart { if ( !bInArray && nParCount == 0 ) { - bFound = TRUE; + bFound = sal_True; nStart--; // read one too far } } @@ -350,7 +350,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(); @@ -359,7 +359,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/formdlgs.hrc b/formula/source/ui/dlg/formdlgs.hrc index 4f76ba9681e1..4f76ba9681e1 100644..100755 --- a/formula/source/ui/dlg/formdlgs.hrc +++ b/formula/source/ui/dlg/formdlgs.hrc diff --git a/formula/source/ui/dlg/formdlgs.src b/formula/source/ui/dlg/formdlgs.src index fde1a7d44ca7..531ef0827e93 100644..100755 --- a/formula/source/ui/dlg/formdlgs.src +++ b/formula/source/ui/dlg/formdlgs.src @@ -143,6 +143,7 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL Moveable = TRUE ; TabControl TC_FUNCTION { + HelpID = "formula:TabControl:RID_FORMULADLG_FORMULA_MODAL:TC_FUNCTION"; Pos = MAP_APPFONT ( 6 , 5 ) ; Size = MAP_APPFONT ( 102 , 199 ) ; PageList = @@ -229,6 +230,7 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL }; CheckBox BTN_MATRIX { + HelpID = "formula:CheckBox:RID_FORMULADLG_FORMULA_MODAL:BTN_MATRIX"; Pos = MAP_APPFONT ( 6 , 208 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; TabStop = TRUE ; @@ -236,12 +238,14 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL }; Edit ED_REF { + HelpID = "formula:Edit:RID_FORMULADLG_FORMULA_MODAL:ED_REF"; Border = TRUE ; Pos = MAP_APPFONT ( 76 , 205 ) ; Size = MAP_APPFONT ( 66 , 12 ) ; }; ImageButton RB_REF { + HelpID = "formula:ImageButton:RID_FORMULADLG_FORMULA_MODAL:RB_REF"; Pos = MAP_APPFONT ( 144 , 205 ) ; Size = MAP_APPFONT ( 13 , 15 ) ; TabStop = FALSE ; @@ -261,6 +265,7 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL }; PushButton BTN_BACKWARD { + HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA_MODAL:BTN_BACKWARD"; Pos = MAP_APPFONT ( 171 , 208 ) ; Size = MAP_APPFONT ( 45 , 14 ) ; TabStop = TRUE ; @@ -268,6 +273,7 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL }; PushButton BTN_FORWARD { + HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA_MODAL:BTN_FORWARD"; Pos = MAP_APPFONT ( 219 , 208 ) ; Size = MAP_APPFONT ( 45 , 14 ) ; TabStop = TRUE ; @@ -304,6 +310,7 @@ ModelessDialog RID_FORMULADLG_FORMULA Moveable = TRUE ; TabControl TC_FUNCTION { + HelpID = "formula:TabControl:RID_FORMULADLG_FORMULA:TC_FUNCTION"; Pos = MAP_APPFONT ( 6 , 5 ) ; Size = MAP_APPFONT ( 102 , 199 ) ; PageList = @@ -390,6 +397,7 @@ ModelessDialog RID_FORMULADLG_FORMULA }; CheckBox BTN_MATRIX { + HelpID = "formula:CheckBox:RID_FORMULADLG_FORMULA:BTN_MATRIX"; Pos = MAP_APPFONT ( 6 , 208 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; TabStop = TRUE ; @@ -397,12 +405,14 @@ ModelessDialog RID_FORMULADLG_FORMULA }; Edit ED_REF { + HelpID = "formula:Edit:RID_FORMULADLG_FORMULA:ED_REF"; Border = TRUE ; Pos = MAP_APPFONT ( 76 , 205 ) ; Size = MAP_APPFONT ( 66 , 12 ) ; }; ImageButton RB_REF { + HelpID = "formula:ImageButton:RID_FORMULADLG_FORMULA:RB_REF"; Pos = MAP_APPFONT ( 144 , 205 ) ; Size = MAP_APPFONT ( 13 , 15 ) ; TabStop = FALSE ; @@ -422,6 +432,7 @@ ModelessDialog RID_FORMULADLG_FORMULA }; PushButton BTN_BACKWARD { + HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA:BTN_BACKWARD"; Pos = MAP_APPFONT ( 171 , 208 ) ; Size = MAP_APPFONT ( 45 , 14 ) ; TabStop = TRUE ; @@ -429,6 +440,7 @@ ModelessDialog RID_FORMULADLG_FORMULA }; PushButton BTN_FORWARD { + HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA:BTN_FORWARD"; Pos = MAP_APPFONT ( 219 , 208 ) ; Size = MAP_APPFONT ( 45 , 14 ) ; TabStop = TRUE ; diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 05a0e78768ee..8d478d0ec787 100644..100755 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -100,9 +100,9 @@ namespace formula ::std::pair<RefButton*,RefEdit*> 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); @@ -112,39 +112,39 @@ 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); void PreNotify( NotifyEvent& rNEvt ); RefEdit* GetCurrRefEdit(); - ULONG FindFocusWin(Window *pWin); + rtl::OString FindFocusWin(Window *pWin); const FormulaHelper& GetFormulaHelper() const; uno::Reference< sheet::XFormulaOpCodeMapper > GetFormulaOpCodeMapper() const; @@ -215,9 +215,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; @@ -227,20 +227,20 @@ namespace formula FormulaHelper m_aFormulaHelper; - SmartId m_aSmartEditHelpId; + rtl::OString m_aEditHelpId; - ULONG nOldHelp; - ULONG nOldUnique; - ULONG nActivWinId; - BOOL bIsShutDown; + rtl::OString aOldHelp; + rtl::OString aOldUnique; + rtl::OString aActivWinId; + 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; @@ -293,7 +293,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent // pTheRefEdit (NULL), pMEdit (NULL), - bUserMatrixFlag (FALSE), + bUserMatrixFlag (sal_False), // aTitle1 ( ModuleRes( STR_TITLE1 ) ), // local resource aTitle2 ( ModuleRes( STR_TITLE2 ) ), // local resource @@ -301,8 +301,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aTxtOk ( aBtnEnd.GetText() ), m_aFormulaHelper(_pFunctionMgr), // - nActivWinId (0), - bIsShutDown (FALSE), + bIsShutDown (sal_False), nEdFocus (0), pFuncDesc (NULL), nArgs (0) @@ -315,11 +314,16 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aRefBtn.Hide(); pMEdit = aMEFormula.GetEdit(); - m_aSmartEditHelpId = pMEdit->GetSmartHelpId(); - pMEdit->SetSmartUniqueId(m_aSmartEditHelpId); - - bEditFlag=FALSE; - bStructUpdate=TRUE; + //IAccessibility2 Implementation 2009----- + aMEFormula.SetAccessibleName(aFtFormula.GetText()); + if (pMEdit) + pMEdit->SetAccessibleName(aFtFormula.GetText()); + //-----IAccessibility2 Implementation 2009 + m_aEditHelpId = pMEdit->GetHelpId(); + pMEdit->SetUniqueId( m_aEditHelpId ); + + bEditFlag=sal_False; + bStructUpdate=sal_True; Point aPos=aGEdit.GetPosPixel(); pParaWin->SetPosPixel(aPos); pParaWin->SetArgModifiedHdl(LINK( this, FormulaDlg_Impl, ModifyHdl ) ); @@ -332,8 +336,8 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aTabCtrl.SetTabPage( TP_FUNCTION, pFuncPage); aTabCtrl.SetTabPage( TP_STRUCT, pStructPage); - nOldHelp = pParent->GetHelpId(); // HelpId from resource always for "Page 1" - nOldUnique = pParent->GetUniqueId(); + aOldHelp = pParent->GetHelpId(); // HelpId from resource always for "Page 1" + aOldUnique = pParent->GetUniqueId(); aFtResult.Show( _bSupportResult ); aWndResult.Show( _bSupportResult ); @@ -358,7 +362,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 ); @@ -377,7 +381,7 @@ FormulaDlg_Impl::~FormulaDlg_Impl() aTimer.SetTimeoutHdl(Link()); aTimer.Stop(); }// if(aTimer.IsActive()) - bIsShutDown=TRUE;// Set it in order to PreNotify not to save GetFocus. + bIsShutDown=sal_True;// Set it in order to PreNotify not to save GetFocus. FormEditData* pData = m_pHelper->getFormEditData(); if (pData) // it won't be destroyed over Close; { @@ -385,9 +389,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()); } @@ -403,33 +407,33 @@ 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(); if(pWin!=NULL) { - nActivWinId = pWin->GetUniqueId(); - if(nActivWinId==0) + aActivWinId = pWin->GetUniqueId(); + if(aActivWinId.getLength()==0) { Window* pParent=pWin->GetParent(); while(pParent!=NULL) { - nActivWinId=pParent->GetUniqueId(); + aActivWinId=pParent->GetUniqueId(); - if(nActivWinId!=0) break; + if(aActivWinId.getLength()!=0) break; pParent=pParent->GetParent(); } } - if(nActivWinId!=0) + if(aActivWinId.getLength()) { FormEditData* pData = m_pHelper->getFormEditData(); if (pData && !aTimer.IsActive()) // it won't be destroyed over Close; { - pData->SetUniqueId(nActivWinId); + pData->SetUniqueId(aActivWinId); } } } @@ -487,7 +491,7 @@ xub_StrLen FormulaDlg_Impl::GetFunctionPos(xub_StrLen nPos) xub_StrLen nFuncPos=STRING_NOTFOUND; //@ Testwise 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 +547,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 +592,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 +605,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 +629,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 +662,7 @@ BOOL FormulaDlg_Impl::CalcStruct( const String& rStrExp) UpdateTokenArray(rStrExp); } else - bResult = FALSE; + bResult = sal_False; } return bResult; } @@ -766,13 +770,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 +807,9 @@ void FormulaDlg_Impl::FillListboxes() if ( pFuncDesc && pFuncDesc->getCategory() ) { if( pFuncPage->GetCategory() != pFuncDesc->getCategory()->getNumber() + 1 ) - pFuncPage->SetCategory(static_cast<USHORT>(pFuncDesc->getCategory()->getNumber() + 1)); + pFuncPage->SetCategory(static_cast<sal_uInt16>(pFuncDesc->getCategory()->getNumber() + 1)); - USHORT nPos=pFuncPage->GetFuncPos(pFuncDesc); + sal_uInt16 nPos=pFuncPage->GetFuncPos(pFuncDesc); pFuncPage->SetFunction(nPos); } @@ -819,16 +823,16 @@ void FormulaDlg_Impl::FillListboxes() // ResizeArgArr is now already in UpdateFunctionDesc - m_pHelper->setDispatcherLock( TRUE);// Activate Modal-Mode + m_pHelper->setDispatcherLock( sal_True );// Activate Modal-Mode aNewTitle = aTitle1; // HelpId for 1. page is the one from the resource - m_pParent->SetHelpId( nOldHelp ); - m_pParent->SetUniqueId( nOldUnique ); + m_pParent->SetHelpId( aOldHelp ); + m_pParent->SetUniqueId( aOldUnique ); } // ----------------------------------------------------------------------------- -void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) +void FormulaDlg_Impl::FillControls(sal_Bool &rbNext, sal_Bool &rbPrev) { // Switch between the "Pages" FormEditData* pData = m_pHelper->getFormEditData(); @@ -846,9 +850,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); @@ -861,9 +865,9 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) aFtEditName.SetText( pFuncDesc->getFunctionName() ); aFtEditName.Show(); pParaWin->Show(); - const long nHelpId = pFuncDesc->getHelpId(); - if ( nHelpId ) - pMEdit->SetSmartHelpId(SmartId(nHelpId)); + const rtl::OString aHelpId = pFuncDesc->getHelpId(); + if ( aHelpId.getLength() ) + pMEdit->SetHelpId(aHelpId); } xub_StrLen nOldStart, nOldEnd; @@ -883,26 +887,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(); // Concatenate the Edit's for Focus-Control 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;i<nArgs;i++) + for(sal_uInt16 i=0;i<nArgs;i++) { sal_Int32 nLength = m_aArguments[i].getLength()+1; pParaWin->SetArgument(i,m_aArguments[i]); if(nArgPos<=nEditPos && nEditPos<nArgPos+nLength) { nActiv=i; - bFlag=TRUE; + bFlag=sal_True; } nArgPos = sal::static_int_cast<xub_StrLen>( nArgPos + nLength ); } @@ -919,15 +923,15 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) else { aFtEditName.SetText(String()); - pMEdit->SetSmartHelpId(m_aSmartEditHelpId); + pMEdit->SetHelpId( m_aEditHelpId ); } // 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 +949,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 +980,7 @@ String FormulaDlg_Impl::RepairFormula(const String& aFormula) return aResult; } -void FormulaDlg_Impl::DoEnter(BOOL bOk) +void FormulaDlg_Impl::DoEnter(sal_Bool bOk) { // Accept input to the document or cancel if ( bOk) @@ -1003,11 +1007,11 @@ IMPL_LINK( FormulaDlg_Impl, BtnHdl, PushButton*, pBtn ) { if ( pBtn == &aBtnCancel ) { - DoEnter(FALSE); // closes the Dialog + DoEnter(sal_False); // closes the Dialog } else if ( pBtn == &aBtnEnd ) { - DoEnter(TRUE); // closes the Dialog + DoEnter(sal_True); // closes the Dialog } else if ( pBtn == &aBtnForward ) { @@ -1015,19 +1019,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 +1065,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 +1108,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 +1134,7 @@ IMPL_LINK( FormulaDlg_Impl, DblClkHdl, FuncPage*, EMPTYARG ) } pParaWin->SetEdFocus(0); - aBtnForward.Enable(FALSE); //@New + aBtnForward.Enable(sal_False); //@New return 0; } @@ -1184,11 +1188,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 +1205,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 +1225,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 +1265,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 && nEditPos<nArgPos+nLength) { nActiv=i; - bFlag=TRUE; + bFlag=sal_True; } nArgPos+=nLength+1; } @@ -1288,11 +1292,11 @@ void FormulaDlg_Impl::EditFuncParas(xub_StrLen nEditPos) } -void FormulaDlg_Impl::SaveArg( USHORT nEd ) +void FormulaDlg_Impl::SaveArg( sal_uInt16 nEd ) { if (nEd<nArgs) { - USHORT i; + sal_uInt16 i; for(i=0;i<=nEd;i++) { if ( m_aArguments[i].getLength() == 0 ) @@ -1301,7 +1305,7 @@ void FormulaDlg_Impl::SaveArg( USHORT nEd ) if(pParaWin->GetArgument(nEd).Len()!=0) m_aArguments[nEd] = pParaWin->GetArgument(nEd); - USHORT nClearPos=nEd+1; + sal_uInt16 nClearPos=nEd+1; for(i=nEd+1;i<nArgs;i++) { if(pParaWin->GetArgument(i).Len()!=0) @@ -1321,14 +1325,14 @@ IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin*, pPtr ) { if(pPtr==pParaWin) { - aBtnForward.Enable(TRUE); //@ In order to be able to input another function. + aBtnForward.Enable(sal_True); //@ In order to be able to input another function. aTabCtrl.SetCurPageId(TP_FUNCTION); String aUndoStr = m_pHelper->getCurrentFormula(); // it will be added before a ";" FormEditData* pData = m_pHelper->getFormEditData(); if (!pData) return 0; - USHORT nArgNo = pParaWin->GetActiveLine(); + sal_uInt16 nArgNo = pParaWin->GetActiveLine(); nEdFocus=nArgNo; SaveArg(nArgNo); @@ -1341,12 +1345,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(); //There Parawin is not visible anymore } return 0; @@ -1371,7 +1375,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 +1422,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaHdl, MultiLineEdit*, EMPTYARG ) if(nPos<aSel.Min()-1) { xub_StrLen nPos1=aString.Search('(',nPos); - EditNextFunc( FALSE, nPos1); + EditNextFunc( sal_False, nPos1); } else { @@ -1426,7 +1430,7 @@ IMPL_LINK( FormulaDlg_Impl, FormulaHdl, MultiLineEdit*, EMPTYARG ) } m_pHelper->setSelection((xub_StrLen)aSel.Min(),(xub_StrLen)aSel.Max()); - bEditFlag=FALSE; + bEditFlag=sal_False; return 0; } @@ -1436,7 +1440,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 +1483,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 +1499,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 +1518,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;i<nPos;i++) + for(sal_uInt16 i=0;i<nPos;i++) { nArgPos += (m_aArguments[i].getLength() + 1); } sal_Int32 nLength= m_aArguments[nPos].getLength(); Selection aSel(nArgPos,nArgPos+nLength); - m_pHelper->setSelection((USHORT)nArgPos,(USHORT)(nArgPos+nLength)); + m_pHelper->setSelection((sal_uInt16)nArgPos,(sal_uInt16)(nArgPos+nLength)); pMEdit->SetSelection(aSel); aMEFormula.UpdateOldSel(); } @@ -1569,7 +1573,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 +1588,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 +1621,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 +1631,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 +1650,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-Formula ? + sal_Bool bMatrix = nLen > 3 // Matrix-Formula && aFormula.GetChar(0) == '{' && aFormula.GetChar(1) == '=' && aFormula.GetChar(nLen-1) == '}'; @@ -1667,23 +1671,23 @@ BOOL FormulaDlg_Impl::CheckMatrix(String& aFormula) } IMPL_LINK( FormulaDlg_Impl, StructSelHdl, StructPage*, EMPTYARG ) { - bStructUpdate=FALSE; - if(pStructPage->IsVisible()) aBtnForward.Enable(FALSE); //@New + bStructUpdate=sal_False; + if(pStructPage->IsVisible()) aBtnForward.Enable(sal_False); //@New - 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) @@ -1691,7 +1695,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) { @@ -1722,7 +1726,7 @@ void FormulaDlg_Impl::UpdateParaWin(const Selection& _rSelection,const String& _ //------------------------------------- // Manual Update of the results' fields: //------------------------------------- - USHORT nPrivActiv = pParaWin->GetActiveLine(); + sal_uInt16 nPrivActiv = pParaWin->GetActiveLine(); pParaWin->SetArgument(nPrivActiv,aEdRef.GetText()); pParaWin->UpdateParas(); @@ -1730,11 +1734,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(); @@ -1754,20 +1758,20 @@ BOOL FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection) } return pTheRefEdit == NULL; } -ULONG FormulaDlg_Impl::FindFocusWin(Window *pWin) +rtl::OString FormulaDlg_Impl::FindFocusWin(Window *pWin) { - ULONG nUniqueId=0; + rtl::OString aUniqueId; if(pWin->HasFocus()) { - nUniqueId=pWin->GetUniqueId(); - if(nUniqueId==0) + aUniqueId=pWin->GetUniqueId(); + if(aUniqueId.getLength()==0) { Window* pParent=pWin->GetParent(); while(pParent!=NULL) { - nUniqueId=pParent->GetUniqueId(); + aUniqueId=pParent->GetUniqueId(); - if(nUniqueId!=0) break; + if(aUniqueId.getLength()!=0) break; pParent=pParent->GetParent(); } @@ -1775,16 +1779,16 @@ ULONG FormulaDlg_Impl::FindFocusWin(Window *pWin) } else { - USHORT nCount=pWin->GetChildCount(); + sal_uInt16 nCount=pWin->GetChildCount(); - for(USHORT i=0;i<nCount;i++) + for(sal_uInt16 i=0;i<nCount;i++) { Window* pChild=pWin->GetChild(i); - nUniqueId=FindFocusWin(pChild); - if(nUniqueId>0) break; + aUniqueId=FindFocusWin(pChild); + if(aUniqueId.getLength()>0) break; } } - return nUniqueId; + return aUniqueId; } void FormulaDlg_Impl::SetEdSelection() @@ -1838,7 +1842,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); } @@ -1848,7 +1852,7 @@ void FormulaModalDialog::CheckMatrix() m_pImpl->aBtnMatrix.Check(); } // ----------------------------------------------------------------------------- -BOOL FormulaModalDialog::CheckMatrix(String& aFormula) +sal_Bool FormulaModalDialog::CheckMatrix(String& aFormula) { return m_pImpl->CheckMatrix(aFormula); } @@ -1868,11 +1872,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); } @@ -1884,17 +1888,17 @@ 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 ); } -ULONG FormulaModalDialog::FindFocusWin(Window *pWin) +rtl::OString FormulaModalDialog::FindFocusWin(Window *pWin) { return m_pImpl->FindFocusWin( pWin ); } -void FormulaModalDialog::SetFocusWin(Window *pWin,ULONG nUniqueId) +void FormulaModalDialog::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId) { if(pWin->GetUniqueId()==nUniqueId) { @@ -1902,9 +1906,9 @@ void FormulaModalDialog::SetFocusWin(Window *pWin,ULONG nUniqueId) } else { - USHORT nCount=pWin->GetChildCount(); + sal_uInt16 nCount=pWin->GetChildCount(); - for(USHORT i=0;i<nCount;i++) + for(sal_uInt16 i=0;i<nCount;i++) { Window* pChild=pWin->GetChild(i); SetFocusWin(pChild,nUniqueId); @@ -1940,7 +1944,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); } @@ -1971,7 +1975,7 @@ FormulaDlg::FormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, ,_pHelper,_pFunctionMgr,_pDlg)) { FreeResource(); - if(GetHelpId()==0) //Hack which hides the HelpId for a model Dialog in SfxModelessDialog + if(!GetHelpId().getLength()) //Hack which hides the HelpId for a model Dialog in SfxModelessDialog SetHelpId(GetUniqueId()); //and will be changed in a UniqueId, //at this point we reverse it. SetText(m_pImpl->aTitle1); @@ -1993,7 +1997,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); } @@ -2003,7 +2007,7 @@ void FormulaDlg::CheckMatrix() m_pImpl->aBtnMatrix.Check(); } // ----------------------------------------------------------------------------- -BOOL FormulaDlg::CheckMatrix(String& aFormula) +sal_Bool FormulaDlg::CheckMatrix(String& aFormula) { return m_pImpl->CheckMatrix(aFormula); } @@ -2022,11 +2026,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); } @@ -2038,17 +2042,17 @@ 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 ); } -ULONG FormulaDlg::FindFocusWin(Window *pWin) +rtl::OString FormulaDlg::FindFocusWin(Window *pWin) { return m_pImpl->FindFocusWin( pWin ); } -void FormulaDlg::SetFocusWin(Window *pWin,ULONG nUniqueId) +void FormulaDlg::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId) { if(pWin->GetUniqueId()==nUniqueId) { @@ -2056,9 +2060,9 @@ void FormulaDlg::SetFocusWin(Window *pWin,ULONG nUniqueId) } else { - USHORT nCount=pWin->GetChildCount(); + sal_uInt16 nCount=pWin->GetChildCount(); - for(USHORT i=0;i<nCount;i++) + for(sal_uInt16 i=0;i<nCount;i++) { Window* pChild=pWin->GetChild(i); SetFocusWin(pChild,nUniqueId); @@ -2093,7 +2097,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); } @@ -2119,7 +2123,7 @@ IMPL_LINK( FormulaDlg, UpdateFocusHdl, Timer*, EMPTYARG ) if (pData) // won't be destroyed over Close; { m_pImpl->m_pHelper->setReferenceInput(pData); - ULONG nUniqueId=pData->GetUniqueId(); + rtl::OString nUniqueId(pData->GetUniqueId()); SetFocusWin(this,nUniqueId); } return 0; @@ -2144,8 +2148,8 @@ void FormEditData::Reset() nFuncSel = 0; nOffset = 0; nEdFocus = 0; - bMatrix =FALSE; - nUniqueId=0; + bMatrix =sal_False; + aUniqueId=rtl::OString(); aSelection.Min()=0; aSelection.Max()=0; aUndoStr.Erase(); @@ -2174,7 +2178,7 @@ const FormEditData& FormEditData::operator=( const FormEditData& r ) nEdFocus = r.nEdFocus; aUndoStr = r.aUndoStr; bMatrix = r.bMatrix ; - nUniqueId = r.nUniqueId; + aUniqueId = r.aUniqueId; aSelection = r.aSelection; return *this; } diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index 62268699cfc8..19b41b74b9cf 100644..100755 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -70,7 +70,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()); @@ -82,7 +82,7 @@ long FormulaListBox::PreNotify( NotifyEvent& rNEvt ) //============================================================================ -inline USHORT Lb2Cat( USHORT nLbPos ) +inline sal_uInt16 Lb2Cat( sal_uInt16 nLbPos ) { // Category 0 == LRU, otherwise Categories == LbPos-1 if ( nLbPos > 0 ) @@ -103,8 +103,8 @@ FuncPage::FuncPage(Window* pParent,const IFunctionManager* _pFunctionManager): m_pFunctionManager(_pFunctionManager) { FreeResource(); - m_aSmartHelpId = aLbFunction.GetSmartHelpId(); - aLbFunction.SetSmartUniqueId(m_aSmartHelpId); + m_aHelpId = aLbFunction.GetHelpId(); + aLbFunction.SetUniqueId(m_aHelpId); InitLRUList(); @@ -135,15 +135,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<const IFunctionCategory*>(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 ) @@ -178,7 +178,7 @@ void FuncPage::UpdateFunctionList() } //------------------------------------------------------ - aLbFunction.SetUpdateMode( TRUE ); + aLbFunction.SetUpdateMode( sal_True ); aLbFunction.SelectEntryPos(0); if(IsVisible()) SelHdl(&aLbFunction); @@ -191,15 +191,15 @@ IMPL_LINK( FuncPage, SelHdl, ListBox*, pLb ) const IFunctionDescription* pDesc = GetFuncDesc( GetFunction() ); if ( pDesc ) { - const long nHelpId = pDesc->getHelpId(); - if ( nHelpId ) - aLbFunction.SetSmartHelpId(SmartId(nHelpId)); + const rtl::OString sHelpId = pDesc->getHelpId(); + if ( sHelpId.getLength() ) + aLbFunction.SetHelpId(sHelpId); } aSelectionLink.Call(this); } else { - aLbFunction.SetSmartHelpId(m_aSmartHelpId); + aLbFunction.SetHelpId(m_aHelpId); UpdateFunctionList(); } return 0; @@ -211,16 +211,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); } @@ -230,17 +230,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(); } @@ -249,7 +249,7 @@ String FuncPage::GetSelFunctionName() const { return aLbFunction.GetSelectEntry(); } -const IFunctionDescription* FuncPage::GetFuncDesc( USHORT nPos ) const +const IFunctionDescription* FuncPage::GetFuncDesc( sal_uInt16 nPos ) const { // not pretty, but hopefully rare return (const IFunctionDescription*) aLbFunction.GetEntryData(nPos); diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx index ac0731a8a3d5..b71dd4aee5cd 100644..100755 --- a/formula/source/ui/dlg/funcpage.hxx +++ b/formula/source/ui/dlg/funcpage.hxx @@ -83,7 +83,7 @@ private: m_pFunctionManager; ::std::vector< TFunctionDesc > aLRUList; - SmartId m_aSmartHelpId; + rtl::OString m_aHelpId; void impl_addFunctions(const IFunctionCategory* _pCategory); @@ -100,15 +100,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 52c8d59c894b..884ecb7e6096 100644..100755 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -50,7 +50,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() ) { @@ -111,7 +111,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; @@ -126,8 +126,8 @@ void ArgEdit::Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit, void 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 @@ -137,8 +137,8 @@ void 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 ) { @@ -152,13 +152,13 @@ void 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 ) @@ -173,13 +173,13 @@ void ArgEdit::KeyInput( const KeyEvent& rKEvt ) else { pEd = pEdPrev; - bChangeFocus = TRUE; + bChangeFocus = sal_True; } } else if ( pEdPrev ) { pEd = pEdPrev; - bChangeFocus = TRUE; + bChangeFocus = sal_True; } } @@ -744,7 +744,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); @@ -759,8 +759,8 @@ EditBox::EditBox( Window* pParent, const ResId& rResId ) // #105582# the HelpId from the resource must be set for the MultiLineEdit, // not for the control that contains it. - pMEdit->SetSmartHelpId( GetSmartHelpId() ); - SetSmartHelpId( SmartId() ); + pMEdit->SetHelpId( GetHelpId() ); + SetHelpId( "" ); } EditBox::~EditBox() @@ -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 ) { } @@ -981,9 +981,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/makefile.mk b/formula/source/ui/dlg/makefile.mk index 688e169d26d2..688e169d26d2 100644..100755 --- a/formula/source/ui/dlg/makefile.mk +++ b/formula/source/ui/dlg/makefile.mk diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index 520b8ebfdbb6..97e0a9cbe52f 100644..100755 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -57,30 +57,30 @@ ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos): aFtArgName ( this, ModuleRes( FT_PARNAME ) ), aFtArgDesc ( this, ModuleRes( FT_PARDESC ) ), + aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ), aFtArg1 ( this, ModuleRes( FT_ARG1 ) ), - aFtArg2 ( this, ModuleRes( FT_ARG2 ) ), - aFtArg3 ( this, ModuleRes( FT_ARG3 ) ), - aFtArg4 ( this, ModuleRes( FT_ARG4 ) ), + aEdArg1 ( this, ModuleRes( ED_ARG1 ) ), + aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ), - aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ), aBtnFx2 ( this, ModuleRes( BTN_FX2 ) ), - aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ), - aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ), - - aEdArg1 ( this, ModuleRes( ED_ARG1 ) ), + aFtArg2 ( this, ModuleRes( FT_ARG2 ) ), aEdArg2 ( this, ModuleRes( ED_ARG2 ) ), - aEdArg3 ( this, ModuleRes( ED_ARG3 ) ), - aEdArg4 ( this, ModuleRes( ED_ARG4 ) ), - - aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ), aRefBtn2 ( this, ModuleRes( RB_ARG2 ) ), + + aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ), + aFtArg3 ( this, ModuleRes( FT_ARG3 ) ), + aEdArg3 ( this, ModuleRes( ED_ARG3 ) ), aRefBtn3 ( this, ModuleRes( RB_ARG3 ) ), + + aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ), + aFtArg4 ( this, ModuleRes( FT_ARG4 ) ), + aEdArg4 ( this, ModuleRes( ED_ARG4 ) ), aRefBtn4 ( this, ModuleRes( RB_ARG4 ) ), aSlider ( this, ModuleRes( WND_SLIDER ) ), m_sOptional ( ModuleRes( STR_OPTIONAL ) ), m_sRequired ( ModuleRes( STR_REQUIRED ) ), - bRefMode (FALSE) + bRefMode (sal_False) { FreeResource(); aDefaultString=aFtEditDesc.GetText(); @@ -101,13 +101,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<USHORT>( nArg + GetSliderPos() ); - //@ nArg += (USHORT)aSlider.GetThumbPos(); + nArg = sal::static_int_cast<sal_uInt16>( nArg + GetSliderPos() ); + //@ nArg += (sal_uInt16)aSlider.GetThumbPos(); if ( (nArgs > 0) && (nArg<nArgs) ) { @@ -119,7 +119,7 @@ void ParaWin::UpdateArgDesc( USHORT nArg ) if ( nArgs < VAR_ARGS ) { - USHORT nRealArg = (aVisibleArgMapping.size() < nArg) ? aVisibleArgMapping[nArg] : nArg; + sal_uInt16 nRealArg = (aVisibleArgMapping.size() < nArg) ? aVisibleArgMapping[nArg] : nArg; aArgDesc = pFuncDesc->getParameterDescription(nRealArg); aArgName = pFuncDesc->getParameterName(nRealArg); aArgName += ' '; @@ -127,9 +127,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); @@ -145,14 +145,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(nArg<nArgs) { - USHORT nRealArg = aVisibleArgMapping[nArg]; + sal_uInt16 nRealArg = aVisibleArgMapping[nArg]; SetArgNameFont (i,(pFuncDesc->isParameterOptional(nRealArg)) ? aFntLight : aFntBold ); SetArgName (i,pFuncDesc->getParameterName(nRealArg)); @@ -160,9 +160,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)) ? @@ -192,12 +192,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(no<nArgs) { @@ -207,10 +207,10 @@ void ParaWin::SetActiveLine(USHORT no) if(nNewEdPos<0 || nNewEdPos>3) { nOffset+=nNewEdPos; - SetSliderPos((USHORT) nOffset); + SetSliderPos((sal_uInt16) nOffset); nOffset=GetSliderPos(); } - nEdFocus=no-(USHORT)nOffset; + nEdFocus=no-(sal_uInt16)nOffset; UpdateArgDesc( nEdFocus ); } } @@ -228,7 +228,7 @@ RefEdit* ParaWin::GetActiveEdit() } -String ParaWin::GetArgument(USHORT no) +String ParaWin::GetArgument(sal_uInt16 no) { String aStr; if(no<aParaArray.size()) @@ -251,7 +251,7 @@ String ParaWin::GetActiveArgName() } -void ParaWin::SetArgument(USHORT no, const String& aString) +void ParaWin::SetArgument(sal_uInt16 no, const String& aString) { if(no<aParaArray.size()) { @@ -289,15 +289,15 @@ void ParaWin::SetFunctionDesc(const IFunctionDescription* pFDesc) { SetEditDesc(aDefaultString); } - long nHelpId = pFuncDesc->getHelpId(); nArgs = pFuncDesc->getSuppressedArgumentCount(); pFuncDesc->fillVisibleArgumentMapping(aVisibleArgMapping); aSlider.Hide(); - SetHelpId( nHelpId ); - aEdArg1.SetHelpId( nHelpId ); - aEdArg2.SetHelpId( nHelpId ); - aEdArg3.SetHelpId( nHelpId ); - aEdArg4.SetHelpId( nHelpId ); + rtl::OString sHelpId = pFuncDesc->getHelpId(); + SetHelpId( sHelpId ); + aEdArg1.SetHelpId( sHelpId ); + aEdArg2.SetHelpId( sHelpId ); + aEdArg3.SetHelpId( sHelpId ); + aEdArg4.SetHelpId( sHelpId ); // Unique-IDs muessen gleich bleiben fuer Automatisierung SetUniqueId( HID_FORMULA_FAP_PAGE ); @@ -329,32 +329,32 @@ void ParaWin::SetEditDesc(const String& aText) aFtEditDesc.SetText(aText); } -void ParaWin::SetArgName(USHORT no,const String& aText) +void ParaWin::SetArgName(sal_uInt16 no,const String& aText) { aArgInput[no].SetArgName(aText); } -void ParaWin::SetArgNameFont(USHORT no,const Font& aFont) +void ParaWin::SetArgNameFont(sal_uInt16 no,const Font& aFont) { aArgInput[no].SetArgNameFont(aFont); } -void ParaWin::SetArgVal(USHORT no,const String& aText) +void ParaWin::SetArgVal(sal_uInt16 no,const String& aText) { aArgInput[no].SetArgVal(aText); } -void ParaWin::HideParaLine(USHORT no) +void ParaWin::HideParaLine(sal_uInt16 no) { aArgInput[no].Hide(); } -void ParaWin::ShowParaLine(USHORT no) +void ParaWin::ShowParaLine(sal_uInt16 no) { aArgInput[no].Show(); } -void ParaWin::SetEdFocus(USHORT no) +void ParaWin::SetEdFocus(sal_uInt16 no) { UpdateArgDesc(no); if(no<4 && no<aParaArray.size()) @@ -362,7 +362,7 @@ void ParaWin::SetEdFocus(USHORT no) } -void ParaWin::InitArgInput( USHORT nPos, FixedText& rFtArg, ImageButton& rBtnFx, +void ParaWin::InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx, ArgEdit& rEdArg, RefButton& rRefBtn) { @@ -385,7 +385,7 @@ void ParaWin::ClearAll() SetArgumentOffset(0); } -void ParaWin::SetArgumentOffset(USHORT nOffset) +void ParaWin::SetArgumentOffset(sal_uInt16 nOffset) { DelParaArray(); aSlider.SetThumbPos(0); @@ -425,8 +425,8 @@ void ParaWin::SetArgumentOffset(USHORT nOffset) void ParaWin::UpdateParas() { - USHORT i; - USHORT nOffset = GetSliderPos(); + sal_uInt16 i; + sal_uInt16 nOffset = GetSliderPos(); if ( nArgs > 0 ) { @@ -441,19 +441,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 ); } @@ -462,9 +462,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 ); } @@ -491,9 +491,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]) { @@ -513,9 +513,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]) { @@ -537,9 +537,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]) { @@ -569,9 +569,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.hrc b/formula/source/ui/dlg/parawin.hrc index e7ef4c43c5b6..e7ef4c43c5b6 100644..100755 --- a/formula/source/ui/dlg/parawin.hrc +++ b/formula/source/ui/dlg/parawin.hrc diff --git a/formula/source/ui/dlg/parawin.hxx b/formula/source/ui/dlg/parawin.hxx index 55c92e5ff436..e8c031857c20 100644..100755 --- a/formula/source/ui/dlg/parawin.hxx +++ b/formula/source/ui/dlg/parawin.hxx @@ -58,10 +58,10 @@ private: Link aFxLink; Link aArgModifiedLink; - ::std::vector<USHORT> aVisibleArgMapping; + ::std::vector<sal_uInt16> aVisibleArgMapping; const IFunctionDescription* pFuncDesc; IControlReferenceHandler* pMyParent; - USHORT nArgs; // unsuppressed arguments + sal_uInt16 nArgs; // unsuppressed arguments Font aFntBold; Font aFntLight; @@ -69,33 +69,33 @@ private: FixedText aFtArgName; FixedInfo aFtArgDesc; + ImageButton aBtnFx1; FixedText aFtArg1; - FixedText aFtArg2; - FixedText aFtArg3; - FixedText aFtArg4; + ArgEdit aEdArg1; + RefButton aRefBtn1; - ImageButton aBtnFx1; ImageButton aBtnFx2; - ImageButton aBtnFx3; - ImageButton aBtnFx4; - - ArgEdit aEdArg1; + FixedText aFtArg2; ArgEdit aEdArg2; + RefButton aRefBtn2; + + ImageButton aBtnFx3; + FixedText aFtArg3; ArgEdit aEdArg3; - ArgEdit aEdArg4; + RefButton aRefBtn3; - RefButton aRefBtn1; - RefButton aRefBtn2; - RefButton aRefBtn3; - RefButton aRefBtn4; + ImageButton aBtnFx4; + FixedText aFtArg4; + ArgEdit aEdArg4; + RefButton aRefBtn4; 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; @@ -114,7 +114,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(); @@ -122,40 +122,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/parawin.src b/formula/source/ui/dlg/parawin.src index 8af91786d699..4126d928c4df 100644..100755 --- a/formula/source/ui/dlg/parawin.src +++ b/formula/source/ui/dlg/parawin.src @@ -68,6 +68,7 @@ TabPage RID_FORMULATAB_PARAMETER { + HelpID = "formula:TabPage:RID_FORMULATAB_PARAMETER"; Border = FALSE; Size = MAP_APPFONT( 203, 128 ); DialogControl = TRUE; @@ -119,10 +120,18 @@ TabPage RID_FORMULATAB_PARAMETER HelpId=HID_FORMULA_FAP_BTN_FX4; FXBUTTONBLOCK ( 109 ) }; - Edit ED_ARG1 { ED_ARGBLOCK ( 64 ) }; - Edit ED_ARG2 { ED_ARGBLOCK ( 79 ) }; - Edit ED_ARG3 { ED_ARGBLOCK ( 94 ) }; - Edit ED_ARG4 { ED_ARGBLOCK ( 109 ) }; + Edit ED_ARG1 { ED_ARGBLOCK ( 64 ) + HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG1"; + }; + Edit ED_ARG2 { ED_ARGBLOCK ( 79 ) + HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG2"; + }; + Edit ED_ARG3 { ED_ARGBLOCK ( 94 ) + HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG3"; + }; + Edit ED_ARG4 { ED_ARGBLOCK ( 109 ) + HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG4"; + }; ImageButton RB_ARG1 { diff --git a/formula/source/ui/dlg/structpg.cxx b/formula/source/ui/dlg/structpg.cxx index 537b0ec6b720..b1e8786ccf6b 100644..100755 --- a/formula/source/ui/dlg/structpg.cxx +++ b/formula/source/ui/dlg/structpg.cxx @@ -50,7 +50,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(); @@ -62,37 +62,37 @@ StructListBox::StructListBox(Window* pParent, const ResId& rResId ): SvLBoxEntry* StructListBox::InsertStaticEntry( const XubString& rText, const Image& rEntryImg, - 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 ); 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(); } @@ -107,7 +107,7 @@ StructPage::StructPage(Window* pParent): maImgError ( ModuleRes( BMP_STR_ERROR ) ), pSelectedToken ( NULL ) { - aTlbStruct.SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN| + aTlbStruct.SetStyle(aTlbStruct.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN| WB_HASBUTTONS|WB_HSCROLL|WB_NOINITIALSELECTION); aTlbStruct.SetNodeDefaultImages(); @@ -121,20 +121,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, pParent, nPos, pIFormulaToken ); diff --git a/formula/source/ui/dlg/structpg.hxx b/formula/source/ui/dlg/structpg.hxx index 6146e2bca535..3cceca618205 100644..100755 --- a/formula/source/ui/dlg/structpg.hxx +++ b/formula/source/ui/dlg/structpg.hxx @@ -50,7 +50,7 @@ class StructListBox : public SvTreeListBox { private: - BOOL bActiveFlag; + sal_Bool bActiveFlag; protected: virtual void MouseButtonDown( const MouseEvent& rMEvt ); @@ -64,11 +64,11 @@ public: const XubString& rText, const Image& rEntryImg, 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(); }; @@ -103,7 +103,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/ForResId.hrc b/formula/source/ui/inc/ForResId.hrc index bf2e4c3f750a..bf2e4c3f750a 100644..100755 --- a/formula/source/ui/inc/ForResId.hrc +++ b/formula/source/ui/inc/ForResId.hrc diff --git a/formula/source/ui/inc/ModuleHelper.hxx b/formula/source/ui/inc/ModuleHelper.hxx index 8a2ccf957d6b..37a62be5af9d 100644..100755 --- a/formula/source/ui/inc/ModuleHelper.hxx +++ b/formula/source/ui/inc/ModuleHelper.hxx @@ -89,7 +89,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 diff --git a/formula/source/ui/resource/ModuleHelper.cxx b/formula/source/ui/resource/ModuleHelper.cxx index a0c2ae61f859..a0c2ae61f859 100644..100755 --- a/formula/source/ui/resource/ModuleHelper.cxx +++ b/formula/source/ui/resource/ModuleHelper.cxx diff --git a/formula/source/ui/resource/makefile.mk b/formula/source/ui/resource/makefile.mk index fd6a5351bac2..fd6a5351bac2 100644..100755 --- a/formula/source/ui/resource/makefile.mk +++ b/formula/source/ui/resource/makefile.mk diff --git a/formula/util/for.component b/formula/util/for.component new file mode 100755 index 000000000000..99a1adfbf978 --- /dev/null +++ b/formula/util/for.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="simple.formula.FormulaOpCodeMapperObj"> + <service name="com.sun.star.sheet.FormulaOpCodeMapper"/> + </implementation> +</component> diff --git a/formula/util/hh.html b/formula/util/hh.html index bf2b04ac3fec..bf2b04ac3fec 100644..100755 --- a/formula/util/hh.html +++ b/formula/util/hh.html diff --git a/formula/util/hidother.src b/formula/util/hidother.src index 8cf49660e919..09a79b694e87 100644..100755 --- a/formula/util/hidother.src +++ b/formula/util/hidother.src @@ -27,10 +27,6 @@ #include "../inc/helpids.hrc" -#ifndef _SBASLTID_HRC -#include <svx/svxids.hrc> -#endif - hidspecial HID_FORMULADLG_FORMULA { HelpId = HID_FORMULADLG_FORMULA; }; hidspecial HID_FORMULA_FAP_FORMULA { HelpId = HID_FORMULA_FAP_FORMULA; }; hidspecial HID_FORMULA_FAP_STRUCT { HelpId = HID_FORMULA_FAP_STRUCT; }; diff --git a/formula/util/makefile.mk b/formula/util/makefile.mk index 7ae30b007d00..3c6f91f6073d 100644..100755 --- a/formula/util/makefile.mk +++ b/formula/util/makefile.mk @@ -136,3 +136,11 @@ RESLIB2SRSFILES=$(RES2FILELIST) .INCLUDE : target.mk + +ALLTAR : $(MISC)/for.component + +$(MISC)/for.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + for.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt for.component diff --git a/formula/util/makefile.pmk b/formula/util/makefile.pmk index db2375e91714..db2375e91714 100644..100755 --- a/formula/util/makefile.pmk +++ b/formula/util/makefile.pmk |