From f7c044dd301bfdfa165714b88b1d0af067d5b193 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 4 Oct 2010 17:14:34 +0200 Subject: sw34bf01: #i85766# #i112425#: prevent expansion of fields in temp documents: SwField subclasses: make Expand()/Copy() methods private, like in SwField. SwField+subclasses: replace method GetCntnt(BOOL) with GetFieldName(). SwTblField: refactor Expand() and GetCntnt(BOOL): create new private method. --- sw/inc/docufld.hxx | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'sw/inc/docufld.hxx') diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 8483cf7b2d39..3607ad0cd970 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -24,8 +24,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _DOCUFLD_HXX -#define _DOCUFLD_HXX +#ifndef SW_DOCUFLD_HXX +#define SW_DOCUFLD_HXX #include @@ -363,6 +363,9 @@ class SwHiddenTxtField : public SwField BOOL bIsHidden : 1; // ist es nicht sichtbar? BOOL bValid : 1; // DB-Feld evaluiert? + virtual String Expand() const; + virtual SwField* Copy() const; + public: SwHiddenTxtField( SwHiddenTxtFieldType*, BOOL bConditional, @@ -377,9 +380,7 @@ public: const String& rFalse, USHORT nSubType = TYP_HIDDENTXTFLD); - virtual String GetCntnt(BOOL bName = FALSE) const; - virtual String Expand() const; - virtual SwField* Copy() const; + virtual String GetFieldName() const; void Evaluate(SwDoc*); @@ -463,6 +464,9 @@ class SW_DLLPUBLIC SwMacroField : public SwField String aText; BOOL bIsScriptURL; + virtual String Expand() const; + virtual SwField* Copy() const; + public: // Direkte Eingabe alten Wert loeschen SwMacroField( SwMacroFieldType*, const String& rLibAndName, @@ -473,9 +477,7 @@ public: String GetMacroName() const; SvxMacro GetSvxMacro() const; - virtual String GetCntnt(BOOL bName = FALSE) const; - virtual String Expand() const; - virtual SwField* Copy() const; + virtual String GetFieldName() const; // Library und FileName virtual const String& GetPar1() const; @@ -571,6 +573,9 @@ class SW_DLLPUBLIC SwDocInfoField : public SwValueField String aContent; String aName; + virtual String Expand() const; + virtual SwField* Copy() const; + public: SwDocInfoField(SwDocInfoFieldType*, USHORT nSub, const String& rName, sal_uInt32 nFmt=0); SwDocInfoField(SwDocInfoFieldType*, USHORT nSub, const String& rName, const String& rValue, sal_uInt32 nFmt=0); @@ -578,9 +583,7 @@ public: virtual void SetSubType(USHORT); virtual USHORT GetSubType() const; virtual void SetLanguage(USHORT nLng); - virtual String Expand() const; - virtual String GetCntnt(BOOL bName = FALSE) const; - virtual SwField* Copy() const; + virtual String GetFieldName() const; String GetName() const { return aName; } void SetName( const String& rName ) { aName = rName; } inline void SetExpansion(const String& rStr) { aContent = rStr; } @@ -833,4 +836,4 @@ public: }; -#endif // _DOCUFLD_HXX +#endif // SW_DOCUFLD_HXX -- cgit