diff options
author | Niklas Nebel <nn@openoffice.org> | 2001-06-07 18:06:48 +0000 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2001-06-07 18:06:48 +0000 |
commit | 20fd76c5712bfa2a4ae1ffe490788a2b63163267 (patch) | |
tree | 700e4bc3f85e0b5cebd952049f5f8bb227f44b47 /sc/inc | |
parent | #85093# export of matrix formulas (diff) | |
download | core-20fd76c5712bfa2a4ae1ffe490788a2b63163267.tar.gz core-20fd76c5712bfa2a4ae1ffe490788a2b63163267.zip |
#79771# share EditEngine between child objects of cell text
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/editsrc.hxx | 42 | ||||
-rw-r--r-- | sc/inc/textuno.hxx | 50 |
2 files changed, 73 insertions, 19 deletions
diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx index d11125861371..c558b6df1852 100644 --- a/sc/inc/editsrc.hxx +++ b/sc/inc/editsrc.hxx @@ -2,9 +2,9 @@ * * $RCSfile: editsrc.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: nn $ $Date: 2001-02-15 18:05:39 $ + * last change: $Author: nn $ $Date: 2001-06-07 19:05:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,12 +75,11 @@ #endif class ScEditEngineDefaulter; -class SfxBroadcaster; -class SfxHint; class SvxEditEngineForwarder; class ScDocShell; class ScHeaderFooterContentObj; +class ScCellTextData; class ScHeaderFooterChangedHint : public SfxHint @@ -122,28 +121,37 @@ public: }; -class ScCellEditSource : public SvxEditSource, public SfxListener +// Data (incl. EditEngine) for cell EditSource is now shared in ScCellTextData + +class ScSharedCellEditSource : public SvxEditSource { private: - ScDocShell* pDocShell; - ScAddress aCellPos; - ScEditEngineDefaulter* pEditEngine; - SvxEditEngineForwarder* pForwarder; - BOOL bDataValid; - BOOL bInUpdate; + ScCellTextData* pCellTextData; + +protected: + ScCellTextData* GetCellTextData() const { return pCellTextData; } // for ScCellEditSource public: - ScCellEditSource(ScDocShell* pDocSh, const ScAddress& rP); - virtual ~ScCellEditSource(); + ScSharedCellEditSource( ScCellTextData* pData ); + virtual ~ScSharedCellEditSource(); - //! GetEditEngine nur als Uebergang, bis die Feld-Funktionen am Forwarder sind !!! - ScEditEngineDefaulter* GetEditEngine() { GetTextForwarder(); return pEditEngine; } + // GetEditEngine is needed because the forwarder doesn't have field functions + ScEditEngineDefaulter* GetEditEngine(); - virtual SvxEditSource* Clone() const ; + virtual SvxEditSource* Clone() const; virtual SvxTextForwarder* GetTextForwarder(); virtual void UpdateData(); +}; - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); +// ScCellEditSource with local copy of ScCellTextData is used by ScCellFieldsObj, ScCellFieldObj + +class ScCellEditSource : public ScSharedCellEditSource +{ +public: + ScCellEditSource( ScDocShell* pDocSh, const ScAddress& rP ); + virtual ~ScCellEditSource(); + + virtual SvxEditSource* Clone() const; }; diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx index 74596e01a605..0b3a502c9ee6 100644 --- a/sc/inc/textuno.hxx +++ b/sc/inc/textuno.hxx @@ -2,9 +2,9 @@ * * $RCSfile: textuno.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: nn $ $Date: 2001-02-15 18:05:39 $ + * last change: $Author: nn $ $Date: 2001-06-07 19:05:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,6 +62,10 @@ #ifndef SC_TEXTSUNO_HXX #define SC_TEXTSUNO_HXX +#ifndef SC_SCGLOB_HXX +#include "global.hxx" // ScRange, ScAddress +#endif + #ifndef _SVX_UNOTEXT_HXX #include <svx/unotext.hxx> #endif @@ -69,6 +73,9 @@ #ifndef _SFXBRDCST_HXX #include <svtools/brdcst.hxx> #endif +#ifndef _SFXLSTNER_HXX +#include <svtools/lstner.hxx> +#endif #ifndef _COM_SUN_STAR_TEXT_XTEXTFIELDSSUPPLIER_HPP_ #include <com/sun/star/text/XTextFieldsSupplier.hpp> @@ -98,6 +105,7 @@ class ScDocShell; class ScAddress; class ScCellObj; class ScSimpleEditSource; +class ScSharedCellEditSource; class ScEditEngineDefaulter; struct ScHeaderFieldData; @@ -352,5 +360,43 @@ public: }; +// ScCellTextData: shared data between sub objects of a cell text object + +class ScCellTextData : public SfxListener +{ + ScDocShell* pDocShell; + ScAddress aCellPos; + ScEditEngineDefaulter* pEditEngine; + SvxEditEngineForwarder* pForwarder; + BOOL bDataValid; + BOOL bInUpdate; + ScSharedCellEditSource* pOriginalSource; + +public: + ScCellTextData(ScDocShell* pDocSh, const ScAddress& rP); + virtual ~ScCellTextData(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + // helper functions for ScSharedCellEditSource: + SvxTextForwarder* GetTextForwarder(); + void UpdateData(); + ScEditEngineDefaulter* GetEditEngine() { GetTextForwarder(); return pEditEngine; } + + ScSharedCellEditSource* GetOriginalSource(); // used as argument for SvxUnoText ctor + + // used for ScCellEditSource: + ScDocShell* GetDocShell() const { return pDocShell; } + const ScAddress& GetCellPos() const { return aCellPos; } +}; + +class ScCellTextObj : public ScCellTextData, public SvxUnoText +{ +public: + ScCellTextObj(ScDocShell* pDocSh, const ScAddress& rP); + virtual ~ScCellTextObj(); +}; + + #endif |