summaryrefslogtreecommitdiff
path: root/sw/inc/fldbas.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-05-21 15:21:49 +0200
committerMichael Stahl <mst@openoffice.org>2010-05-21 15:21:49 +0200
commitd20b81017eb53c5c19a8aed6d5f785c469f91808 (patch)
treeff3d806335bf62299455ced753b5e9d4049eff56 /sw/inc/fldbas.hxx
parent047c38908df32c7de6634b1d5963b0df71d4e6e8 (diff)
sw33bf04: #i85766#: prevent field expansion in clipboard:
SwField: add a String member to cache the value. SwField: wrap Expand() and Copy() methods to use/update cache. update all callers to pass the clipboard flag to new SwField::ExpandField().
Diffstat (limited to 'sw/inc/fldbas.hxx')
-rw-r--r--sw/inc/fldbas.hxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index a39dcefaabd3..a2e08366ba24 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -305,12 +305,17 @@ inline void SwFieldType::UpdateFlds() const
class SW_DLLPUBLIC SwField
{
+private:
+ mutable String m_Cache; /// #i85766# cached expansion (for clipboard)
USHORT nLang; // Immer ueber SetLanguage aendern!
BOOL bIsAutomaticLanguage;
sal_uInt32 nFormat;
SwFieldType* pType;
+ virtual String Expand() const = 0;
+ virtual SwField* Copy() const = 0;
+
protected:
void SetFormat(sal_uInt32 nSet) {nFormat = nSet;}
@@ -325,12 +330,16 @@ public:
// neuen Typ setzen (wird fuer das Kopieren zwischen Dokumenten benutzt)
virtual SwFieldType* ChgTyp( SwFieldType* );
- // Expandierung fuer die Anzeige
- virtual String Expand() const = 0;
+ /** expand the field.
+ @param bInClipboard field is in clipboard document?
+ @return the generated text (suitable for display)
+ */
+ String ExpandField(bool const bInClipboard) const;
// liefert den Namen oder den Inhalt
virtual String GetCntnt(BOOL bName = FALSE) const;
- virtual SwField* Copy() const = 0;
+
+ SwField * CopyField() const;
// ResId
USHORT Which() const