diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-08 10:47:13 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-08 10:47:13 +0000 |
commit | 87307aba9e8dbca16672e6df701d9f905b9e1786 (patch) | |
tree | c4c94029c34c3a5dc7e0ed2d6cee8cebc5d31e6b /sc/source/ui/inc | |
parent | b142ca03365a5a5bfd8487fda9bfeea2e6db0d0b (diff) |
CWS-TOOLING: integrate CWS frmdlg
2008-12-18 09:13:09 +0100 oj r265667 : merge from odff05
2008-12-18 07:58:16 +0100 oj r265658 : #i94555# patch from <regina>, ODFF:
Add GAMMA, CHISQDIST, CHISQINV.
Make the 'cumulative' parameter of GAMMADIST optional.
Adapt the domain of CHIDIST to allow negative x.
Remove the constraint "degrees of freedom < 1.0E5" from CHIDIST and CHIINV.
Plus a mechanism to write the now optional parameter of GAMMADIST to PODF and
ODFF if omitted, for backwards compatibility.
2008-12-15 14:06:11 +0100 oj r265490 : CWS-TOOLING: rebase CWS frmdlg to trunk@264807 (milestone: DEV300:m37)
2008-12-15 13:55:28 +0100 oj r265488 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:55:07 +0100 oj r265487 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:48 +0100 oj r265486 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:36 +0100 oj r265485 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:24 +0100 oj r265484 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:48:11 +0100 oj r265483 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:31:12 +0100 oj r265479 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:13:58 +0100 oj r265477 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:10:09 +0100 oj r265476 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:05:11 +0100 oj r265475 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:47:17 +0100 oj r265467 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:46:19 +0100 oj r265466 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:45:47 +0100 oj r265465 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 07:35:07 +0100 oj r265458 : add dependency to formula
2008-12-15 07:34:24 +0100 oj r265457 : add dependency to formula
2008-12-12 13:22:00 +0100 msc r265413 : #i97089#
2008-12-12 13:20:25 +0100 msc r265412 : #i97089#
2008-12-12 12:35:12 +0100 msc r265406 : #i97089#
2008-12-12 12:34:16 +0100 msc r265405 : #i97089#
2008-12-12 12:33:05 +0100 msc r265404 : #i97089#
2008-12-12 12:31:11 +0100 msc r265403 : #i97089#
2008-12-08 11:59:10 +0100 oj r264981 : insert RTL_LOG
2008-12-08 11:50:17 +0100 oj r264980 : some small changes
2008-12-05 12:57:57 +0100 oj r264902 : eof changed
2008-12-05 12:56:46 +0100 oj r264901 : eof changed
2008-12-05 12:28:47 +0100 oj r264899 : wrong var used
2008-12-05 10:08:57 +0100 oj r264890 : token order reversed
2008-12-04 13:49:22 +0100 oc r264843 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:45:27 +0100 oc r264842 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:42:54 +0100 oc r264841 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:37:41 +0100 oc r264840 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:34:11 +0100 oc r264839 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 12:35:31 +0100 oj r264835 : new help ids for struct and function tabpage
2008-12-04 12:00:35 +0100 oj r264828 : set explicit help id
2008-12-03 14:53:27 +0100 oj r264786 : #i96845# change ref button
2008-12-03 14:51:49 +0100 oj r264785 : #i96845# change ref button
2008-12-03 08:51:57 +0100 oj r264746 : convert dos to unix lineends
2008-12-03 08:50:45 +0100 oj r264745 : convert dos to unix lineends
2008-12-03 08:50:05 +0100 oj r264744 : convert dos to unix lineends
2008-12-02 12:28:33 +0100 oj r264686 : clear help text when new helpid is set
2008-12-02 12:28:02 +0100 oj r264685 : set help id for listbox category
2008-12-02 07:15:56 +0100 oj r264655 : remove define to auto generate help ids
2008-12-01 14:36:43 +0100 oj r264604 : use temp var
2008-12-01 14:18:31 +0100 oj r264601 : moved ScJumpToken to formula
2008-12-01 14:18:11 +0100 oj r264600 : moved ScJumpToken to formula
2008-12-01 14:14:35 +0100 oj r264599 : moved ScJumpToken from sc
2008-12-01 10:48:51 +0100 oj r264589 : change quickhelptext from Shrink to Select
2008-12-01 10:28:41 +0100 oj r264588 : fix opcode data, has to be Any.Void
2008-11-28 11:16:48 +0100 oj r264532 : add help ids
2008-11-28 10:16:56 +0100 oj r264529 : set help id
2008-11-28 10:16:43 +0100 oj r264528 : set help id
2008-11-26 13:55:04 +0100 oj r264381 : #94535# use of optional instead of deleting a string myself and some small changes
2008-11-26 09:53:20 +0100 oj r264346 : compile error with debug/without debug
2008-11-25 07:41:28 +0100 oj r264271 : put static into the method which make use of them
2008-11-24 08:16:07 +0100 oj r264196 : removed not needed classes for op code
2008-11-24 08:13:44 +0100 oj r264195 : removed not needed classes for op code
2008-11-21 14:05:53 +0100 oj r264135 : make GetOpCode inline
2008-11-21 12:35:27 +0100 oj r264124 : hold symbols
2008-11-20 09:27:27 +0100 oj r264028 : merged code from DEV300_m35 which got lost
2008-11-19 20:42:12 +0100 oj r264022 : more changes for formula dialog remove
2008-11-19 20:37:41 +0100 oj r264021 : removed unused var
2008-11-19 20:35:35 +0100 oj r264020 : some more changes at token
2008-11-19 10:59:47 +0100 oj r263967 : deleted
2008-11-19 10:58:24 +0100 oj r263966 : add forui and for res files
2008-11-18 15:27:36 +0100 oj r263777 : unused para removed
2008-11-18 15:23:23 +0100 oj r263775 : add insert button to add field dlg
2008-11-18 13:39:53 +0100 oj r263764 : enable the formula dialog as well for conditional print as for conditional formatting
2008-11-18 12:03:25 +0100 oj r263760 : rename isRef in IsRef
2008-11-17 11:46:16 +0100 oj r263711 : patches for function handling
2008-11-17 11:36:22 +0100 oj r263710 : add new for forui and res file
2008-11-17 09:21:12 +0100 oj r263704 : patches for some resource for libformula
2008-11-15 12:45:30 +0100 oj r263701 : changes for formula editor extraction
2008-11-07 08:23:27 +0100 oj r263416 : merge from DEV300:m35
2008-11-07 08:22:35 +0100 oj r263415 : merge from DEV300:m35
2008-11-07 08:22:16 +0100 oj r263414 : merge from DEV300:m35
2008-11-07 08:21:41 +0100 oj r263413 : merge from DEV300:m35
2008-11-07 08:21:31 +0100 oj r263412 : merge from DEV300:m35
2008-11-07 08:20:38 +0100 oj r263411 : merge from DEV300:m35
2008-11-07 08:20:00 +0100 oj r263410 : merge from DEV300:m35
2008-11-07 08:18:50 +0100 oj r263409 : merge from DEV300:m35
2008-11-07 08:18:19 +0100 oj r263408 : merge from DEV300:m35
2008-11-07 08:10:27 +0100 oj r263407 : merge from DEV300:m35
2008-10-21 07:43:46 +0200 oj r262560 : some compile errors resolved
2008-10-17 16:40:01 +0200 oj r262291 : dep for 1st target
2008-10-07 10:08:39 +0200 oj r262077 : copy
2008-10-07 09:45:31 +0200 oj r262076 : #i94535#
2008-10-07 09:44:26 +0200 oj r262075 : #i94535# new base class
2008-10-07 09:43:21 +0200 oj r262074 : moved to formula
2008-10-07 09:41:51 +0200 oj r262073 : new images
2008-10-07 09:03:01 +0200 oj r262072 : new ids for formula
2008-10-02 08:46:27 +0200 oj r262024 : #i94535# move the formula compiler to formula
2008-10-02 08:08:54 +0200 oj r262023 : #i94535#
2008-10-02 08:06:28 +0200 oj r262022 : #i94535#
2008-10-02 08:05:52 +0200 oj r262021 : #i94535#
2008-10-01 17:15:29 +0200 oj r262014 : #i94535#
2008-10-01 17:12:40 +0200 oj r262013 : new module formula
2008-10-01 17:04:55 +0200 oj r262012 : #i94535#
2008-10-01 16:49:03 +0200 oj r262010 : #i94535#
2008-10-01 16:46:59 +0200 oj r262009 : #i94535#
Diffstat (limited to 'sc/source/ui/inc')
25 files changed, 303 insertions, 517 deletions
diff --git a/sc/source/ui/inc/IAnyRefDialog.hxx b/sc/source/ui/inc/IAnyRefDialog.hxx new file mode 100644 index 000000000000..bd115b2ad1c0 --- /dev/null +++ b/sc/source/ui/inc/IAnyRefDialog.hxx @@ -0,0 +1,67 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: formula.hxx,v $ + * $Revision: 1.5 $ + * + * 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. + * + ************************************************************************/ +#ifndef SC_IANYREFDIALOG_HXX_INCLUDED +#define SC_IANYREFDIALOG_HXX_INCLUDED + +#include <formula/IControlReferenceHandler.hxx> + +class ScRange; +class ScDocument; +class ScTabViewShell; +class SfxObjectShell; +namespace formula +{ + class RefEdit; + class RefButton; +} +class SAL_NO_VTABLE IAnyRefDialog : public formula::IControlReferenceHandler +{ +public: + virtual ~IAnyRefDialog(){} + + //virtual void ShowReference(const String& _sRef) = 0; + //virtual void HideReference( BOOL bDoneRefMode = TRUE ) = 0; + //virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) = 0; + //virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) = 0; + + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) = 0; + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) = 0; + virtual void RefInputDone( BOOL bForced = FALSE ) = 0; + virtual BOOL IsTableLocked() const = 0; + virtual BOOL IsRefInputMode() const = 0; + + virtual BOOL IsDocAllowed( SfxObjectShell* pDocSh ) const = 0; + virtual void AddRefEntry() = 0; + virtual void SetActive() = 0; + virtual void ViewShellChanged( ScTabViewShell* pScViewShell ) = 0; +}; + +#endif // SC_IANYREFDIALOG_HXX_INCLUDED diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index c95a75a6ec8f..74621d3ced41 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -42,121 +42,98 @@ #endif #include <sfx2/basedlgs.hxx> #include "address.hxx" +#include "formula/funcutl.hxx" +#include "IAnyRefDialog.hxx" +#include <memory> class SfxObjectShell; class ScRange; class ScDocument; class ScTabViewShell; class ScAnyRefDlg; -class ScRefButton; class ScFormulaCell; class ScCompiler; class ScRangeList; -//============================================================================ - -class ScRefEdit : public Edit +class ScFormulaReferenceHelper { -private: - Timer aTimer; - ScAnyRefDlg* pAnyRefDlg; // parent dialog - BOOL bSilentFocus; // for SilentGrabFocus() - - DECL_LINK( UpdateHdl, Timer* ); - -protected: - virtual void KeyInput( const KeyEvent& rKEvt ); - virtual void GetFocus(); - virtual void LoseFocus(); - -public: - ScRefEdit( ScAnyRefDlg* pParent, const ResId& rResId ); - ScRefEdit( Window* pParent, const ResId& rResId ); - virtual ~ScRefEdit(); - - void SetRefString( const XubString& rStr ); - using Edit::SetText; - virtual void SetText( const XubString& rStr ); - virtual void Modify(); - - void StartUpdateData(); - -//UNUSED2008-05 void SilentGrabFocus(); // does not update any references - - void SetRefDialog( ScAnyRefDlg* pDlg ); - inline ScAnyRefDlg* GetRefDialog() { return pAnyRefDlg; } -}; + IAnyRefDialog* m_pDlg; + ::std::auto_ptr<ScFormulaCell> pRefCell; + ::std::auto_ptr<ScCompiler> pRefComp; + formula::RefEdit* pRefEdit; // aktives Eingabefeld + formula::RefButton* pRefBtn; // Button dazu + Window* m_pWindow; + SfxBindings* m_pBindings; + ::std::auto_ptr<Accelerator> + pAccel; // fuer Enter/Escape + BOOL* pHiddenMarks; // Merkfeld fuer versteckte Controls + SCTAB nRefTab; // used for ShowReference -//============================================================================ + String sOldDialogText; // Originaltitel des Dialogfensters + Size aOldDialogSize; // Originalgroesse Dialogfenster + Point aOldEditPos; // Originalposition des Eingabefeldes + Size aOldEditSize; // Originalgroesse des Eingabefeldes + Point aOldButtonPos; // Originalpositiuon des Buttons -class ScRefButton : public ImageButton -{ -private: - Image aImgRefStart; /// Start reference input - Image aImgRefStartHC; /// Start reference input (high contrast) - Image aImgRefDone; /// Stop reference input - Image aImgRefDoneHC; /// Stop reference input (high contrast) - ScAnyRefDlg* pAnyRefDlg; // parent dialog - ScRefEdit* pRefEdit; // zugeordnetes Edit-Control + BOOL bEnableColorRef; + BOOL bHighLightRef; + BOOL bAccInserted; -protected: - virtual void Click(); - virtual void KeyInput( const KeyEvent& rKEvt ); - virtual void GetFocus(); - virtual void LoseFocus(); + DECL_LINK( AccelSelectHdl, Accelerator* ); public: - ScRefButton( ScAnyRefDlg* pParent, const ResId& rResId, ScRefEdit* pEdit ); - ScRefButton( Window* pParent, const ResId& rResId ); + ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindings* _pBindings); + ~ScFormulaReferenceHelper(); - void SetReferences( ScAnyRefDlg* pDlg, ScRefEdit* pEdit ); + void ShowSimpleReference( const XubString& rStr ); + void ShowFormulaReference( const XubString& rStr ); + bool ParseWithNames( ScRangeList& rRanges, const String& rStr, ScDocument* pDoc ); + void Init(); - void SetStartImage(); - void SetEndImage(); - inline void DoRef() { Click(); } -}; + void ShowReference( const XubString& rStr ); + void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + void HideReference( BOOL bDoneRefMode = TRUE ); + void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + void RefInputDone( BOOL bForced = FALSE ); + void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + inline void SetWindow(Window* _pWindow) { m_pWindow = _pWindow; } + BOOL DoClose( USHORT nId ); + void SetDispatcherLock( BOOL bLock ); + void EnableSpreadsheets( BOOL bFlag = TRUE, BOOL bChilds = TRUE ); + void ViewShellChanged( ScTabViewShell* pScViewShell ); + static void enableInput(BOOL _bInput); +}; //============================================================================ -class ScAnyRefDlg : public SfxModelessDialog +class ScAnyRefDlg : public SfxModelessDialog, + public IAnyRefDialog { - friend class ScRefButton; - friend class ScRefEdit; + friend class formula::RefButton; + friend class formula::RefEdit; private: + ScFormulaReferenceHelper + m_aHelper; SfxBindings* pMyBindings; - ScRefEdit* pRefEdit; // aktives Eingabefeld - ScRefButton* pRefBtn; // Button dazu - String sOldDialogText; // Originaltitel des Dialogfensters - Size aOldDialogSize; // Originalgroesse Dialogfenster - Point aOldEditPos; // Originalposition des Eingabefeldes - Size aOldEditSize; // Originalgroesse des Eingabefeldes - Point aOldButtonPos; // Originalpositiuon des Buttons - BOOL* pHiddenMarks; // Merkfeld fuer versteckte Controls - Accelerator* pAccel; // fuer Enter/Escape - BOOL bAccInserted; - BOOL bHighLightRef; - BOOL bEnableColorRef; - ScFormulaCell* pRefCell; - ScCompiler* pRefComp; + Window* pActiveWin; Timer aTimer; String aDocName; // document on which the dialog was opened - SCTAB nRefTab; // used for ShowReference DECL_LINK( UpdateFocusHdl, Timer* ); - DECL_LINK( AccelSelectHdl, Accelerator* ); + protected: - BOOL DoClose( USHORT nId ); + virtual BOOL DoClose( USHORT nId ); void EnableSpreadsheets( BOOL bFlag = TRUE, BOOL bChilds = TRUE ); void SetDispatcherLock( BOOL bLock ); virtual long PreNotify( NotifyEvent& rNEvt ); - virtual void RefInputStart( ScRefEdit* pEdit, ScRefButton* pButton = NULL ); + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); virtual void RefInputDone( BOOL bForced = FALSE ); void ShowSimpleReference( const XubString& rStr ); void ShowFormulaReference( const XubString& rStr ); @@ -175,13 +152,13 @@ public: virtual BOOL IsTableLocked() const; virtual BOOL IsDocAllowed( SfxObjectShell* pDocSh ) const; - void ShowReference( const XubString& rStr ); - void HideReference( BOOL bDoneRefMode = TRUE ); + virtual void ShowReference( const XubString& rStr ); + virtual void HideReference( BOOL bDoneRefMode = TRUE ); - void ToggleCollapsed( ScRefEdit* pEdit, ScRefButton* pButton = NULL ); - void ReleaseFocus( ScRefEdit* pEdit, ScRefButton* pButton = NULL ); + virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); - void ViewShellChanged( ScTabViewShell* pScViewShell ); + virtual void ViewShellChanged( ScTabViewShell* pScViewShell ); void SwitchToDocument(); SfxBindings& GetBindings(); diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx index 5437db2e0dc3..9b7e7234123e 100644 --- a/sc/source/ui/inc/areasdlg.hxx +++ b/sc/source/ui/inc/areasdlg.hxx @@ -67,25 +67,25 @@ public: private: ListBox aLbPrintArea; FixedLine aFlPrintArea; - ScRefEdit aEdPrintArea; - ScRefButton aRbPrintArea; + formula::RefEdit aEdPrintArea; + formula::RefButton aRbPrintArea; ListBox aLbRepeatRow; FixedLine aFlRepeatRow; - ScRefEdit aEdRepeatRow; - ScRefButton aRbRepeatRow; + formula::RefEdit aEdRepeatRow; + formula::RefButton aRbRepeatRow; ListBox aLbRepeatCol; FixedLine aFlRepeatCol; - ScRefEdit aEdRepeatCol; - ScRefButton aRbRepeatCol; + formula::RefEdit aEdRepeatCol; + formula::RefButton aRbRepeatCol; OKButton aBtnOk; CancelButton aBtnCancel; HelpButton aBtnHelp; BOOL bDlgLostFocus; - ScRefEdit* pRefInputEdit; + formula::RefEdit* pRefInputEdit; ScDocument* pDoc; ScViewData* pViewData; SCTAB nCurTab; @@ -99,7 +99,7 @@ private: // Handler: DECL_LINK( Impl_SelectHdl, ListBox* ); - DECL_LINK( Impl_ModifyHdl, ScRefEdit* ); + DECL_LINK( Impl_ModifyHdl, formula::RefEdit* ); DECL_LINK( Impl_BtnHdl, PushButton* ); DECL_LINK( Impl_GetFocusHdl, Control* ); #endif diff --git a/sc/source/ui/inc/condfrmt.hxx b/sc/source/ui/inc/condfrmt.hxx index 66bcae715631..4e74bc6cb5db 100644 --- a/sc/source/ui/inc/condfrmt.hxx +++ b/sc/source/ui/inc/condfrmt.hxx @@ -64,11 +64,11 @@ private: CheckBox aCbxCond1; ListBox aLbCond11; ListBox aLbCond12; - ScRefEdit aEdtCond11; - ScRefButton aRbCond11; + formula::RefEdit aEdtCond11; + formula::RefButton aRbCond11; FixedText aFtCond1And; - ScRefEdit aEdtCond12; - ScRefButton aRbCond12; + formula::RefEdit aEdtCond12; + formula::RefButton aRbCond12; FixedText aFtCond1Template; ListBox aLbCond1Template; FixedLine aFlSep1; @@ -76,11 +76,11 @@ private: CheckBox aCbxCond2; ListBox aLbCond21; ListBox aLbCond22; - ScRefEdit aEdtCond21; - ScRefButton aRbCond21; + formula::RefEdit aEdtCond21; + formula::RefButton aRbCond21; FixedText aFtCond2And; - ScRefEdit aEdtCond22; - ScRefButton aRbCond22; + formula::RefEdit aEdtCond22; + formula::RefButton aRbCond22; FixedText aFtCond2Template; ListBox aLbCond2Template; FixedLine aFlSep2; @@ -88,11 +88,11 @@ private: CheckBox aCbxCond3; ListBox aLbCond31; ListBox aLbCond32; - ScRefEdit aEdtCond31; - ScRefButton aRbCond31; + formula::RefEdit aEdtCond31; + formula::RefButton aRbCond31; FixedText aFtCond3And; - ScRefEdit aEdtCond32; - ScRefButton aRbCond32; + formula::RefEdit aEdtCond32; + formula::RefButton aRbCond32; FixedText aFtCond3Template; ListBox aLbCond3Template; @@ -124,7 +124,7 @@ private: Size aCond3Size2; Size aCond3Size3; - ScRefEdit* pEdActive; + formula::RefEdit* pEdActive; BOOL bDlgLostFocus; ScDocument* pDoc; diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx index ff7f98a8fdbf..a4db4575f64d 100644 --- a/sc/source/ui/inc/consdlg.hxx +++ b/sc/source/ui/inc/consdlg.hxx @@ -80,13 +80,13 @@ private: ListBox aLbDataArea; FixedText aFtDataArea; - ScRefEdit aEdDataArea; - ScRefButton aRbDataArea; + formula::RefEdit aEdDataArea; + formula::RefButton aRbDataArea; ListBox aLbDestArea; FixedText aFtDestArea; - ScRefEdit aEdDestArea; - ScRefButton aRbDestArea; + formula::RefEdit aEdDestArea; + formula::RefButton aRbDestArea; FixedLine aFlConsBy; CheckBox aBtnByRow; @@ -113,19 +113,19 @@ private: USHORT nAreaDataCount; USHORT nWhichCons; - ScRefEdit* pRefInputEdit; + formula::RefEdit* pRefInputEdit; BOOL bDlgLostFocus; #ifdef _CONSDLG_CXX private: void Init (); void FillAreaLists (); - BOOL VerifyEdit ( ScRefEdit* pEd ); + BOOL VerifyEdit ( formula::RefEdit* pEd ); DECL_LINK( OkHdl, void* ); DECL_LINK( ClickHdl, PushButton* ); DECL_LINK( GetFocusHdl, Control* ); - DECL_LINK( ModifyHdl, ScRefEdit* ); + DECL_LINK( ModifyHdl, formula::RefEdit* ); DECL_LINK( SelectHdl, ListBox* ); ScSubTotalFunc LbPosToFunc( USHORT nPos ); diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx index 12f0ef9fc269..5ae033947b2f 100644 --- a/sc/source/ui/inc/crnrdlg.hxx +++ b/sc/source/ui/inc/crnrdlg.hxx @@ -61,13 +61,13 @@ private: FixedLine aFlAssign; ListBox aLbRange; - ScRefEdit aEdAssign; - ScRefButton aRbAssign; + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; RadioButton aBtnColHead; RadioButton aBtnRowHead; FixedText aFtAssign2; - ScRefEdit aEdAssign2; - ScRefButton aRbAssign2; + formula::RefEdit aEdAssign2; + formula::RefButton aRbAssign2; OKButton aBtnOk; CancelButton aBtnCancel; @@ -85,7 +85,7 @@ private: NameRangeMap aRangeMap; ScViewData* pViewData; ScDocument* pDoc; - ScRefEdit* pEdActive; + formula::RefEdit* pEdActive; BOOL bDlgLostFocus; #ifdef _CRNRDLG_CXX diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx index d680e65de014..d8d6e34a0885 100644 --- a/sc/source/ui/inc/dbnamdlg.hxx +++ b/sc/source/ui/inc/dbnamdlg.hxx @@ -70,8 +70,8 @@ private: ComboBox aEdName; FixedLine aFlAssign; - ScRefEdit aEdAssign; - ScRefButton aRbAssign; + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; FixedLine aFlOptions; CheckBox aBtnHeader; diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx index b45a3d6825de..103d17c9dd8d 100644 --- a/sc/source/ui/inc/docfunc.hxx +++ b/sc/source/ui/inc/docfunc.hxx @@ -34,7 +34,7 @@ #include <tools/link.hxx> #include "global.hxx" #include "postit.hxx" -#include "grammar.hxx" +#include "formula/grammar.hxx" class ScEditEngineDefaulter; class SfxUndoAction; @@ -90,11 +90,11 @@ public: BOOL bInterpret, BOOL bApi ); BOOL SetCellText( const ScAddress& rPos, const String& rText, BOOL bInterpret, BOOL bEnglish, BOOL bApi, - const ScGrammar::Grammar eGrammar ); + const formula::FormulaGrammar::Grammar eGrammar ); // creates a new cell for use with PutCell ScBaseCell* InterpretEnglishString( const ScAddress& rPos, const String& rText, - const ScGrammar::Grammar eGrammar ); + const formula::FormulaGrammar::Grammar eGrammar ); BOOL SetNoteText( const ScAddress& rPos, const String& rText, BOOL bApi ); @@ -120,7 +120,7 @@ public: BOOL SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL bApi ); - BOOL SetGrammar( ScGrammar::Grammar eGrammar ); + BOOL SetGrammar( formula::FormulaGrammar::Grammar eGrammar ); SC_DLLPUBLIC BOOL SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges, SCTAB nTab, ScSizeMode eMode, USHORT nSizeTwips, @@ -142,7 +142,7 @@ public: BOOL EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark, const ScTokenArray* pTokenArray, const String& rString, BOOL bApi, BOOL bEnglish, - const ScGrammar::Grammar ); + const formula::FormulaGrammar::Grammar ); BOOL TabOp( const ScRange& rRange, const ScMarkData* pTabMark, const ScTabOpParam& rParam, BOOL bRecord, BOOL bApi ); diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx index bf2db0f0fd24..068a05d57711 100644 --- a/sc/source/ui/inc/dwfunctr.hxx +++ b/sc/source/ui/inc/dwfunctr.hxx @@ -47,7 +47,6 @@ #include <vcl/combobox.hxx> #endif #include "anyrefdg.hxx" -#include "funcutl.hxx" #include "global.hxx" // ScAddress #include "privsplt.hxx" #include "funcdesc.hxx" diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx index a7a1c3f6a1ce..7b99c5d580a9 100644 --- a/sc/source/ui/inc/filtdlg.hxx +++ b/sc/source/ui/inc/filtdlg.hxx @@ -66,8 +66,8 @@ class TypedScStrCollection; CheckBox aBtnUnique; \ CheckBox aBtnCopyResult; \ ListBox aLbCopyArea; \ - ScRefEdit aEdCopyArea; \ - ScRefButton aRbCopyArea; \ + formula::RefEdit aEdCopyArea; \ + formula::RefButton aRbCopyArea; \ CheckBox aBtnDestPers; \ FixedText aFtDbAreaLabel; \ FixedInfo aFtDbArea; \ @@ -89,7 +89,7 @@ class TypedScStrCollection; aBtnCopyResult ( this, ScResId( BTN_COPY_RESULT ) ), \ aLbCopyArea ( this, ScResId( LB_COPY_AREA ) ), \ aEdCopyArea ( this, ScResId( ED_COPY_AREA ) ), \ - aRbCopyArea ( this, ScResId( RB_COPY_AREA ), &aEdCopyArea ), \ + aRbCopyArea ( this, ScResId( RB_COPY_AREA ), &aEdCopyArea, this ), \ aBtnDestPers ( this, ScResId( BTN_DEST_PERS ) ), \ aFtDbAreaLabel ( this, ScResId( FT_DBAREA_LABEL ) ), \ aFtDbArea ( this, ScResId( FT_DBAREA ) ), \ @@ -209,8 +209,8 @@ public: private: ListBox aLbFilterArea; FixedText aFtFilterArea; - ScRefEdit aEdFilterArea; - ScRefButton aRbFilterArea; + formula::RefEdit aEdFilterArea; + formula::RefButton aRbFilterArea; _COMMON_FILTER_RSCOBJS @@ -222,7 +222,7 @@ private: ScViewData* pViewData; ScDocument* pDoc; - ScRefEdit* pRefInputEdit; + formula::RefEdit* pRefInputEdit; BOOL bRefInputMode; // Hack: RefInput-Kontrolle @@ -236,7 +236,7 @@ private: // Handler DECL_LINK( FilterAreaSelHdl, ListBox* ); - DECL_LINK( FilterAreaModHdl, ScRefEdit* ); + DECL_LINK( FilterAreaModHdl, formula::RefEdit* ); DECL_LINK( EndDlgHdl, Button* ); // Hack: RefInput-Kontrolle diff --git a/sc/source/ui/inc/foptmgr.hxx b/sc/source/ui/inc/foptmgr.hxx index cee598aa51d6..424493b2506a 100644 --- a/sc/source/ui/inc/foptmgr.hxx +++ b/sc/source/ui/inc/foptmgr.hxx @@ -47,7 +47,10 @@ //---------------------------------------------------------------------------- class FixedInfo; -class ScRefButton; +namespace formula +{ + class RefButton; +} class MoreButton; class Dialog; struct ScQueryParam; @@ -71,7 +74,7 @@ public: CheckBox& refBtnDestPers, ListBox& refLbCopyArea, Edit& refEdCopyArea, - ScRefButton& refRbCopyArea, + formula::RefButton& refRbCopyArea, FixedText& refFtDbAreaLabel, FixedInfo& refFtDbArea, FixedLine& refFlOptions, @@ -95,7 +98,7 @@ private: CheckBox& rBtnDestPers; ListBox& rLbCopyPos; Edit& rEdCopyPos; - ScRefButton& rRbCopyPos; + formula::RefButton& rRbCopyPos; FixedText& rFtDbAreaLabel; FixedInfo& rFtDbArea; FixedLine& rFlOptions; diff --git a/sc/source/ui/inc/formdata.hxx b/sc/source/ui/inc/formdata.hxx index d47b7d7fb69a..c36a625543c5 100644 --- a/sc/source/ui/inc/formdata.hxx +++ b/sc/source/ui/inc/formdata.hxx @@ -33,65 +33,32 @@ #include <tools/string.hxx> #include <tools/gen.hxx> - +#include <formula/formdata.hxx> class ScInputHandler; class ScDocShell; //============================================================================ -class ScFormEditData +class ScFormEditData : public formula::FormEditData { public: ScFormEditData(); - ~ScFormEditData(); - - void SaveValues(); - BOOL HasParent() const { return pParent != NULL; } + virtual ~ScFormEditData(); - USHORT GetMode() const { return nMode; } - xub_StrLen GetFStart() const { return nFStart; } - USHORT GetCatSel() const { return nCatSel; } - USHORT GetFuncSel() const { return nFuncSel; } - USHORT GetOffset() const { return nOffset; } - USHORT GetEdFocus() const { return nEdFocus; } - const String& GetUndoStr() const { return aUndoStr; } - BOOL GetMatrixFlag()const{ return bMatrix;} - ULONG GetUniqueId()const { return nUniqueId;} - const Selection& GetSelection()const { return aSelection;} ScInputHandler* GetInputHandler() { return pInputHandler;} ScDocShell* GetDocShell() { return pScDocShell;} - void SetMode( USHORT nNew ) { nMode = nNew; } - void SetFStart( xub_StrLen nNew ) { nFStart = nNew; } - void SetCatSel( USHORT nNew ) { nCatSel = nNew; } - void SetFuncSel( USHORT nNew ) { nFuncSel = nNew; } - void SetOffset( USHORT nNew ) { nOffset = nNew; } - void SetEdFocus( USHORT nNew ) { nEdFocus = nNew; } - void SetUndoStr( const String& rNew ) { aUndoStr = rNew; } - void SetMatrixFlag(BOOL bNew) { bMatrix=bNew;} - void SetUniqueId(ULONG nNew) { nUniqueId=nNew;} - void SetSelection(const Selection& aSel) { aSelection=aSel;} void SetInputHandler(ScInputHandler* pHdl) { pInputHandler=pHdl;} void SetDocShell(ScDocShell* pSds) { pScDocShell=pSds;} + virtual void SaveValues(); private: ScFormEditData( const ScFormEditData& ); - const ScFormEditData& operator=( const ScFormEditData& r ); - void Reset(); +// const ScFormEditData& operator=( const ScFormEditData& r ); + - ScFormEditData* pParent; // fuer Verschachtelung - USHORT nMode; // enum ScFormulaDlgMode - xub_StrLen nFStart; - USHORT nCatSel; - USHORT nFuncSel; - USHORT nOffset; - USHORT nEdFocus; - String aUndoStr; - BOOL bMatrix; - ULONG nUniqueId; - Selection aSelection; ScInputHandler* pInputHandler; ScDocShell* pScDocShell; }; diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx index 3078ee1453f2..52bd475df543 100644 --- a/sc/source/ui/inc/formula.hxx +++ b/sc/source/ui/inc/formula.hxx @@ -32,7 +32,6 @@ #define SC_FORMULA_HXX #include "anyrefdg.hxx" -#include "funcutl.hxx" #include "global.hxx" // ScAddress #include <svtools/stdctrl.hxx> #ifndef _LSTBOX_HXX //autogen @@ -48,171 +47,91 @@ #include <svtools/svstdarr.hxx> #endif -#include <vcl/tabctrl.hxx> -#include "parawin.hxx" -#include <svtools/svtreebx.hxx> #include "compiler.hxx" #include "cell.hxx" -#include "funcpage.hxx" -#include "structpg.hxx" + +#include "formula/formula.hxx" +#include "IAnyRefDialog.hxx" +#include "anyrefdg.hxx" +#include <formula/IFunctionDescription.hxx> class ScViewData; class ScDocument; class ScFuncDesc; class ScInputHandler; class ScDocShell; +class SvLBoxEntry; //============================================================================ - -enum ScFormulaDlgMode { SC_FORMDLG_FORMULA, SC_FORMDLG_ARGS, SC_FORMDLG_EDIT }; - -//============================================================================ - typedef ScTabViewShell* PtrTabViewShell; - //============================================================================ -//============================================================================ - -class ScFormulaDlg : public ScAnyRefDlg +class ScFormulaDlg : public formula::FormulaDlg, + public IAnyRefDialog, + public formula::IFormulaEditorHelper { + ScFormulaReferenceHelper m_aHelper; + ScFormulaCell* pCell; + ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> m_xParser; + ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> m_xOpCodeMapper; + + static ScDocument* pDoc; + static ScAddress aCursorPos; public: ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, - Window* pParent, ScViewData* pViewData ); + Window* pParent, ScViewData* pViewData ,formula::IFunctionManager* _pFunctionMgr); ~ScFormulaDlg(); - virtual void SetReference( const ScRange& rRef, ScDocument* pRefDoc ); - virtual BOOL IsRefInputMode() const; - virtual BOOL IsDocAllowed(SfxObjectShell* pDocSh) const; - virtual void SetActive(); - virtual BOOL Close(); - -private: + // IFormulaEditorHelper + virtual void notifyChange(); + virtual void fill(); + virtual bool calculateValue(const String& _sExpression,String& _rResult); + virtual void doClose(BOOL _bOk); + virtual void insertEntryToLRUList(const formula::IFunctionDescription* pDesc); + virtual void showReference(const String& _sFormula); + virtual void dispatch(BOOL _bOK,BOOL _bMartixChecked); + virtual void setDispatcherLock( BOOL bLock ); + virtual void setReferenceInput(const formula::FormEditData* _pData); + virtual void deleteFormData(); + virtual void clear(); + virtual void switchBack(); + virtual formula::FormEditData* getFormEditData() const; + virtual void setCurrentFormula(const String& _sReplacement); + virtual void setSelection(xub_StrLen _nStart,xub_StrLen _nEnd); + virtual void getSelection(xub_StrLen& _nStart,xub_StrLen& _nEnd) const; + virtual String getCurrentFormula() const; + + virtual formula::IFunctionManager* getFunctionManager(); + virtual ::std::auto_ptr<formula::FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const; - TabControl aTabCtrl; - GroupBox aGbEdit; //! MUST be placed before aScParaWin for initializing - ScParaWin aScParaWin; - FixedText aFtHeadLine; - FixedInfo aFtFuncName; - FixedInfo aFtFuncDesc; - - FixedText aFtEditName; - //FixedInfo aFtEditDesc; - - FixedText aFtResult; - ValWnd aWndResult; - - FixedText aFtFormula; - ScEditBox aMEFormula; - - CheckBox aBtnMatrix; - HelpButton aBtnHelp; - CancelButton aBtnCancel; - - PushButton aBtnBackward; - PushButton aBtnForward; - OKButton aBtnEnd; - - ScRefEdit aEdRef; - ScRefButton aRefBtn; - - FixedText aFtFormResult; - ValWnd aWndFormResult; - - ScRefEdit* pTheRefEdit; - ScRefButton* pTheRefButton; - ScFuncPage* pScFuncPage; - ScStructPage* pScStructPage; - ScFormulaCell* pCell; - ScCompiler* pComp; - ScTokenArray* pScTokA; - String aOldFormula; - BOOL bStructUpdate; - MultiLineEdit* pMEdit; - BOOL bUserMatrixFlag; - Timer aTimer; - - const String aTitle1; - const String aTitle2; - const String aTxtEnd; - const String aTxtOk; // hinter aBtnEnd - - ULONG nOldHelp; - ULONG nOldUnique; - ULONG nActivWinId; - BOOL bIsShutDown; - - - - Font aFntBold; - Font aFntLight; - USHORT nEdFocus; -// Selection theCurSel; - BOOL bEditFlag; - const ScFuncDesc* pFuncDesc; - USHORT nArgs; - String** pArgArr; - Selection aFuncSel; - - static ScDocument* pDoc; - static ScAddress aCursorPos; + virtual BOOL Close(); + // sc::IAnyRefDialog + virtual void ShowReference(const String& _sRef); + virtual void HideReference( BOOL bDoneRefMode = TRUE ); + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + + virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + virtual void RefInputDone( BOOL bForced = FALSE ); + virtual BOOL IsTableLocked() const; + virtual BOOL IsRefInputMode() const; + + virtual BOOL IsDocAllowed( SfxObjectShell* pDocSh ) const; + virtual void AddRefEntry(); + virtual void SetActive(); + virtual void ViewShellChanged( ScTabViewShell* pScViewShell ); protected: - virtual long PreNotify( NotifyEvent& rNEvt ); - virtual void RefInputStart( ScRefEdit* pEdit, ScRefButton* pButton = NULL ); - virtual void RefInputDone( BOOL bForced = FALSE ); - ULONG FindFocusWin(Window *pWin); - void SetFocusWin(Window *pWin,ULONG nUniqueId); - String RepairFormula(const String& aFormula); - void SaveLRUEntry(const ScFuncDesc* pFuncDesc); - void HighlightFunctionParas(const String& aFormula); - -private: - - BOOL IsInputHdl(ScInputHandler* pHdl); - ScInputHandler* GetNextInputHandler(ScDocShell* pDocShell,PtrTabViewShell* ppViewSh=NULL); - - void MakeTree(SvLBoxEntry* pParent,ScToken* pScToken,long Count, - ScTokenArray* pScTokA,ScCompiler* pComp); - - void ClearAllParas(); - void DeleteArgs(); - void FillDialog(BOOL nFlag=TRUE); - void EditNextFunc( BOOL bForward, xub_StrLen nFStart=NOT_FOUND ); - void EditThisFunc(xub_StrLen nFStart); - - void UpdateArgInput( USHORT nOffset, USHORT nInput ); - BOOL CalcValue( const String& rStrExp, String& rStrResult ); - BOOL CalcStruct( const String& rStrExp); - - void UpdateValues(); - void SaveArg( USHORT nEd ); - void UpdateSelection(); - void DoEnter( BOOL bOk ); -//UNUSED2008-05 void ResizeArgArr( const ScFuncDesc* pNewFunc ); - void FillListboxes(); - void FillControls(); - - xub_StrLen GetFunctionPos(xub_StrLen nPos); - void UpdateTokenArray( const String& rStrExp); - - ScRefEdit* GetCurrRefEdit(); - -//UNUSED2008-05 DECL_LINK( ScrollHdl, ScParaWin* ); - DECL_LINK( ModifyHdl, ScParaWin* ); - DECL_LINK( FxHdl, ScParaWin* ); - - DECL_LINK( MatrixHdl, CheckBox *); - DECL_LINK( FormulaHdl, MultiLineEdit* ); - DECL_LINK( FormulaCursorHdl, ScEditBox*); - DECL_LINK( BtnHdl, PushButton* ); - DECL_LINK( GetEdFocusHdl, ArgInput* ); - DECL_LINK( GetFxFocusHdl, ArgInput* ); - DECL_LINK( DblClkHdl, ScFuncPage* ); - DECL_LINK( FuncSelHdl, ScFuncPage*); - DECL_LINK( StructSelHdl, ScStructPage * ); - DECL_LINK( UpdateFocusHdl, Timer*); + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + ULONG FindFocusWin(Window *pWin); + void SaveLRUEntry(const ScFuncDesc* pFuncDesc); + void HighlightFunctionParas(const String& aFormula); + + BOOL IsInputHdl(ScInputHandler* pHdl); + ScInputHandler* GetNextInputHandler(ScDocShell* pDocShell,PtrTabViewShell* ppViewSh); }; diff --git a/sc/source/ui/inc/funcutl.hxx b/sc/source/ui/inc/funcutl.hxx index 892f2cb60be8..b511c105e8ca 100644 --- a/sc/source/ui/inc/funcutl.hxx +++ b/sc/source/ui/inc/funcutl.hxx @@ -38,7 +38,7 @@ #include <vcl/fixed.hxx> #endif #include <svtools/svmedit.hxx> -#include "anyrefdg.hxx" // ScRefButton +#include "anyrefdg.hxx" // formula::RefButton //============================================================================ @@ -99,7 +99,7 @@ public: //============================================================================ // class ArgEdit -class ArgEdit : public ScRefEdit +class ArgEdit : public formula::RefEdit { public: ArgEdit( Window* pParent, const ResId& rResId ); @@ -135,12 +135,12 @@ private: FixedText* pFtArg; ImageButton* pBtnFx; ArgEdit* pEdArg; - ScRefButton* pRefBtn; + formula::RefButton* pRefBtn; DECL_LINK( FxBtnClickHdl, ImageButton* ); - DECL_LINK( RefBtnClickHdl,ScRefButton* ); + DECL_LINK( RefBtnClickHdl,formula::RefButton* ); DECL_LINK( FxBtnFocusHdl, ImageButton* ); - DECL_LINK( RefBtnFocusHdl,ScRefButton* ); + DECL_LINK( RefBtnFocusHdl,formula::RefButton* ); DECL_LINK( EdFocusHdl, ArgEdit* ); DECL_LINK( EdModifyHdl,ArgEdit* ); @@ -160,7 +160,7 @@ public: void InitArgInput ( FixedText* pftArg, ImageButton* pbtnFx, ArgEdit* pedArg, - ScRefButton* prefBtn); + formula::RefButton* prefBtn); void SetArgName(const String &aArg); String GetArgName(); diff --git a/sc/source/ui/inc/highred.hxx b/sc/source/ui/inc/highred.hxx index 1d34924fd0cc..0250c2bafe1b 100644 --- a/sc/source/ui/inc/highred.hxx +++ b/sc/source/ui/inc/highred.hxx @@ -87,8 +87,8 @@ private: CancelButton aCancelButton; HelpButton aHelpButton; - ScRefEdit aEdAssign; - ScRefButton aRbAssign; + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; ScViewData* pViewData; ScDocument* pDoc; diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx index bcc14ed48671..5afa0d244987 100644 --- a/sc/source/ui/inc/namedlg.hxx +++ b/sc/source/ui/inc/namedlg.hxx @@ -57,8 +57,8 @@ private: ComboBox aEdName; FixedLine aFlAssign; - ScRefEdit aEdAssign; - ScRefButton aRbAssign; + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; FixedLine aFlType; CheckBox aBtnPrintArea; diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx index f364d0356f8d..3fc71d5d9b75 100644 --- a/sc/source/ui/inc/optsolver.hxx +++ b/sc/source/ui/inc/optsolver.hxx @@ -47,7 +47,7 @@ namespace com { namespace sun { namespace star { //============================================================================ -class ScCursorRefEdit : public ScRefEdit +class ScCursorRefEdit : public formula::RefEdit { Link maCursorUpLink; Link maCursorDownLink; @@ -118,51 +118,51 @@ public: private: FixedText maFtObjectiveCell; - ScRefEdit maEdObjectiveCell; - ScRefButton maRBObjectiveCell; + formula::RefEdit maEdObjectiveCell; + formula::RefButton maRBObjectiveCell; FixedText maFtDirection; RadioButton maRbMax; RadioButton maRbMin; RadioButton maRbValue; - ScRefEdit maEdTargetValue; - ScRefButton maRBTargetValue; + formula::RefEdit maEdTargetValue; + formula::RefButton maRBTargetValue; FixedText maFtVariableCells; - ScRefEdit maEdVariableCells; - ScRefButton maRBVariableCells; + formula::RefEdit maEdVariableCells; + formula::RefButton maRBVariableCells; FixedLine maFlConditions; FixedText maFtCellRef; // labels are together with controls for the first row ScCursorRefEdit maEdLeft1; - ScRefButton maRBLeft1; + formula::RefButton maRBLeft1; FixedText maFtOperator; ListBox maLbOp1; FixedText maFtConstraint; ScCursorRefEdit maEdRight1; - ScRefButton maRBRight1; + formula::RefButton maRBRight1; ImageButton maBtnDel1; ScCursorRefEdit maEdLeft2; - ScRefButton maRBLeft2; + formula::RefButton maRBLeft2; ListBox maLbOp2; ScCursorRefEdit maEdRight2; - ScRefButton maRBRight2; + formula::RefButton maRBRight2; ImageButton maBtnDel2; ScCursorRefEdit maEdLeft3; - ScRefButton maRBLeft3; + formula::RefButton maRBLeft3; ListBox maLbOp3; ScCursorRefEdit maEdRight3; - ScRefButton maRBRight3; + formula::RefButton maRBRight3; ImageButton maBtnDel3; ScCursorRefEdit maEdLeft4; - ScRefButton maRBLeft4; + formula::RefButton maRBLeft4; ListBox maLbOp4; ScCursorRefEdit maEdRight4; - ScRefButton maRBRight4; + formula::RefButton maRBRight4; ImageButton maBtnDel4; ScrollBar maScrollBar; @@ -180,14 +180,14 @@ private: ScDocShell* mpDocShell; ScDocument* mpDoc; const SCTAB mnCurTab; - ScRefEdit* mpEdActive; + formula::RefEdit* mpEdActive; bool mbDlgLostFocus; static const sal_uInt16 EDIT_ROW_COUNT = 4; ScCursorRefEdit* mpLeftEdit[EDIT_ROW_COUNT]; - ScRefButton* mpLeftButton[EDIT_ROW_COUNT]; + formula::RefButton* mpLeftButton[EDIT_ROW_COUNT]; ScCursorRefEdit* mpRightEdit[EDIT_ROW_COUNT]; - ScRefButton* mpRightButton[EDIT_ROW_COUNT]; + formula::RefButton* mpRightButton[EDIT_ROW_COUNT]; ListBox* mpOperator[EDIT_ROW_COUNT]; ImageButton* mpDelButton[EDIT_ROW_COUNT]; @@ -206,7 +206,7 @@ private: void EnableButtons(); bool ParseRef( ScRange& rRange, const String& rInput, bool bAllowRange ); bool FindTimeout( sal_Int32& rTimeout ); - void ShowError( bool bCondition, ScRefEdit* pFocus ); + void ShowError( bool bCondition, formula::RefEdit* pFocus ); DECL_LINK( BtnHdl, PushButton* ); DECL_LINK( DelBtnHdl, PushButton* ); diff --git a/sc/source/ui/inc/parawin.hxx b/sc/source/ui/inc/parawin.hxx index 01e2332e1e0b..3835f94157ca 100644 --- a/sc/source/ui/inc/parawin.hxx +++ b/sc/source/ui/inc/parawin.hxx @@ -79,19 +79,19 @@ private: ImageButton aBtnFx1; FixedText aFtArg1; ArgEdit aEdArg1; - ScRefButton aRefBtn1; + formula::RefButton aRefBtn1; ImageButton aBtnFx2; FixedText aFtArg2; ArgEdit aEdArg2; - ScRefButton aRefBtn2; + formula::RefButton aRefBtn2; ImageButton aBtnFx3; FixedText aFtArg3; ArgEdit aEdArg3; - ScRefButton aRefBtn3; + formula::RefButton aRefBtn3; ImageButton aBtnFx4; FixedText aFtArg4; ArgEdit aEdArg4; - ScRefButton aRefBtn4; + formula::RefButton aRefBtn4; ScrollBar aSlider; BOOL bRefMode; @@ -114,7 +114,7 @@ protected: virtual void FxClick(); void InitArgInput( USHORT nPos, FixedText& rFtArg, ImageButton& rBtnFx, - ArgEdit& rEdArg, ScRefButton& rRefBtn); + ArgEdit& rEdArg, formula::RefButton& rRefBtn); void DelParaArray(); void SetArgumentDesc(const String& aText); @@ -145,7 +145,7 @@ public: USHORT GetActiveLine(); void SetActiveLine(USHORT no); - ScRefEdit* GetActiveEdit(); + formula::RefEdit* GetActiveEdit(); String GetActiveArgName(); String GetArgument(USHORT no); diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx index 158c9c7e7e4a..b0fd8a02c946 100644 --- a/sc/source/ui/inc/pvlaydlg.hxx +++ b/sc/source/ui/inc/pvlaydlg.hxx @@ -131,8 +131,8 @@ private: FixedLine aFlAreas; ListBox aLbOutPos; FixedText aFtOutArea; - ScRefEdit aEdOutPos; - ScRefButton aRbOutPos; + formula::RefEdit aEdOutPos; + formula::RefButton aRbOutPos; CheckBox aBtnIgnEmptyRows; CheckBox aBtnDetectCat; CheckBox aBtnTotalCol; diff --git a/sc/source/ui/inc/simpref.hxx b/sc/source/ui/inc/simpref.hxx index 7443dad543c8..127e3ac2bc56 100644 --- a/sc/source/ui/inc/simpref.hxx +++ b/sc/source/ui/inc/simpref.hxx @@ -65,8 +65,8 @@ private: Link aChangeHdl; FixedText aFtAssign; - ScRefEdit aEdAssign; - ScRefButton aRbAssign; + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; OKButton aBtnOk; CancelButton aBtnCancel; diff --git a/sc/source/ui/inc/solvrdlg.hxx b/sc/source/ui/inc/solvrdlg.hxx index f8d44710959d..21e36fd92366 100644 --- a/sc/source/ui/inc/solvrdlg.hxx +++ b/sc/source/ui/inc/solvrdlg.hxx @@ -68,15 +68,15 @@ public: private: FixedLine aFlVariables; FixedText aFtFormulaCell; - ScRefEdit aEdFormulaCell; - ScRefButton aRBFormulaCell; + formula::RefEdit aEdFormulaCell; + formula::RefButton aRBFormulaCell; FixedText aFtTargetVal; Edit aEdTargetVal; FixedText aFtVariableCell; - ScRefEdit aEdVariableCell; - ScRefButton aRBVariableCell; + formula::RefEdit aEdVariableCell; + formula::RefButton aRBVariableCell; OKButton aBtnOk; CancelButton aBtnCancel; @@ -88,7 +88,7 @@ private: ScDocument* pDoc; const SCTAB nCurTab; - ScRefEdit* pEdActive; + formula::RefEdit* pEdActive; BOOL bDlgLostFocus; const String errMsgInvalidVar; const String errMsgInvalidForm; diff --git a/sc/source/ui/inc/structpg.hxx b/sc/source/ui/inc/structpg.hxx deleted file mode 100644 index a4d4a8c10e87..000000000000 --- a/sc/source/ui/inc/structpg.hxx +++ /dev/null @@ -1,146 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: structpg.hxx,v $ - * $Revision: 1.6 $ - * - * 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. - * - ************************************************************************/ - -#ifndef SC_STRUCTPG_HXX -#define SC_STRUCTPG_HXX - -#include "funcutl.hxx" -#include "global.hxx" // ScAddress -#include <svtools/stdctrl.hxx> -#ifndef _LSTBOX_HXX //autogen -#include <vcl/lstbox.hxx> -#endif -#include <vcl/group.hxx> -#include <svtools/svmedit.hxx> -#include <vcl/tabpage.hxx> - -#ifndef _SVSTDARR_STRINGS - -#define _SVSTDARR_STRINGS -#include <svtools/svstdarr.hxx> - -#endif -#include <vcl/tabctrl.hxx> -#include "parawin.hxx" -#include <svtools/svtreebx.hxx> -#include "compiler.hxx" -#include "cell.hxx" - - -class ScViewData; -class ScFuncName_Impl; -class ScDocument; -class ScFuncDesc; - -//============================================================================ - -#define STRUCT_END 1 -#define STRUCT_FOLDER 2 -#define STRUCT_ERROR 3 - -#define STRUCT_ERR_C1 1 -#define STRUCT_ERR_C2 2 - -//============================================================================ - - -class ScStructListBox : public SvTreeListBox -{ -private: - - BOOL bActiveFlag; - -protected: - virtual void MouseButtonDown( const MouseEvent& rMEvt ); - -public: - - ScStructListBox(Window* pParent, const ResId& rResId ); - - /** Inserts an entry with static image (no difference between collapsed/expanded). */ - SvLBoxEntry* InsertStaticEntry( - const XubString& rText, - const Image& rEntryImg, - const Image& rEntryImgHC, - SvLBoxEntry* pParent = NULL, - ULONG nPos = LIST_APPEND, - ScToken* pToken = NULL ); - - void SetActiveFlag(BOOL bFlag=TRUE); - BOOL GetActiveFlag(); - void GetFocus(); - void LoseFocus(); -}; - -//============================================================================ - -class ScStructPage : public TabPage -{ -private: - - Link aSelLink; - - FixedText aFtStruct; - ScStructListBox aTlbStruct; - Image maImgEnd; - Image maImgError; - Image maImgEndHC; - Image maImgErrorHC; - - ScToken* pSelectedToken; - - DECL_LINK( SelectHdl, SvTreeListBox* ); - -protected: - - ScToken* GetFunctionEntry(SvLBoxEntry* pEntry); - -public: - - ScStructPage( Window* pParent); - - SvTreeListBox* GetStructPtr() {return &aTlbStruct;} - - void ClearStruct(); - SvLBoxEntry* InsertEntry(const XubString& rText, SvLBoxEntry* pParent, - USHORT nFlag,ULONG nPos=0,ScToken* pScToken=NULL); - - String GetEntryText(SvLBoxEntry* pEntry); - String GetSelectedEntryText(); - ScToken* GetSelectedToken(); - - void SetSelectionHdl( const Link& rLink ) { aSelLink = rLink; } - const Link& GetSelectionHdl() const { return aSelLink; } -}; - - - -#endif - diff --git a/sc/source/ui/inc/tabopdlg.hxx b/sc/source/ui/inc/tabopdlg.hxx index ebfe305983a3..fd1e880c8901 100644 --- a/sc/source/ui/inc/tabopdlg.hxx +++ b/sc/source/ui/inc/tabopdlg.hxx @@ -70,16 +70,16 @@ public: private: FixedLine aFlVariables; FixedText aFtFormulaRange; - ScRefEdit aEdFormulaRange; - ScRefButton aRBFormulaRange; + formula::RefEdit aEdFormulaRange; + formula::RefButton aRBFormulaRange; FixedText aFtRowCell; - ScRefEdit aEdRowCell; - ScRefButton aRBRowCell; + formula::RefEdit aEdRowCell; + formula::RefButton aRBRowCell; FixedText aFtColCell; - ScRefEdit aEdColCell; - ScRefButton aRBColCell; + formula::RefEdit aEdColCell; + formula::RefButton aRBColCell; OKButton aBtnOk; CancelButton aBtnCancel; @@ -92,7 +92,7 @@ private: ScDocument* pDoc; const SCTAB nCurTab; - ScRefEdit* pEdActive; + formula::RefEdit* pEdActive; BOOL bDlgLostFocus; const String errMsgNoFormula; const String errMsgNoColRow; diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx index 4da2e7c2b45e..99f0c7b5f16a 100644 --- a/sc/source/ui/inc/undoblk.hxx +++ b/sc/source/ui/inc/undoblk.hxx @@ -711,7 +711,7 @@ public: private: ScDocument* pUndoDoc; String aFormula; - ScAddress::Convention eConv; + formula::FormulaGrammar::AddressConvention eConv; ULONG nStartChangeAction; ULONG nEndChangeAction; diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index ea2951eede5e..ff76ebd16702 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -33,7 +33,7 @@ #include "undobase.hxx" #include "markdata.hxx" -#include "grammar.hxx" +#include "formula/grammar.hxx" #include <tools/color.hxx> #ifndef _SVSTDARR_SHORTS @@ -470,7 +470,7 @@ class ScUndoSetGrammar : public ScSimpleUndo public: TYPEINFO(); ScUndoSetGrammar( ScDocShell* pShell, - ScGrammar::Grammar eGrammar ); + formula::FormulaGrammar::Grammar eGrammar ); virtual ~ScUndoSetGrammar(); virtual void Undo(); @@ -481,9 +481,9 @@ public: virtual String GetComment() const; private: - ScGrammar::Grammar meNewGrammar, meOldGrammar; + formula::FormulaGrammar::Grammar meNewGrammar, meOldGrammar; - void DoChange( ScGrammar::Grammar eGrammar ); + void DoChange( formula::FormulaGrammar::Grammar eGrammar ); }; #endif |