diff options
-rw-r--r-- | sc/inc/editsrc.hxx | 21 | ||||
-rw-r--r-- | sc/source/ui/unoobj/editsrc.cxx | 33 |
2 files changed, 50 insertions, 4 deletions
diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx index 18a95d56e586..5dd92d73745c 100644 --- a/sc/inc/editsrc.hxx +++ b/sc/inc/editsrc.hxx @@ -2,9 +2,9 @@ * * $RCSfile: editsrc.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:44:49 $ + * last change: $Author: nn $ $Date: 2001-01-18 15:52:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -153,5 +153,22 @@ public: }; +// EditSource with a shared forwarder for all children of one text object + +class ScSimpleEditSource : public SvxEditSource +{ +private: + SvxTextForwarder* pForwarder; + +public: + ScSimpleEditSource( SvxTextForwarder* pForw ); + virtual ~ScSimpleEditSource(); + + virtual SvxEditSource* Clone() const ; + virtual SvxTextForwarder* GetTextForwarder(); + virtual void UpdateData(); +}; + + #endif diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx index faadcd749454..afec033f1872 100644 --- a/sc/source/ui/unoobj/editsrc.cxx +++ b/sc/source/ui/unoobj/editsrc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: editsrc.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: nn $ $Date: 2000-11-29 20:53:10 $ + * last change: $Author: nn $ $Date: 2001-01-18 15:54:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,6 +73,7 @@ #include <tools/debug.hxx> #include <svx/editeng.hxx> #include <svx/unofored.hxx> +#include <svx/editobj.hxx> #include "textuno.hxx" #include "editsrc.hxx" @@ -399,6 +400,34 @@ void ScAnnotationEditSource::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } } +//------------------------------------------------------------------------ + +ScSimpleEditSource::ScSimpleEditSource( SvxTextForwarder* pForw ) : + pForwarder( pForw ) +{ + // The same forwarder (and EditEngine) is shared by all children of the same Text object. + // Text range and cursor keep a reference to their parent text, so the text object is + // always alive and the forwarder is valid as long as there are children. +} + +ScSimpleEditSource::~ScSimpleEditSource() +{ +} + +SvxEditSource* ScSimpleEditSource::Clone() const +{ + return new ScSimpleEditSource( pForwarder ); +} + +SvxTextForwarder* ScSimpleEditSource::GetTextForwarder() +{ + return pForwarder; +} + +void ScSimpleEditSource::UpdateData() +{ + // nothing +} |