diff options
author | Niklas Nebel <nn@openoffice.org> | 2001-07-31 16:57:55 +0000 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2001-07-31 16:57:55 +0000 |
commit | 369e3b02e6063d78031a5f4e4b5d9ef36d3f92f5 (patch) | |
tree | 14ae0cb46165f26a55d574396f4c61118c5e40bd /sc/inc | |
parent | #86214#; no longer necessary (diff) | |
download | core-369e3b02e6063d78031a5f4e4b5d9ef36d3f92f5.tar.gz core-369e3b02e6063d78031a5f4e4b5d9ef36d3f92f5.zip |
#90142# share data for text in page headers / footers
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/editsrc.hxx | 40 | ||||
-rw-r--r-- | sc/inc/textuno.hxx | 39 |
2 files changed, 59 insertions, 20 deletions
diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx index 474419e546f0..62aba28c674d 100644 --- a/sc/inc/editsrc.hxx +++ b/sc/inc/editsrc.hxx @@ -2,9 +2,9 @@ * * $RCSfile: editsrc.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: sab $ $Date: 2001-06-13 17:01:24 $ + * last change: $Author: nn $ $Date: 2001-07-31 17:56:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,6 +80,7 @@ class SvxEditEngineForwarder; class ScDocShell; class ScHeaderFooterContentObj; class ScCellTextData; +class ScHeaderFooterTextData; class ScHeaderFooterChangedHint : public SfxHint @@ -95,29 +96,38 @@ public: }; -class ScHeaderFooterEditSource : public SvxEditSource, public SfxListener +// all ScSharedHeaderFooterEditSource objects for a single text share the same data + +class ScSharedHeaderFooterEditSource : public SvxEditSource { private: - ScHeaderFooterContentObj* pContentObj; - USHORT nPart; - ScEditEngineDefaulter* pEditEngine; - SvxEditEngineForwarder* pForwarder; - BOOL bDataValid; - BOOL bInUpdate; + ScHeaderFooterTextData* pTextData; + +protected: + ScHeaderFooterTextData* GetTextData() const { return pTextData; } // for ScHeaderFooterEditSource public: - ScHeaderFooterEditSource( ScHeaderFooterContentObj* pContent, - USHORT nP ); - virtual ~ScHeaderFooterEditSource(); + ScSharedHeaderFooterEditSource( ScHeaderFooterTextData* pData ); + virtual ~ScSharedHeaderFooterEditSource(); - //! 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 SvxTextForwarder* GetTextForwarder(); virtual void UpdateData(); +}; - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); +// ScHeaderFooterEditSource with local copy of ScHeaderFooterTextData is used by field objects + +class ScHeaderFooterEditSource : public ScSharedHeaderFooterEditSource +{ +public: + ScHeaderFooterEditSource( ScHeaderFooterContentObj* pContent, USHORT nP ); + ScHeaderFooterEditSource( ScHeaderFooterContentObj& rContent, USHORT nP ); + virtual ~ScHeaderFooterEditSource(); + + virtual SvxEditSource* Clone() const; }; diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx index 541efebe13dd..6b1c8b865005 100644 --- a/sc/inc/textuno.hxx +++ b/sc/inc/textuno.hxx @@ -2,9 +2,9 @@ * * $RCSfile: textuno.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: sab $ $Date: 2001-06-13 17:01:24 $ + * last change: $Author: nn $ $Date: 2001-07-31 17:56:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -174,6 +174,34 @@ public: }; +// ScHeaderFooterTextData: shared data between sub objects of a ScHeaderFooterTextObj + +class ScHeaderFooterTextData : public SfxListener +{ +private: + ScHeaderFooterContentObj& rContentObj; + USHORT nPart; + ScEditEngineDefaulter* pEditEngine; + SvxEditEngineForwarder* pForwarder; + BOOL bDataValid; + BOOL bInUpdate; + +public: + ScHeaderFooterTextData( ScHeaderFooterContentObj& rContent, + USHORT nP ); + ~ScHeaderFooterTextData(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + // helper functions + SvxTextForwarder* GetTextForwarder(); + void UpdateData(); + ScEditEngineDefaulter* GetEditEngine() { GetTextForwarder(); return pEditEngine; } + + USHORT GetPart() const { return nPart; } + ScHeaderFooterContentObj& GetContentObj() const { return rContentObj; } +}; + // ScHeaderFooterTextObj veraendert den Text in einem ScHeaderFooterContentObj class ScHeaderFooterTextObj : public cppu::WeakImplHelper5< @@ -184,16 +212,17 @@ class ScHeaderFooterTextObj : public cppu::WeakImplHelper5< com::sun::star::lang::XServiceInfo > { private: - ScHeaderFooterContentObj& rContentObj; - USHORT nPart; + ScHeaderFooterTextData aTextData; SvxUnoText* pUnoText; + void CreateUnoText_Impl(); + public: ScHeaderFooterTextObj( ScHeaderFooterContentObj& rContent, USHORT nP ); virtual ~ScHeaderFooterTextObj(); - const SvxUnoText& GetUnoText() const; + const SvxUnoText& GetUnoText(); static void FillDummyFieldData( ScHeaderFieldData& rData ); |