diff options
Diffstat (limited to 'formula/source')
-rw-r--r-- | formula/source/ui/dlg/formula.cxx | 299 |
1 files changed, 150 insertions, 149 deletions
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 7399e06a3583..ad3cbe408b6c 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -69,156 +69,157 @@ #define TOKEN_SEP 2 namespace formula { - using namespace ::com::sun::star; - - class FormulaDlg_Impl - { - public: - ::std::pair<RefButton*,RefEdit*> - RefInputStartBefore( RefEdit* pEdit, RefButton* pButton ); - void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton ); - void RefInputDoneAfter( bool bForced ); - bool CalcValue( const OUString& rStrExp, OUString& rStrResult ); - bool CalcStruct( const OUString& rStrExp); - void UpdateValues(); - void DeleteArgs(); - sal_Int32 GetFunctionPos(sal_Int32 nPos); - void ClearAllParas(); - - void MakeTree(IStructHelper* _pTree,SvTreeListEntry* pParent,FormulaToken* _pToken,long Count); - void fillTree(IStructHelper* _pTree); - void UpdateTokenArray( const OUString& rStrExp); - OUString RepairFormula(const OUString& aFormula); - void FillDialog(bool nFlag=true); - bool EditNextFunc( bool bForward, sal_Int32 nFStart=NOT_FOUND ); - void EditThisFunc(sal_Int32 nFStart); - - void StoreFormEditData(FormEditData* pEditData); - - void Update(); - void Update(const OUString& _sExp); - - void SaveArg( sal_uInt16 nEd ); - void UpdateSelection(); - void DoEnter( bool bOk ); - void FillListboxes(); - void FillControls(bool &rbNext, bool &rbPrev); - - FormulaDlgMode SetMeText(const OUString& _sText, sal_Int32 PrivStart, sal_Int32 PrivEnd, bool bMatrix, bool _bSelect, bool _bUpdate); - void SetMeText(const OUString& _sText); - bool CheckMatrix(OUString& aFormula /*IN/OUT*/); - - void SetEdSelection(); - - bool UpdateParaWin(Selection& _rSelection); - void UpdateParaWin(const Selection& _rSelection,const OUString& _sRefStr); - - void SetData(sal_Int32 nFStart, sal_Int32 nNextFStart, sal_Int32 nNextFEnd, sal_Int32& PrivStart, sal_Int32& PrivEnd); - void PreNotify( NotifyEvent& rNEvt ); - - RefEdit* GetCurrRefEdit(); - - const FormulaHelper& GetFormulaHelper() const { return m_aFormulaHelper;} - uno::Reference< sheet::XFormulaOpCodeMapper > GetFormulaOpCodeMapper() const; - - DECL_LINK( ModifyHdl, ParaWin* ); - DECL_LINK( FxHdl, ParaWin* ); - - DECL_LINK(MatrixHdl, void *); - DECL_LINK(FormulaHdl, void *); - DECL_LINK(FormulaCursorHdl, void *); - DECL_LINK( BtnHdl, PushButton* ); - DECL_LINK(DblClkHdl, void *); - DECL_LINK(FuncSelHdl, void *); - DECL_LINK(StructSelHdl, void *); - public: - mutable uno::Reference< sheet::XFormulaOpCodeMapper> m_xOpCodeMapper; - uno::Sequence< sheet::FormulaToken > m_aTokenList; - ::std::unique_ptr<FormulaTokenArray> m_pTokenArray; - mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aSpecialOpCodes; - mutable const sheet::FormulaOpCodeMapEntry* m_pSpecialOpCodesEnd; - mutable uno::Sequence< sheet::FormulaToken > m_aSeparatorsOpCodes; - mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aFunctionOpCodes; - mutable const sheet::FormulaOpCodeMapEntry* m_pFunctionOpCodesEnd; - mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aUnaryOpCodes; - mutable const sheet::FormulaOpCodeMapEntry* m_pUnaryOpCodesEnd; - mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aBinaryOpCodes; - mutable const sheet::FormulaOpCodeMapEntry* m_pBinaryOpCodesEnd; - ::std::map<FormulaToken*,sheet::FormulaToken> m_aTokenMap; - IFormulaEditorHelper* m_pHelper; - VclPtr<Dialog> m_pParent; - IControlReferenceHandler* m_pDlg; - VclPtr<TabControl> m_pTabCtrl; - VclPtr<VclVBox> m_pParaWinBox; - VclPtr<ParaWin> pParaWin; - VclPtr<FixedText> m_pFtHeadLine; - VclPtr<FixedText> m_pFtFuncName; - VclPtr<FixedText> m_pFtFuncDesc; - - VclPtr<FixedText> m_pFtEditName; - - VclPtr<FixedText> m_pFtResult; - VclPtr<Edit> m_pWndResult; - - VclPtr<FixedText> m_pFtFormula; - VclPtr<EditBox> m_pMEFormula; - - VclPtr<CheckBox> m_pBtnMatrix; - VclPtr<CancelButton> m_pBtnCancel; - - VclPtr<PushButton> m_pBtnBackward; - VclPtr<PushButton> m_pBtnForward; - VclPtr<OKButton> m_pBtnEnd; - - VclPtr<RefEdit> m_pEdRef; - VclPtr<RefButton> m_pRefBtn; - - VclPtr<FixedText> m_pFtFormResult; - VclPtr<Edit> m_pWndFormResult; - - VclPtr<RefEdit> pTheRefEdit; - VclPtr<RefButton> pTheRefButton; - VclPtr<FuncPage> pFuncPage; - VclPtr<StructPage> pStructPage; - OUString aOldFormula; - bool bStructUpdate; - VclPtr<MultiLineEdit> pMEdit; - bool bUserMatrixFlag; - Idle aIdle; - - const OUString aTitle1; - const OUString aTitle2; - const OUString aTxtEnd; - OUString aTxtOk; // behind aBtnEnd - FormulaHelper m_aFormulaHelper; - - OString m_aEditHelpId; - - OString aOldHelp; - OString aOldUnique; - OString aActivWinId; - bool bIsShutDown; - bool bMakingTree; //in method of constructing tree - - vcl::Font aFntBold; - vcl::Font aFntLight; - sal_uInt16 nEdFocus; - bool bEditFlag; - const IFunctionDescription* pFuncDesc; - sal_Int32 nArgs; - ::std::vector< OUString > m_aArguments; - Selection aFuncSel; - - FormulaDlg_Impl(Dialog* pParent - , bool _bSupportFunctionResult - , bool _bSupportResult - , bool _bSupportMatrix - ,IFormulaEditorHelper* _pHelper - ,const IFunctionManager* _pFunctionMgr - ,IControlReferenceHandler* _pDlg); - ~FormulaDlg_Impl(); - }; +using namespace ::com::sun::star; + +class FormulaDlg_Impl +{ +public: + ::std::pair<RefButton*,RefEdit*> + RefInputStartBefore( RefEdit* pEdit, RefButton* pButton ); + void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton ); + void RefInputDoneAfter( bool bForced ); + bool CalcValue( const OUString& rStrExp, OUString& rStrResult ); + bool CalcStruct( const OUString& rStrExp); + void UpdateValues(); + void DeleteArgs(); + sal_Int32 GetFunctionPos(sal_Int32 nPos); + void ClearAllParas(); + + void MakeTree(IStructHelper* _pTree,SvTreeListEntry* pParent,FormulaToken* _pToken,long Count); + void fillTree(IStructHelper* _pTree); + void UpdateTokenArray( const OUString& rStrExp); + OUString RepairFormula(const OUString& aFormula); + void FillDialog(bool nFlag=true); + bool EditNextFunc( bool bForward, sal_Int32 nFStart=NOT_FOUND ); + void EditThisFunc(sal_Int32 nFStart); + + void StoreFormEditData(FormEditData* pEditData); + + void Update(); + void Update(const OUString& _sExp); + + void SaveArg( sal_uInt16 nEd ); + void UpdateSelection(); + void DoEnter( bool bOk ); + void FillListboxes(); + void FillControls(bool &rbNext, bool &rbPrev); + + FormulaDlgMode SetMeText(const OUString& _sText, sal_Int32 PrivStart, sal_Int32 PrivEnd, bool bMatrix, bool _bSelect, bool _bUpdate); + void SetMeText(const OUString& _sText); + bool CheckMatrix(OUString& aFormula /*IN/OUT*/); + + void SetEdSelection(); + + bool UpdateParaWin(Selection& _rSelection); + void UpdateParaWin(const Selection& _rSelection,const OUString& _sRefStr); + + void SetData(sal_Int32 nFStart, sal_Int32 nNextFStart, sal_Int32 nNextFEnd, sal_Int32& PrivStart, sal_Int32& PrivEnd); + void PreNotify( NotifyEvent& rNEvt ); + + RefEdit* GetCurrRefEdit(); + + const FormulaHelper& GetFormulaHelper() const { return m_aFormulaHelper;} + uno::Reference< sheet::XFormulaOpCodeMapper > GetFormulaOpCodeMapper() const; + + DECL_LINK( ModifyHdl, ParaWin* ); + DECL_LINK( FxHdl, ParaWin* ); + + DECL_LINK(MatrixHdl, void *); + DECL_LINK(FormulaHdl, void *); + DECL_LINK(FormulaCursorHdl, void *); + DECL_LINK( BtnHdl, PushButton* ); + DECL_LINK(DblClkHdl, void *); + DECL_LINK(FuncSelHdl, void *); + DECL_LINK(StructSelHdl, void *); +public: + mutable uno::Reference< sheet::XFormulaOpCodeMapper> m_xOpCodeMapper; + uno::Sequence< sheet::FormulaToken > m_aTokenList; + ::std::unique_ptr<FormulaTokenArray> m_pTokenArray; + mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aSpecialOpCodes; + mutable const sheet::FormulaOpCodeMapEntry* m_pSpecialOpCodesEnd; + mutable uno::Sequence< sheet::FormulaToken > m_aSeparatorsOpCodes; + mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aFunctionOpCodes; + mutable const sheet::FormulaOpCodeMapEntry* m_pFunctionOpCodesEnd; + mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aUnaryOpCodes; + mutable const sheet::FormulaOpCodeMapEntry* m_pUnaryOpCodesEnd; + mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aBinaryOpCodes; + mutable const sheet::FormulaOpCodeMapEntry* m_pBinaryOpCodesEnd; + ::std::map<FormulaToken*,sheet::FormulaToken> m_aTokenMap; + IFormulaEditorHelper* m_pHelper; + VclPtr<Dialog> m_pParent; + IControlReferenceHandler* m_pDlg; + VclPtr<TabControl> m_pTabCtrl; + VclPtr<VclVBox> m_pParaWinBox; + VclPtr<ParaWin> pParaWin; + VclPtr<FixedText> m_pFtHeadLine; + VclPtr<FixedText> m_pFtFuncName; + VclPtr<FixedText> m_pFtFuncDesc; + + VclPtr<FixedText> m_pFtEditName; + + VclPtr<FixedText> m_pFtResult; + VclPtr<Edit> m_pWndResult; + + VclPtr<FixedText> m_pFtFormula; + VclPtr<EditBox> m_pMEFormula; + + VclPtr<CheckBox> m_pBtnMatrix; + VclPtr<CancelButton> m_pBtnCancel; + + VclPtr<PushButton> m_pBtnBackward; + VclPtr<PushButton> m_pBtnForward; + VclPtr<OKButton> m_pBtnEnd; + + VclPtr<RefEdit> m_pEdRef; + VclPtr<RefButton> m_pRefBtn; + + VclPtr<FixedText> m_pFtFormResult; + VclPtr<Edit> m_pWndFormResult; + + VclPtr<RefEdit> pTheRefEdit; + VclPtr<RefButton> pTheRefButton; + VclPtr<FuncPage> pFuncPage; + VclPtr<StructPage> pStructPage; + OUString aOldFormula; + bool bStructUpdate; + VclPtr<MultiLineEdit> pMEdit; + bool bUserMatrixFlag; + Idle aIdle; + + const OUString aTitle1; + const OUString aTitle2; + const OUString aTxtEnd; + OUString aTxtOk; // behind aBtnEnd + FormulaHelper m_aFormulaHelper; + + OString m_aEditHelpId; + + OString aOldHelp; + OString aOldUnique; + OString aActivWinId; + bool bIsShutDown; + bool bMakingTree; //in method of constructing tree + + vcl::Font aFntBold; + vcl::Font aFntLight; + sal_uInt16 nEdFocus; + bool bEditFlag; + const IFunctionDescription* pFuncDesc; + sal_Int32 nArgs; + ::std::vector< OUString > m_aArguments; + Selection aFuncSel; + + FormulaDlg_Impl(Dialog* pParent + , bool _bSupportFunctionResult + , bool _bSupportResult + , bool _bSupportMatrix + ,IFormulaEditorHelper* _pHelper + ,const IFunctionManager* _pFunctionMgr + ,IControlReferenceHandler* _pDlg); + ~FormulaDlg_Impl(); + +}; FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent , bool _bSupportFunctionResult |