summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-11-01 16:49:08 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-11-01 16:49:08 +0100
commit7c398ce0645d0988835d7817a5ccca5490d05788 (patch)
treec407743de66d6b31383300afdefc3d2376902de5 /sw
parent2d6f116c8c371bf91afbb41849c418c6506744dc (diff)
parentc0dd8e15db4937bf8b7f84c38d69f315444ce042 (diff)
CWS-TOOLING: integrate CWS sw34bf01
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/authfld.hxx10
-rw-r--r--sw/inc/calc.hxx10
-rw-r--r--sw/inc/chpfld.hxx13
-rw-r--r--sw/inc/dbfld.hxx18
-rw-r--r--sw/inc/ddefld.hxx13
-rw-r--r--sw/inc/docufld.hxx27
-rw-r--r--sw/inc/expfld.hxx41
-rw-r--r--sw/inc/fldbas.hxx23
-rw-r--r--sw/inc/flddat.hxx12
-rw-r--r--sw/inc/flddropdown.hxx43
-rw-r--r--sw/inc/inetfld.hxx13
-rw-r--r--sw/inc/reffld.hxx13
-rw-r--r--sw/inc/txtfld.hxx3
-rw-r--r--sw/inc/usrfld.hxx13
-rw-r--r--sw/qa/unoapi/knownissues.xcl3
-rw-r--r--sw/source/core/bastyp/calc.cxx78
-rw-r--r--sw/source/core/crsr/callnk.cxx4
-rw-r--r--sw/source/core/crsr/crstrvl.cxx3
-rw-r--r--sw/source/core/crsr/findtxt.cxx3
-rw-r--r--sw/source/core/doc/doc.cxx2
-rw-r--r--sw/source/core/doc/docfld.cxx22
-rw-r--r--sw/source/core/doc/docftn.cxx13
-rw-r--r--sw/source/core/edit/edattr.cxx2
-rw-r--r--sw/source/core/edit/edfld.cxx3
-rw-r--r--sw/source/core/fields/cellfml.cxx2
-rw-r--r--sw/source/core/fields/dbfld.cxx47
-rw-r--r--sw/source/core/fields/docufld.cxx65
-rw-r--r--sw/source/core/fields/expfld.cxx78
-rw-r--r--sw/source/core/fields/fldbas.cxx36
-rw-r--r--sw/source/core/fields/macrofld.cxx19
-rw-r--r--sw/source/core/fields/reffld.cxx11
-rw-r--r--sw/source/core/fields/tblcalc.cxx48
-rw-r--r--sw/source/core/fields/usrfld.cxx21
-rw-r--r--sw/source/core/inc/txmsrt.hxx22
-rw-r--r--sw/source/core/layout/calcmove.cxx7
-rw-r--r--sw/source/core/layout/frmtool.cxx2
-rw-r--r--sw/source/core/layout/pagechg.cxx7
-rw-r--r--sw/source/core/text/itratr.cxx4
-rw-r--r--sw/source/core/text/txtfld.cxx91
-rw-r--r--sw/source/core/tox/txmsrt.cxx25
-rw-r--r--sw/source/core/txtnode/atrfld.cxx5
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx25
-rw-r--r--sw/source/core/txtnode/thints.cxx3
-rw-r--r--sw/source/core/unocore/unofield.cxx15
-rw-r--r--sw/source/filter/ascii/ascatr.cxx2
-rw-r--r--sw/source/filter/html/htmlfldw.cxx2
-rw-r--r--sw/source/filter/rtf/rtfatr.cxx10
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx3
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx12
-rw-r--r--sw/source/ui/docvw/AnnotationWin.cxx3
-rw-r--r--sw/source/ui/docvw/SidebarWin.cxx3
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx5
-rw-r--r--sw/source/ui/fldui/DropDownFieldDialog.cxx12
-rw-r--r--sw/source/ui/fldui/inpdlg.cxx14
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx2
-rw-r--r--sw/source/ui/uno/unomod.cxx2
-rw-r--r--sw/source/ui/uno/unotxvw.cxx5
-rw-r--r--sw/source/ui/utlui/initui.cxx3
-rw-r--r--sw/source/ui/utlui/uitool.cxx3
59 files changed, 503 insertions, 496 deletions
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index 7d3ff5514b72..71f8a201243f 100644
--- a/sw/inc/authfld.hxx
+++ b/sw/inc/authfld.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _AUTHFLD_HXX
-#define _AUTHFLD_HXX
+#ifndef SW_AUTHFLD_HXX
+#define SW_AUTHFLD_HXX
#include "swdllapi.h"
#include <fldbas.hxx>
@@ -166,6 +166,10 @@ class SwAuthorityField : public SwField
{
long m_nHandle;
mutable long m_nTempSequencePos;
+
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
SwAuthorityField(SwAuthorityFieldType* pType, const String& rFieldContents);
SwAuthorityField(SwAuthorityFieldType* pType, long nHandle);
@@ -173,8 +177,6 @@ public:
const String& GetFieldText(ToxAuthorityField eField) const;
- virtual String Expand() const;
- virtual SwField* Copy() const;
virtual void SetPar1(const String& rStr);
virtual SwFieldType* ChgTyp( SwFieldType* );
diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx
index f5cbcc6c8c38..4db19fc9a29d 100644
--- a/sw/inc/calc.hxx
+++ b/sw/inc/calc.hxx
@@ -28,6 +28,7 @@
#define _CALC_HXX
#include <svl/svarray.hxx>
+#include <unotools/syslocale.hxx>
#ifndef __SBX_SBXVALUE //autogen
#include <basic/sbxvar.hxx>
@@ -185,6 +186,7 @@ class SwCalc
xub_StrLen nCommandPos;
SwDoc& rDoc;
+ SvtSysLocale m_aSysLocale;
const LocaleDataWrapper* pLclData;
CharClass* pCharClass;
@@ -228,11 +230,11 @@ public:
void SetCalcError( SwCalcError eErr ) { eError = eErr; }
BOOL IsCalcError() const { return 0 != eError; }
- static BOOL Str2Double( const String& rStr, xub_StrLen& rPos,
+ static bool Str2Double( const String& rStr, xub_StrLen& rPos,
double& rVal,
- const LocaleDataWrapper* pData = 0 );
- static BOOL Str2Double( const String& rStr, xub_StrLen& rPos,
- double& rVal, SwDoc* pDoc );
+ LocaleDataWrapper const*const pData = 0 );
+ static bool Str2Double( const String& rStr, xub_StrLen& rPos,
+ double& rVal, SwDoc *const pDoc );
SW_DLLPUBLIC static BOOL IsValidVarName( const String& rStr,
String* pValidName = 0 );
diff --git a/sw/inc/chpfld.hxx b/sw/inc/chpfld.hxx
index 40f2f9ecf1d3..5d63c866c68d 100644
--- a/sw/inc/chpfld.hxx
+++ b/sw/inc/chpfld.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _CHPFLD_HXX
-#define _CHPFLD_HXX
+#ifndef SW_CHPFLD_HXX
+#define SW_CHPFLD_HXX
#include "fldbas.hxx"
@@ -69,6 +69,10 @@ class SW_DLLPUBLIC SwChapterField : public SwField
friend class SwChapterFieldType;
BYTE nLevel;
String sTitle, sNumber, sPre, sPost;
+
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
SwChapterField(SwChapterFieldType*, sal_uInt32 nFmt = 0);
@@ -82,9 +86,6 @@ public:
// <--
void ChangeExpansion(const SwTxtNode &rNd, BOOL bSrchNum);
- virtual String Expand() const;
- virtual SwField* Copy() const;
-
inline BYTE GetLevel() const;
inline void SetLevel(BYTE);
@@ -99,4 +100,4 @@ inline void SwChapterField::SetLevel(BYTE nLev) { nLevel = nLev; }
inline const String& SwChapterField::GetNumber() const { return sNumber; }
inline const String& SwChapterField::GetTitle() const { return sTitle; }
-#endif // _CHPFLD_HXX
+#endif // SW_CHPFLD_HXX
diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx
index 4114c0cfe0d3..c13c766e1147 100644
--- a/sw/inc/dbfld.hxx
+++ b/sw/inc/dbfld.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _DBFLD_HXX
-#define _DBFLD_HXX
+#ifndef SW_DBFLD_HXX
+#define SW_DBFLD_HXX
#include "swdllapi.h"
#include "fldbas.hxx"
@@ -79,6 +79,9 @@ class SW_DLLPUBLIC SwDBField : public SwValueField
BOOL bValidValue : 1;
BOOL bInitialized : 1;
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
SwDBField(SwDBFieldType*, ULONG nFmt = 0);
virtual ~SwDBField();
@@ -87,14 +90,11 @@ public:
// Der aktuelle Text
inline void SetExpansion(const String& rStr);
- virtual String Expand() const;
- virtual SwField* Copy() const;
virtual USHORT GetSubType() const;
virtual void SetSubType(USHORT nType);
- // Name oder Inhalt
- virtual String GetCntnt(BOOL bName = FALSE) const;
+ virtual String GetFieldName() const;
// fuer Berechnungen in Ausdruecken
void ChgValue( double d, BOOL bVal );
@@ -157,8 +157,8 @@ public:
SwDBData GetDBData(SwDoc* pDoc);
void SetDBData(const SwDBData& rDBData); // #111840#
- // Name oder Inhalt
- virtual String GetCntnt(BOOL bName = FALSE) const;
+ virtual String GetFieldName() const;
+
virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
virtual USHORT GetSubType() const;
@@ -335,4 +335,4 @@ inline void SwDBSetNumberField::SetSetNumber(long nNum)
{ nNumber = nNum; }
-#endif // _DBFLD_HXX
+#endif // SW_DBFLD_HXX
diff --git a/sw/inc/ddefld.hxx b/sw/inc/ddefld.hxx
index d9a011461eba..87b8a9f53dea 100644
--- a/sw/inc/ddefld.hxx
+++ b/sw/inc/ddefld.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _DDEFLD_HXX
-#define _DDEFLD_HXX
+#ifndef SW_DDEFLD_HXX
+#define SW_DDEFLD_HXX
#include <sfx2/lnkbase.hxx>
#include "swdllapi.h"
@@ -97,13 +97,14 @@ public:
class SwDDEField : public SwField
{
+private:
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
SwDDEField(SwDDEFieldType*);
~SwDDEField();
- virtual String Expand() const;
- virtual SwField* Copy() const;
-
// ueber Typen Parameter ermitteln
// Name kann nicht geaendert werden
virtual const String& GetPar1() const;
@@ -114,4 +115,4 @@ public:
};
-#endif // _DDEFLD_HXX
+#endif // SW_DDEFLD_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 <tools/date.hxx>
@@ -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
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 00598528e891..32fdbe202462 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _EXPFLD_HXX
-#define _EXPFLD_HXX
+#ifndef SW_EXPFLD_HXX
+#define SW_EXPFLD_HXX
#include <svl/svarray.hxx>
#include "swdllapi.h"
@@ -98,6 +98,9 @@ class SW_DLLPUBLIC SwGetExpField : public SwFormulaField
bool bLateInitialization; // #i82544#
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
SwGetExpField( SwGetExpFieldType*, const String& rFormel,
USHORT nSubType = nsSwGetSetExpType::GSE_EXPR, ULONG nFmt = 0);
@@ -105,9 +108,6 @@ public:
virtual void SetValue( const double& rVal );
virtual void SetLanguage(USHORT nLng);
- virtual String Expand() const;
- virtual SwField* Copy() const;
-
inline const String& GetExpStr() const;
inline void ChgExpStr(const String& rExpand);
@@ -119,7 +119,7 @@ public:
// (wird nur von der Formatierung aufgerufen!!)
void ChangeExpansion( const SwFrm&, const SwTxtFld& );
- virtual String GetCntnt(BOOL bName = FALSE) const;
+ virtual String GetFieldName() const;
// Die Formel aendern
virtual String GetPar2() const;
@@ -234,14 +234,14 @@ class SW_DLLPUBLIC SwSetExpField : public SwFormulaField
USHORT nSeqNo;
USHORT nSubType;
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
SwSetExpField(SwSetExpFieldType*, const String& rFormel, ULONG nFmt = 0);
virtual void SetValue( const double& rVal );
- virtual String Expand() const;
- virtual SwField* Copy() const;
-
inline const String& GetExpStr() const;
inline void ChgExpStr( const String& rExpand );
@@ -252,7 +252,8 @@ public:
inline void SetInputFlag(BOOL bInp);
inline BOOL GetInputFlag() const;
- virtual String GetCntnt(BOOL bName = FALSE) const;
+ virtual String GetFieldName() const;
+
virtual USHORT GetSubType() const;
virtual void SetSubType(USHORT nType);
@@ -319,15 +320,17 @@ class SW_DLLPUBLIC SwInputField : public SwField
String aHelp;
String aToolTip;
USHORT nSubType;
+
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
// Direkte Eingabe ueber Dialog alten Wert loeschen
SwInputField(SwInputFieldType*, const String& rContent ,
const String& rPrompt, USHORT nSubType = 0,
ULONG nFmt = 0);
- virtual String GetCntnt(BOOL bName = FALSE) const;
- virtual String Expand() const;
- virtual SwField* Copy() const;
+ virtual String GetFieldName() const;
// Content
virtual const String& GetPar1() const;
@@ -405,9 +408,14 @@ class SwTblField : public SwValueField, public SwTableFormula
String sExpand;
USHORT nSubType;
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
// suche den TextNode, in dem das Feld steht
virtual const SwNode* GetNodeOfFormula() const;
+ String GetCommand();
+
public:
SwTblField( SwTblFieldType*, const String& rFormel,
USHORT nSubType = 0, ULONG nFmt = 0);
@@ -415,8 +423,6 @@ public:
virtual void SetValue( const double& rVal );
virtual USHORT GetSubType() const;
virtual void SetSubType(USHORT nType);
- virtual String Expand() const;
- virtual SwField* Copy() const;
const String& GetExpStr() const { return sExpand; }
void ChgExpStr(const String& rStr) { sExpand = rStr; }
@@ -424,7 +430,8 @@ public:
// berechne sich selbst
void CalcField( SwTblCalcPara& rCalcPara );
- virtual String GetCntnt(BOOL bName = FALSE) const;
+ virtual String GetFieldName() const;
+
// Die Formel
virtual String GetPar2() const;
virtual void SetPar2(const String& rStr);
@@ -433,4 +440,4 @@ public:
};
-#endif // _EXPFLD_HXX
+#endif // SW_EXPFLD_HXX
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index a2e08366ba24..fd570f623eaf 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -24,10 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _FLDBAS_HXX
-#define _FLDBAS_HXX
-
-#ifndef FIELDIDS_ONLY // SWG-Testreader!!
+#ifndef SW_FLDBAS_HXX
+#define SW_FLDBAS_HXX
#include <i18npool/lang.h>
#include <tools/debug.hxx>
@@ -40,7 +38,6 @@ class SwDoc;
class SvStringsDtor;
class SvNumberFormatter;
-#endif // FIELDIDS_ONLY
/*--------------------------------------------------------------------
Beschreibung: die ID's fuer die Feldtypen
@@ -236,8 +233,6 @@ enum SwDateTimeSubType
TIMEFLD = 4
};
-#ifndef FIELDIDS_ONLY // SWG-Testreader!!
-
extern USHORT __FAR_DATA aTypeTab[];
@@ -331,13 +326,16 @@ public:
virtual SwFieldType* ChgTyp( SwFieldType* );
/** expand the field.
- @param bInClipboard field is in clipboard document?
+ @param bCached return cached field value.
+ @remark most callers should use the cached field value.
+ this is because various fields need special handing
+ (ChangeExpansion()) to return correct values, and only
+ SwTxtFormatter::NewFldPortion() sets things up properly.
@return the generated text (suitable for display)
*/
- String ExpandField(bool const bInClipboard) const;
+ String ExpandField(bool const bCached) const;
- // liefert den Namen oder den Inhalt
- virtual String GetCntnt(BOOL bName = FALSE) const;
+ virtual String GetFieldName() const;
SwField * CopyField() const;
@@ -461,5 +459,4 @@ public:
String GetExpandedFormula() const;
};
-#endif // FIELDIDS_ONLY
-#endif // _FLDBAS_HXX
+#endif // SW_FLDBAS_HXX
diff --git a/sw/inc/flddat.hxx b/sw/inc/flddat.hxx
index d302f45a96bc..1196f0f1264d 100644
--- a/sw/inc/flddat.hxx
+++ b/sw/inc/flddat.hxx
@@ -25,8 +25,8 @@
*
************************************************************************/
-#ifndef _FLDDAT_HXX
-#define _FLDDAT_HXX
+#ifndef SW_FLDDAT_HXX
+#define SW_FLDDAT_HXX
#include <tools/string.hxx>
@@ -115,6 +115,9 @@ class SW_DLLPUBLIC SwDateTimeField : public SwValueField
USHORT nSubType;
long nOffset; // Offset in Minuten
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
SwDateTimeField(SwDateTimeFieldType* pType, USHORT nSubType = DATEFLD,
ULONG nFmt = 0, USHORT nLng = 0);
@@ -138,11 +141,8 @@ public:
void SetDateTime(const DateTime& rDT);
static double GetDateTime(SwDoc* pDoc, const DateTime& rDT);
- virtual String Expand() const;
- virtual SwField* Copy() const;
-
virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nMId ) const;
virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nMId );
};
-#endif // _FLDDAT_HXX
+#endif // SW_FLDDAT_HXX
diff --git a/sw/inc/flddropdown.hxx b/sw/inc/flddropdown.hxx
index 77963bf1510a..e3e40a82b940 100644
--- a/sw/inc/flddropdown.hxx
+++ b/sw/inc/flddropdown.hxx
@@ -24,19 +24,14 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _FLDDROPDOWN_HXX
-#define _FLDDROPDOWN_HXX
+#ifndef SW_FLDDROPDOWN_HXX
+#define SW_FLDDROPDOWN_HXX
-#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX
#include "com/sun/star/uno/Sequence.hxx"
-#endif
#include "swdllapi.h"
#include "fldbas.hxx"
-#ifndef INCLUDED_VECTOR
#include <vector>
-#define INCLUDED_VECTOR
-#endif
/**
Field type for dropdown boxes.
@@ -95,6 +90,23 @@ class SW_DLLPUBLIC SwDropDownField : public SwField
*/
String aToolTip;
+ /**
+ Expands the field.
+
+ The expanded value of the field is the value of the selected
+ item. If no item is selected, an empty string is returned.
+
+ @return the expanded value of the field
+ */
+ virtual String Expand() const;
+
+ /**
+ Creates a copy of this field.
+
+ @return the copy of this field
+ */
+ virtual SwField * Copy() const;
+
public:
/**
Constructor
@@ -116,23 +128,6 @@ public:
virtual ~SwDropDownField();
/**
- Expands the field.
-
- The expanded value of the field is the value of the selected
- item. If no item is selected, an empty string is returned.
-
- @return the expanded value of the field
- */
- virtual String Expand() const;
-
- /**
- Creates a copy of this field.
-
- @return the copy of this field
- */
- virtual SwField * Copy() const;
-
- /**
Returns the selected value.
@see Expand
diff --git a/sw/inc/inetfld.hxx b/sw/inc/inetfld.hxx
index 2bb3c6f9c880..de3f81c49e31 100644
--- a/sw/inc/inetfld.hxx
+++ b/sw/inc/inetfld.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _INETFLD_HXX
-#define _INETFLD_HXX
+#ifndef SW_INETFLD_HXX
+#define SW_INETFLD_HXX
#include "fldbas.hxx"
@@ -69,15 +69,16 @@ class SwINetField : public SwField
String sText;
SvxMacroTableDtor* pMacroTbl;
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
// Direkte Eingabe alten Wert loeschen
SwINetField( SwINetFieldType* pTyp, USHORT nFmt,
const String& rURL, const String& rText );
virtual ~SwINetField();
- virtual String GetCntnt(BOOL bName = FALSE) const;
- virtual String Expand() const;
- virtual SwField* Copy() const;
+ virtual String GetFieldName() const;
// URL
virtual const String& GetPar1() const;
@@ -105,5 +106,5 @@ public:
};
-#endif // _INETFLD_HXX
+#endif // SW_INETFLD_HXX
diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index b2b61dff6434..44d17eb38ca8 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _REFFLD_HXX
-#define _REFFLD_HXX
+#ifndef SW_REFFLD_HXX
+#define SW_REFFLD_HXX
#include <fldbas.hxx>
@@ -99,6 +99,9 @@ private:
USHORT nSubType;
USHORT nSeqNo;
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
// --> OD 2007-08-24 #i81002#
String MakeRefNumStr( const SwTxtNode& rTxtNodeOfField,
const SwTxtNode& rTxtNodeOfReferencedItem,
@@ -110,9 +113,7 @@ public:
virtual ~SwGetRefField();
- virtual String GetCntnt(BOOL bName = FALSE) const;
- virtual String Expand() const;
- virtual SwField* Copy() const;
+ virtual String GetFieldName() const;
const String& GetSetRefName() const { return sSetRefName; }
@@ -158,5 +159,5 @@ public:
};
-#endif // _REFFLD_HXX
+#endif // SW_REFFLD_HXX
diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index d0be4a008cab..6dd556a84436 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -41,8 +41,7 @@ class SwTxtFld : public SwTxtAttr
SwTxtNode * m_pTxtNode;
public:
- SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart,
- bool const bInClipboard);
+ SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart);
virtual ~SwTxtFld();
void CopyFld( SwTxtFld *pDest ) const;
diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx
index b755cbc1631b..dea534074179 100644
--- a/sw/inc/usrfld.hxx
+++ b/sw/inc/usrfld.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _USRFLD_HXX
-#define _USRFLD_HXX
+#ifndef SW_USRFLD_HXX
+#define SW_USRFLD_HXX
#include "swdllapi.h"
#include "fldbas.hxx"
@@ -106,6 +106,9 @@ class SW_DLLPUBLIC SwUserField : public SwValueField
{
USHORT nSubType;
+ virtual String Expand() const;
+ virtual SwField* Copy() const;
+
public:
SwUserField(SwUserFieldType*, USHORT nSub = 0, sal_uInt32 nFmt = 0);
@@ -115,9 +118,7 @@ public:
virtual double GetValue() const;
virtual void SetValue( const double& rVal );
- virtual String Expand() const;
- virtual SwField* Copy() const;
- virtual String GetCntnt(BOOL bName = FALSE) const;
+ virtual String GetFieldName() const;
// Name kann nicht geaendert werden
virtual const String& GetPar1() const;
@@ -129,4 +130,4 @@ public:
virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhichId );
};
-#endif // _USRFLD_HXX
+#endif // SW_USRFLD_HXX
diff --git a/sw/qa/unoapi/knownissues.xcl b/sw/qa/unoapi/knownissues.xcl
index ea5bf843f3ec..99d7c7f12881 100644
--- a/sw/qa/unoapi/knownissues.xcl
+++ b/sw/qa/unoapi/knownissues.xcl
@@ -21,9 +21,6 @@ sw.XMLStylesImporter::com::sun::star::xml::sax::XDocumentHandler
### i23422 ###
sw.SwXTextViewCursor::com::sun::star::beans::XMultiPropertyStates
-### i112111 ###
-sw.SwXViewSettings::com::sun::star::beans::XPropertySet
-
### i23623 ###
sw.SwXStyleFamily::com::sun::star::container::XNameReplace
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index f837fa7a108c..baf76e5fe5ec 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -38,6 +38,7 @@
// #include <cmath>
#include <cfloat>
#include <hintids.hxx>
+#include <osl/diagnose.hxx>
#include <rtl/math.hxx>
#include <editeng/langitem.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -270,7 +271,7 @@ SwCalc::SwCalc( SwDoc& rD )
:
aErrExpr( aEmptyStr, SwSbxValue(), 0 ),
rDoc( rD ),
- pLclData( &SvtSysLocale().GetLocaleData() ),
+ pLclData( m_aSysLocale.GetLocaleDataPtr() ),
pCharClass( &GetAppCharClass() ),
nListPor( 0 ),
eError( CALC_NOERR )
@@ -419,7 +420,7 @@ SwCalc::~SwCalc()
{
for( USHORT n = 0; n < TBLSZ; ++n )
delete VarTable[n];
- if( pLclData != &SvtSysLocale().GetLocaleData() )
+ if( pLclData != m_aSysLocale.GetLocaleDataPtr() )
delete pLclData;
if( pCharClass != &GetAppCharClass() )
delete pCharClass;
@@ -1608,63 +1609,64 @@ String SwCalc::GetDBName(const String& rName)
//------------------------------------------------------------------------------
-/******************************************************************************
- * Methode : BOOL SwCalc::Str2Double( double& )
- * Beschreibung:
- * Erstellt : OK 07.06.94 12:56
- * Aenderung : JP 27.10.98
- ******************************************************************************/
-BOOL SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
- double& rVal, const LocaleDataWrapper* pLclData )
+namespace
{
- const LocaleDataWrapper* pLclD = pLclData;
- if( !pLclD )
- pLclD = &SvtSysLocale().GetLocaleData();
+static bool
+lcl_Str2Double( const String& rCommand, xub_StrLen& rCommandPos, double& rVal,
+ const LocaleDataWrapper* const pLclData )
+{
+ OSL_ASSERT(pLclData);
const xub_Unicode nCurrCmdPos = rCommandPos;
rtl_math_ConversionStatus eStatus;
const sal_Unicode* pEnd;
rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos,
rCommand.GetBuffer() + rCommand.Len(),
- pLclD->getNumDecimalSep().GetChar(0),
- pLclD->getNumThousandSep().GetChar(0),
+ pLclData->getNumDecimalSep().GetChar(0),
+ pLclData->getNumThousandSep().GetChar(0),
&eStatus, &pEnd );
rCommandPos = static_cast<xub_StrLen>(pEnd - rCommand.GetBuffer());
- if( !pLclData && pLclD != &SvtSysLocale().GetLocaleData() )
- delete (LocaleDataWrapper*)pLclD;
-
return rtl_math_ConversionStatus_Ok == eStatus && nCurrCmdPos != rCommandPos;
}
-BOOL SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
- double& rVal, SwDoc* pDoc )
+}
+
+/******************************************************************************
+ * Methode : BOOL SwCalc::Str2Double( double& )
+ * Beschreibung:
+ * Erstellt : OK 07.06.94 12:56
+ * Aenderung : JP 27.10.98
+ ******************************************************************************/
+bool SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
+ double& rVal, const LocaleDataWrapper* const pLclData )
+{
+ const SvtSysLocale aSysLocale;
+ return lcl_Str2Double( rCommand, rCommandPos, rVal,
+ pLclData ? pLclData : aSysLocale.GetLocaleDataPtr() );
+}
+
+bool SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
+ double& rVal, SwDoc* const pDoc )
{
- const LocaleDataWrapper* pLclD = &SvtSysLocale().GetLocaleData();
+ const SvtSysLocale aSysLocale;
+ ::std::auto_ptr<const LocaleDataWrapper> pLclD;
if( pDoc )
{
-
LanguageType eLang = GetDocAppScriptLang( *pDoc );
- if( eLang != SvxLocaleToLanguage( pLclD->getLocale() ) )
- pLclD = new LocaleDataWrapper(
+ if (eLang !=
+ SvxLocaleToLanguage(aSysLocale.GetLocaleData().getLocale()))
+ {
+ pLclD.reset( new LocaleDataWrapper(
::comphelper::getProcessServiceFactory(),
- SvxCreateLocale( eLang ) );
+ SvxCreateLocale( eLang ) ) );
+ }
}
- const xub_Unicode nCurrCmdPos = rCommandPos;
- rtl_math_ConversionStatus eStatus;
- const sal_Unicode* pEnd;
- rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos,
- rCommand.GetBuffer() + rCommand.Len(),
- pLclD->getNumDecimalSep().GetChar(0),
- pLclD->getNumThousandSep().GetChar(0),
- &eStatus, &pEnd );
- rCommandPos = static_cast<xub_StrLen>(pEnd - rCommand.GetBuffer());
-
- if( pLclD != &SvtSysLocale().GetLocaleData() )
- delete (LocaleDataWrapper*)pLclD;
+ bool const bRet = lcl_Str2Double( rCommand, rCommandPos, rVal,
+ (pLclD.get()) ? pLclD.get() : aSysLocale.GetLocaleDataPtr() );
- return rtl_math_ConversionStatus_Ok == eStatus && nCurrCmdPos != rCommandPos;
+ return bRet;
}
//------------------------------------------------------------------------------
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index bf06a19d83b0..37087c189355 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -196,6 +196,10 @@ SwCallLink::~SwCallLink()
{
const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx();
ASSERT( pIndex, "Fly ohne Cntnt" );
+
+ if (!pIndex)
+ return;
+
const SwNode& rStNd = pIndex->GetNode();
if( rStNd.EndOfSectionNode()->StartOfSectionIndex() > nNode ||
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index db3a8b671343..e16207f03fa0 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -717,8 +717,7 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
(SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) );
- pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(),
- pDoc->IsClipBoard() );
+ pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() );
pTxtFld->ChgTxtNode( pTNd );
}
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 4a0697692975..ed4bcc089957 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -143,8 +143,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
// hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen
BOOL bEmpty = RES_TXTATR_FIELD != pHt->Which() ||
!(static_cast<SwTxtFld const*>(pHt)
- ->GetFld().GetFld()->ExpandField(
- rNd.GetDoc()->IsClipBoard()).Len());
+ ->GetFld().GetFld()->ExpandField(true).Len());
if ( bEmpty && nStart == nAkt )
{
rArr.Insert( nAkt, rArr.Count() );
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 3c144bfa24a2..c71c21cccd6c 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2451,7 +2451,7 @@ BOOL SwDoc::ConvertFieldsToText()
nWhich != RES_REFPAGEGETFLD&&
nWhich != RES_REFPAGESETFLD))
{
- String sText = pField->GetCntnt();
+ String sText = pField->ExpandField(true);
//database fields should not convert their command into text
if( RES_DBFLD == pCurType->Which() && !static_cast<const SwDBField*>(pField)->IsInitialized())
sText.Erase();
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 8d975439d510..7e18e990d070 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -2466,24 +2466,26 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
{
SwDBData aDBData(((SwDBNumSetField*)pFld)->GetDBData(&rDoc));
- if( bIsDBMgr &&
- rDoc.GetNewDBMgr()->OpenDataSource( aDBData.sDataSource, aDBData.sCommand )&&
- GETFLD_ALL == eGetMode ||
- ( GETFLD_CALC & eGetMode &&
- ((SwDBNumSetField*)pFld)->IsCondValid()))
+ if (
+ (bIsDBMgr && rDoc.GetNewDBMgr()->OpenDataSource(aDBData.sDataSource, aDBData.sCommand)) &&
+ (GETFLD_ALL == eGetMode || (GETFLD_CALC & eGetMode && ((SwDBNumSetField*)pFld)->IsCondValid()))
+ )
+ {
pFormel = &pFld->GetPar1();
+ }
}
break;
case RES_DBNEXTSETFLD:
{
SwDBData aDBData(((SwDBNextSetField*)pFld)->GetDBData(&rDoc));
- if( bIsDBMgr &&
- rDoc.GetNewDBMgr()->OpenDataSource( aDBData.sDataSource, aDBData.sCommand )&&
- GETFLD_ALL == eGetMode ||
- ( GETFLD_CALC & eGetMode &&
- ((SwDBNextSetField*)pFld)->IsCondValid() ))
+ if (
+ (bIsDBMgr && rDoc.GetNewDBMgr()->OpenDataSource(aDBData.sDataSource, aDBData.sCommand)) &&
+ (GETFLD_ALL == eGetMode || (GETFLD_CALC & eGetMode && ((SwDBNextSetField*)pFld)->IsCondValid()))
+ )
+ {
pFormel = &pFld->GetPar1();
+ }
}
break;
}
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 61bab9fdd525..306f7b3dfcc8 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -333,10 +333,15 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
}
BOOL bNumChg = rInfo.nFtnOffset != GetEndNoteInfo().nFtnOffset;
- BOOL bExtra = !bNumChg &&
- rInfo.aFmt.GetNumberingType() != GetEndNoteInfo().aFmt.GetNumberingType()||
- rInfo.GetPrefix() != GetEndNoteInfo().GetPrefix() ||
- rInfo.GetSuffix() != GetEndNoteInfo().GetSuffix();
+ // this seems to be an optimization: UpdateAllFtn() is only called
+ // if the offset changes; if the offset is the same,
+ // but type/prefix/suffix changes, just set new numbers.
+ bool const bExtra = !bNumChg &&
+ ( (rInfo.aFmt.GetNumberingType() !=
+ GetEndNoteInfo().aFmt.GetNumberingType())
+ || (rInfo.GetPrefix() != GetEndNoteInfo().GetPrefix())
+ || (rInfo.GetSuffix() != GetEndNoteInfo().GetSuffix())
+ );
BOOL bFtnDesc = rInfo.GetPageDesc( *this ) !=
GetEndNoteInfo().GetPageDesc( *this );
SwCharFmt *pOldChrFmt = GetEndNoteInfo().GetCharFmt( *this ),
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 31c4a7dfea3e..f1f288f99d06 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -457,7 +457,7 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
const SwField* const pFld = pAttr->GetFld().GetFld();
if (pFld)
{
- sExp += pFld->ExpandField(rTNd.GetDoc()->IsClipBoard());
+ sExp += pFld->ExpandField(true);
}
}
}
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index 13945a2be5db..aa84aa480121 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -224,8 +224,7 @@ void SwEditShell::FieldToText( SwFieldType* pType )
*pFmtFld->GetTxtFld()->GetStart() );
// Feldinhalt durch Text ersetzen
- String const aEntry(
- pFmtFld->GetFld()->ExpandField(GetDoc()->IsClipBoard()) );
+ String const aEntry( pFmtFld->GetFld()->ExpandField(true) );
pPaM->SetMark();
pPaM->Move( fnMoveForward );
GetDoc()->DeleteRange( *pPaM );
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 182ed12d6ddd..36b981b90752 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -203,7 +203,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
break;
default:
- String const value(pFld->ExpandField(pDoc->IsClipBoard()));
+ String const value(pFld->ExpandField(true));
nRet = rCalcPara.rCalc.Calculate(value).GetDouble();
}
}
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 15c44286921c..ec3f5200ba67 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <float.h>
#include <sfx2/app.hxx>
#include <svl/zforlist.hxx>
@@ -44,15 +43,11 @@
#include <pam.hxx>
#include <ndtxt.hxx>
#include <dbfld.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <docfld.hxx>
#include <expfld.hxx>
#include <txtatr.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
using namespace ::com::sun::star::sdbc;
@@ -281,27 +276,23 @@ SwField* SwDBField::Copy() const
return pTmp;
}
-String SwDBField::GetCntnt(BOOL bName) const
+String SwDBField::GetFieldName() const
{
- if(bName)
- {
- const String& rDBName = ((SwDBFieldType*)GetTyp())->GetName();
+ const String& rDBName = static_cast<SwDBFieldType*>(GetTyp())->GetName();
//TODO/CLEANUP
//Funktion tut nichts!
//String sContent( SFX_APP()->LocalizeDBName(INI2NATIONAL,
// rDBName.GetToken(0, DB_DELIM)));
- String sContent( rDBName.GetToken(0, DB_DELIM) );
+ String sContent( rDBName.GetToken(0, DB_DELIM) );
- if (sContent.Len() > 1)
- {
- sContent += DB_DELIM;
- sContent += rDBName.GetToken(1, DB_DELIM);
- sContent += DB_DELIM;
- sContent += rDBName.GetToken(2, DB_DELIM);
- }
- return lcl_DBTrennConv(sContent);
+ if (sContent.Len() > 1)
+ {
+ sContent += DB_DELIM;
+ sContent += rDBName.GetToken(1, DB_DELIM);
+ sContent += DB_DELIM;
+ sContent += rDBName.GetToken(2, DB_DELIM);
}
- return Expand();
+ return lcl_DBTrennConv(sContent);
}
//------------------------------------------------------------------------------
@@ -547,19 +538,15 @@ void SwDBNameInfField::SetDBData(const SwDBData & rDBData)
//------------------------------------------------------------------------------
-String SwDBNameInfField::GetCntnt(BOOL bName) const
+String SwDBNameInfField::GetFieldName() const
{
- String sStr(SwField::GetCntnt(bName));
-
- if(bName)
+ String sStr( SwField::GetFieldName() );
+ if (aDBData.sDataSource.getLength())
{
- if (aDBData.sDataSource.getLength())
- {
- sStr += ':';
- sStr += String(aDBData.sDataSource);
- sStr += DB_DELIM;
- sStr += String(aDBData.sCommand);
- }
+ sStr += ':';
+ sStr += String(aDBData.sDataSource);
+ sStr += DB_DELIM;
+ sStr += String(aDBData.sCommand);
}
return lcl_DBTrennConv(sStr);
}
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 9e40b9b1d0d9..f6b727987cd3 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1198,30 +1198,30 @@ String SwDocInfoField::Expand() const
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-String SwDocInfoField::GetCntnt(sal_Bool bName) const
+String SwDocInfoField::GetFieldName() const
{
- if ( bName )
- {
- String aStr(SwFieldType::GetTypeStr(GetTypeId()));
- aStr += ':';
+ String aStr(SwFieldType::GetTypeStr(GetTypeId()));
+ aStr += ':';
- sal_uInt16 nSub = nSubType & 0xff;
+ sal_uInt16 const nSub = nSubType & 0xff;
- switch(nSub)
- {
- case DI_CUSTOM:
- aStr += aName;
- break;
+ switch (nSub)
+ {
+ case DI_CUSTOM:
+ aStr += aName;
+ break;
- default:
- aStr += *ViewShell::GetShellRes()->aDocInfoLst[ nSub - DI_SUBTYPE_BEGIN ];
- break;
- }
- if( IsFixed() )
- ( aStr += ' ' ) += ViewShell::GetShellRes()->aFixedStr;
- return aStr;
+ default:
+ aStr += *ViewShell::GetShellRes()
+ ->aDocInfoLst[ nSub - DI_SUBTYPE_BEGIN ];
+ break;
}
- return Expand();
+ if (IsFixed())
+ {
+ aStr += ' ';
+ aStr += ViewShell::GetShellRes()->aFixedStr;
+ }
+ return aStr;
}
/* ---------------------------------------------------------------------------
@@ -1517,25 +1517,20 @@ void SwHiddenTxtField::Evaluate(SwDoc* pDoc)
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-String SwHiddenTxtField::GetCntnt(sal_Bool bName) const
+String SwHiddenTxtField::GetFieldName() const
{
- if ( bName )
- {
- String aStr(SwFieldType::GetTypeStr(nSubType));
- aStr += ' ';
- aStr += aCond;
- aStr += ' ';
- aStr += aTRUETxt;
+ String aStr(SwFieldType::GetTypeStr(nSubType));
+ aStr += ' ';
+ aStr += aCond;
+ aStr += ' ';
+ aStr += aTRUETxt;
- if(nSubType == TYP_CONDTXTFLD)
- {
-static char __READONLY_DATA cTmp[] = " : ";
- aStr.AppendAscii(cTmp);
- aStr += aFALSETxt;
- }
- return aStr;
+ if (nSubType == TYP_CONDTXTFLD)
+ {
+ aStr.AppendAscii(" : ");
+ aStr += aFALSETxt;
}
- return Expand();
+ return aStr;
}
/* ---------------------------------------------------------------------------
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 25b0cf932e83..e55c8598cf90 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -305,18 +305,15 @@ String SwGetExpField::Expand() const
return sExpand;
}
-String SwGetExpField::GetCntnt(BOOL bName) const
-{
- if ( bName )
- {
- String aStr( SwFieldType::GetTypeStr( static_cast<USHORT>(nsSwGetSetExpType::GSE_FORMULA & nSubType
- ? TYP_FORMELFLD
- : TYP_GETFLD ) ));
- aStr += ' ';
- aStr += GetFormula();
- return aStr;
- }
- return Expand();
+String SwGetExpField::GetFieldName() const
+{
+ String aStr( SwFieldType::GetTypeStr(
+ static_cast<USHORT>(((nsSwGetSetExpType::GSE_FORMULA & nSubType) != 0)
+ ? TYP_FORMELFLD
+ : TYP_GETFLD ) ));
+ aStr += ' ';
+ aStr += GetFormula();
+ return aStr;
}
SwField* SwGetExpField::Copy() const
@@ -834,35 +831,28 @@ String SwSetExpField::Expand() const
}
/*--------------------------------------------------------------------
- Beschreibung: liefert den Namen oder den Inhalt
+ @return the field name
--------------------------------------------------------------------*/
-String SwSetExpField::GetCntnt(BOOL bName) const
+String SwSetExpField::GetFieldName() const
{
- if( bName )
- {
- USHORT nStrType;
-
- if( IsSequenceFld() )
- nStrType = TYP_SEQFLD;
- else if( bInput )
- nStrType = TYP_SETINPFLD;
- else
- nStrType = TYP_SETFLD;
+ SwFldTypesEnum const nStrType( (IsSequenceFld())
+ ? TYP_SEQFLD
+ : (bInput)
+ ? TYP_SETINPFLD
+ : TYP_SETFLD );
- String aStr( SwFieldType::GetTypeStr( nStrType ) );
- aStr += ' ';
- aStr += GetTyp()->GetName();
+ String aStr( SwFieldType::GetTypeStr( static_cast<USHORT>(nStrType) ) );
+ aStr += ' ';
+ aStr += GetTyp()->GetName();
- if( TYP_SEQFLD != nStrType )
- {
- // Sequence nicht die Formel ausgeben
- aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " = " ));
- aStr += GetFormula();
- }
- return aStr;
+ // Sequence: without formula
+ if (TYP_SEQFLD != nStrType)
+ {
+ aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " = " ) );
+ aStr += GetFormula();
}
- return Expand();
+ return aStr;
}
SwField* SwSetExpField::Copy() const
@@ -1021,20 +1011,16 @@ SwInputField::SwInputField(SwInputFieldType* pTyp, const String& rContent,
{
}
-String SwInputField::GetCntnt(BOOL bName) const
+String SwInputField::GetFieldName() const
{
- if ( bName )
+ String aStr(SwField::GetFieldName());
+ if ((nSubType & 0x00ff) == INP_USR)
{
- String aStr(SwField::GetCntnt(bName));
- if ((nSubType & 0x00ff) == INP_USR)
- {
- aStr += GetTyp()->GetName();
- aStr += ' ';
- aStr += aContent;
- }
- return aStr;
+ aStr += GetTyp()->GetName();
+ aStr += ' ';
+ aStr += aContent;
}
- return Expand();
+ return aStr;
}
SwField* SwInputField::Copy() const
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index e35c27d0464b..6ffe675c760a 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -28,16 +28,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-// #include <math.h>
#include <float.h>
#include <rtl/math.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <editeng/unolingu.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <doc.hxx>
#include <editsh.hxx>
#include <frame.hxx>
@@ -53,9 +49,7 @@
#include <expfld.hxx>
#include <shellres.hxx>
#include <calc.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <math.h>
#include <float.h>
@@ -269,21 +263,20 @@ USHORT SwField::GetTypeId() const
Beschreibung: liefert den Namen oder den Inhalt
--------------------------------------------------------------------*/
-String SwField::GetCntnt( BOOL bName ) const
+String SwField::GetFieldName() const
{
- String sRet;
- if( bName )
+ USHORT nTypeId = GetTypeId();
+ if (RES_DATETIMEFLD == GetTyp()->Which())
{
- USHORT nTypeId = GetTypeId();
- if( RES_DATETIMEFLD == GetTyp()->Which() )
- nTypeId = static_cast<USHORT>(GetSubType() & DATEFLD ? TYP_DATEFLD : TYP_TIMEFLD);
-
- sRet = SwFieldType::GetTypeStr( nTypeId );
- if( IsFixed() )
- ( sRet += ' ' ) += ViewShell::GetShellRes()->aFixedStr;
+ nTypeId = static_cast<USHORT>(
+ ((GetSubType() & DATEFLD) != 0) ? TYP_DATEFLD : TYP_TIMEFLD);
+ }
+ String sRet = SwFieldType::GetTypeStr( nTypeId );
+ if (IsFixed())
+ {
+ sRet += ' ';
+ sRet += ViewShell::GetShellRes()->aFixedStr;
}
- else
- sRet = Expand();
return sRet;
}
@@ -434,9 +427,9 @@ BOOL SwField::IsFixed() const
return bRet;
}
-String SwField::ExpandField(bool const bInClipboard) const
+String SwField::ExpandField(bool const bCached) const
{
- if (!bInClipboard) // #i85766# do not expand fields in clipboard documents
+ if (!bCached) // #i85766# do not expand fields in clipboard documents
{
m_Cache = Expand();
}
@@ -447,7 +440,8 @@ SwField * SwField::CopyField() const
{
SwField *const pNew = Copy();
// #i85766# cache expansion of source (for clipboard)
- pNew->m_Cache = Expand();
+ // use this->cache, not this->Expand(): only text formatting calls Expand()
+ pNew->m_Cache = m_Cache;
return pNew;
}
diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx
index 70a0d2dcf689..f77bcf1fd457 100644
--- a/sw/source/core/fields/macrofld.cxx
+++ b/sw/source/core/fields/macrofld.cxx
@@ -28,20 +28,19 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <doc.hxx>
#include <docufld.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
#include <comphelper/processfactory.hxx>
+
using namespace ::com::sun::star;
using ::rtl::OUString;
+
/*--------------------------------------------------------------------
Beschreibung: MacroFeldtypen
--------------------------------------------------------------------*/
@@ -79,16 +78,12 @@ SwField* SwMacroField::Copy() const
return new SwMacroField((SwMacroFieldType*)GetTyp(), aMacro, aText);
}
-String SwMacroField::GetCntnt(BOOL bName) const
+String SwMacroField::GetFieldName() const
{
- if(bName)
- {
- String aStr(GetTyp()->GetName());
- aStr += ' ';
- aStr += aMacro;
- return aStr;
- }
- return Expand();
+ String aStr(GetTyp()->GetName());
+ aStr += ' ';
+ aStr += aMacro;
+ return aStr;
}
String SwMacroField::GetLibName() const
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 8b03b7e54664..1af598eb4e46 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -62,18 +62,12 @@
// <--
#include <ftnidx.hxx>
#include <viewsh.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <SwStyleNameMapper.hxx>
#include <shellres.hxx>
#include <poolfmt.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <numrule.hxx>
#include <SwNodeNum.hxx>
@@ -280,11 +274,8 @@ String SwGetRefField::Expand() const
}
-String SwGetRefField::GetCntnt(BOOL bName) const
+String SwGetRefField::GetFieldName() const
{
- if( !bName )
- return Expand();
-
String aStr(GetTyp()->GetName());
aStr += ' ';
aStr += sSetRefName;
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index ae340b9a7ba5..abaacf8abc9e 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -37,9 +37,8 @@
#include <txtfld.hxx>
#include <expfld.hxx>
#include <docfld.hxx> // fuer _SetGetExpFld
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
+
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -91,22 +90,12 @@ SwField* SwTblField::Copy() const
}
-String SwTblField::GetCntnt(BOOL bName) const
+String SwTblField::GetFieldName() const
{
- if( bName )
- {
- String aStr(GetTyp()->GetName());
- aStr += ' ';
-
- USHORT nOldSubType = nSubType;
- SwTblField* pThis = (SwTblField*)this;
- pThis->nSubType |= nsSwExtendedSubType::SUB_CMD;
- aStr += Expand();
- pThis->nSubType = nOldSubType;
-
- return aStr;
- }
- return Expand();
+ String aStr(GetTyp()->GetName());
+ aStr += ' ';
+ aStr += const_cast<SwTblField *>(this)->GetCommand();
+ return aStr;
}
// suche den TextNode, in dem das Feld steht
@@ -127,21 +116,28 @@ const SwNode* SwTblField::GetNodeOfFormula() const
return 0;
}
+String SwTblField::GetCommand()
+{
+ if (EXTRNL_NAME != GetNameType())
+ {
+ SwNode const*const pNd = GetNodeOfFormula();
+ SwTableNode const*const pTblNd = (pNd) ? pNd->FindTableNode() : 0;
+ if (pTblNd)
+ {
+ PtrToBoxNm( &pTblNd->GetTable() );
+ }
+ }
+ return (EXTRNL_NAME == GetNameType())
+ ? SwTableFormula::GetFormula()
+ : String();
+}
String SwTblField::Expand() const
{
String aStr;
if (nSubType & nsSwExtendedSubType::SUB_CMD)
{
- if( EXTRNL_NAME != GetNameType() )
- {
- const SwNode* pNd = GetNodeOfFormula();
- const SwTableNode* pTblNd = pNd ? pNd->FindTableNode() : 0;
- if( pTblNd )
- ((SwTblField*)this)->PtrToBoxNm( &pTblNd->GetTable() );
- }
- if( EXTRNL_NAME == GetNameType() )
- aStr = SwTableFormula::GetFormula();
+ aStr = const_cast<SwTblField *>(this)->GetCommand();
}
else
{
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index f9437cd0fbd5..ccb10ca03ee1 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -40,12 +40,12 @@
#include <doc.hxx>
#include <editsh.hxx>
#include <dpage.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
+
using namespace ::com::sun::star;
using ::rtl::OUString;
+
/*--------------------------------------------------------------------
Beschreibung: Benutzerfelder
--------------------------------------------------------------------*/
@@ -72,17 +72,14 @@ SwField* SwUserField::Copy() const
return pTmp;
}
-String SwUserField::GetCntnt(sal_Bool bName) const
+String SwUserField::GetFieldName() const
{
- if ( bName )
- { String aStr(SwFieldType::GetTypeStr(TYP_USERFLD));
- aStr += ' ';
- aStr += GetTyp()->GetName();
- aStr.AppendAscii(" = ");
- aStr += ((SwUserFieldType*)GetTyp())->GetContent();
- return aStr;
- }
- return Expand();
+ String aStr(SwFieldType::GetTypeStr(TYP_USERFLD));
+ aStr += ' ';
+ aStr += GetTyp()->GetName();
+ aStr.AppendAscii(" = ");
+ aStr += static_cast<SwUserFieldType*>(GetTyp())->GetContent();
+ return aStr;
}
double SwUserField::GetValue() const
diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index d88aae514904..e82f5dc71253 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _TXMSRT_HXX
-#define _TXMSRT_HXX
+#ifndef SW_TXMSRT_HXX
+#define SW_TXMSRT_HXX
#include <i18npool/lang.h>
#include <tox.hxx>
@@ -154,7 +154,7 @@ private:
String sSortTxt;
String sSortTxtReading;
- virtual void _GetText( String&, String& ) = 0;
+ virtual void GetText_Impl( String&, String& ) const = 0;
};
inline void SwTOXSortTabBase::GetTxt( String& rSortTxt,
@@ -163,7 +163,7 @@ inline void SwTOXSortTabBase::GetTxt( String& rSortTxt,
if( !bValidTxt )
{
SwTOXSortTabBase* pThis = (SwTOXSortTabBase*)this;
- pThis->_GetText( pThis->sSortTxt, pThis->sSortTxtReading );
+ pThis->GetText_Impl( pThis->sSortTxt, pThis->sSortTxtReading );
pThis->bValidTxt = TRUE;
}
@@ -194,7 +194,7 @@ struct SwTOXIndex : public SwTOXSortTabBase
virtual BOOL operator<( const SwTOXSortTabBase& );
private:
- virtual void _GetText( String&, String& );
+ virtual void GetText_Impl( String&, String& ) const;
BYTE nKeyLevel;
};
@@ -211,7 +211,7 @@ struct SwTOXCustom : public SwTOXSortTabBase
virtual BOOL operator<( const SwTOXSortTabBase& );
private:
- virtual void _GetText( String&, String& );
+ virtual void GetText_Impl( String&, String& ) const;
String aKey;
String sReading;
@@ -231,7 +231,7 @@ struct SwTOXContent : public SwTOXSortTabBase
virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0 ) const;
virtual USHORT GetLevel() const;
private:
- virtual void _GetText( String&, String& );
+ virtual void GetText_Impl( String&, String& ) const;
};
@@ -248,7 +248,7 @@ struct SwTOXPara : public SwTOXSortTabBase
virtual String GetURL() const;
private:
- virtual void _GetText( String&, String& );
+ virtual void GetText_Impl( String&, String& ) const;
SwTOXElement eType;
USHORT m_nLevel;
@@ -267,7 +267,7 @@ struct SwTOXTable : public SwTOXSortTabBase
virtual String GetURL() const;
private:
- virtual void _GetText( String&, String& );
+ virtual void GetText_Impl( String&, String& ) const;
USHORT nLevel;
};
@@ -277,7 +277,7 @@ struct SwTOXAuthority : public SwTOXSortTabBase
private:
SwFmtFld& m_rField;
virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT nAuthField = 0 ) const;
- virtual void _GetText( String&, String& );
+ virtual void GetText_Impl( String&, String& ) const;
public:
SwTOXAuthority( const SwCntntNode& rNd, SwFmtFld& rField, const SwTOXInternational& rIntl );
@@ -291,4 +291,4 @@ public:
};
-#endif // _TXMSRT_HXX
+#endif // SW_TXMSRT_HXX
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 28287c957ad1..5cd97d1a1d26 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1004,10 +1004,11 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
SwAnchoredObject* pObj = (*GetDrawObjs())[i];
const SwFrmFmt& rFmt = pObj->GetFrmFmt();
const BOOL bFly = pObj->ISA(SwFlyFrm);
- if ( bFly &&
- WEIT_WECH == pObj->GetObjRect().Width()||
- rFmt.GetFrmSize().GetWidthPercent() )
+ if ((bFly && (WEIT_WECH == pObj->GetObjRect().Width()))
+ || rFmt.GetFrmSize().GetWidthPercent())
+ {
continue;
+ }
if ( FLY_AS_CHAR == rFmt.GetAnchor().GetAnchorId() )
{
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 395009122063..661f68603603 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1738,7 +1738,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
// die in den Fussnoten liegen, nicht etwa die (spaltigen) Bereiche,
// in denen die Fussnoten(Container) liegen.
// #109767# Table frame is in section, insert section in cell frame.
- if( pSct && ( pFtnFrm && !pSct->IsInFtn() ) || pUpper->IsCellFrm() )
+ if( pSct && ((pFtnFrm && !pSct->IsInFtn()) || pUpper->IsCellFrm()) )
pSct = NULL;
if( pSct )
{ // damit der SectionFrm nicht zerstoert wird durch pTmp->MoveFwd()
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 01f09f2c41c3..626627a3c993 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1827,10 +1827,11 @@ void SwRootFrm::ImplCalcBrowseWidth()
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
const SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
const BOOL bFly = pAnchoredObj->ISA(SwFlyFrm);
- if ( bFly &&
- WEIT_WECH == pAnchoredObj->GetObjRect().Width()||
- rFmt.GetFrmSize().GetWidthPercent() )
+ if ((bFly && (WEIT_WECH == pAnchoredObj->GetObjRect().Width()))
+ || rFmt.GetFrmSize().GetWidthPercent())
+ {
continue;
+ }
long nWidth = 0;
switch ( rFmt.GetAnchor().GetAnchorId() )
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 36eaed83795c..c4ec51b5ecb4 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -779,7 +779,7 @@ void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax,
case RES_TXTATR_FIELD :
{
SwField *pFld = (SwField*)pHint->GetFld().GetFld();
- const String aTxt = pFld->GetCntnt( FALSE );
+ const String aTxt = pFld->ExpandField(true);
if( lcl_MinMaxString( aArg, aIter.GetFnt(), aTxt, 0,
aTxt.Len() ) )
nAdd = 20;
@@ -982,7 +982,7 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd )
case RES_TXTATR_FIELD :
{
SwField *pFld = (SwField*)pHint->GetFld().GetFld();
- const String aTxt = pFld->GetCntnt( FALSE );
+ String const aTxt = pFld->ExpandField(true);
SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTxt, 0, aTxt.Len() );
nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 526dbe74c4d9..514ac96d3d46 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -106,6 +106,8 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
}
ViewShell *pSh = rInf.GetVsh();
+ SwDoc *const pDoc( (pSh) ? pSh->GetDoc() : 0 );
+ bool const bInClipboard( (pDoc) ? pDoc->IsClipBoard() : true );
sal_Bool bPlaceHolder = sal_False;
switch( pFld->GetTyp()->Which() )
@@ -117,16 +119,26 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
case RES_COMBINED_CHARS:
{
- String sStr( pFld->GetCntnt( bName ));
if( bName )
- pRet = new SwFldPortion( sStr );
+ {
+ String const sName( pFld->GetFieldName() );
+ pRet = new SwFldPortion(sName);
+ }
else
- pRet = new SwCombinedPortion( sStr );
+ {
+ String const sContent( pFld->ExpandField(bInClipboard) );
+ pRet = new SwCombinedPortion(sContent);
+ }
}
break;
case RES_HIDDENTXTFLD:
- pRet = new SwHiddenPortion(pFld->GetCntnt( bName ));
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwHiddenPortion(str);
+ }
break;
case RES_CHAPTERFLD:
@@ -135,13 +147,25 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
((SwChapterField*)pFld)->ChangeExpansion( pFrame,
&((SwTxtFld*)pHint)->GetTxtNode() );
}
- pRet = new SwFldPortion( pFld->GetCntnt( bName ) );
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion( str );
+ }
break;
case RES_DOCSTATFLD:
if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() )
+ {
((SwDocStatField*)pFld)->ChangeExpansion( pFrame );
- pRet = new SwFldPortion( pFld->GetCntnt( bName ) );
+ }
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion( str );
+ }
break;
case RES_PAGENUMBERFLD:
@@ -153,7 +177,6 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
const SwRootFrm* pTmpRootFrm = pSh->GetLayout();
const sal_Bool bVirt = pTmpRootFrm->IsVirtPageNum();
- SwDoc* pDoc = pSh->GetDoc();
MSHORT nVirtNum = pFrame->GetVirtPageNum();
MSHORT nNumPages = pTmpRootFrm->GetPageNum();
sal_Int16 nNumFmt = -1;
@@ -163,7 +186,12 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
pPageNr->ChangeExpansion( pDoc, nVirtNum, nNumPages,
bVirt, nNumFmt > -1 ? &nNumFmt : 0);
}
- pRet = new SwFldPortion( pFld->GetCntnt( bName ) );
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion( str );
+ }
break;
}
case RES_GETEXPFLD:
@@ -183,7 +211,12 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
pExpFld->ChgBodyTxtFlag( sal_True );
}
}
- pRet = new SwFldPortion( pFld->GetCntnt( bName ) );
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion( str );
+ }
break;
}
case RES_DBFLD:
@@ -207,13 +240,25 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
}
*/
}
- pRet = new SwFldPortion( pFld->GetCntnt( bName ) );
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion(str);
+ }
break;
}
case RES_REFPAGEGETFLD:
if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() )
+ {
((SwRefPageGetField*)pFld)->ChangeExpansion( pFrame, (SwTxtFld*)pHint );
- pRet = new SwFldPortion( pFld->GetCntnt( bName ) );
+ }
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion(str);
+ }
break;
case RES_JUMPEDITFLD:
@@ -224,9 +269,12 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
break;
default:
- {
- pRet = new SwFldPortion(pFld->GetCntnt( bName ) );
- }
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion(str);
+ }
}
if( bNewFlyPor )
@@ -249,7 +297,12 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
else
pTmpFnt->SetDiffFnt( &pChFmt->GetAttrSet(), pFrm->GetTxtNode()->getIDocumentSettingAccess() );
}
- pRet = new SwFldPortion( pFld->GetCntnt( bName ), pTmpFnt, bPlaceHolder );
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion(str, pTmpFnt, bPlaceHolder);
+ }
}
return pRet;
@@ -488,13 +541,7 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
}
else
{
- // --> OD 2006-06-02 #b6432095#
- // use method <SwNumRule::MakeNumString(..)> instead of
- // method <SwTxtNode::GetNumString()>, because for levels with
- // numbering none the prefix and the suffix strings have to be provided.
-// XubString aTxt( pTxtNd->GetNumString() );
- XubString aTxt( pNumRule->MakeNumString( *(pTxtNd->GetNum()) ) );
- // <--
+ XubString aTxt( pTxtNd->GetNumString() );
// --> OD 2008-01-23 #newlistlevelattrs#
if ( aTxt.Len() > 0 )
{
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 61f873b010b7..ba3145c1139b 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -51,9 +51,7 @@
#include <authfld.hxx>
#include <toxwrap.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <numrule.hxx>
extern BOOL IsFrameBehind( const SwTxtNode& rMyNd, xub_StrLen nMySttPos,
@@ -403,7 +401,7 @@ BOOL SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase )
//
-void SwTOXIndex::_GetText( String& rTxt, String& rTxtReading )
+void SwTOXIndex::GetText_Impl( String& rTxt, String& rTxtReading ) const
{
ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort");
const SwTOXMark& rTOXMark = pTxtMark->GetTOXMark();
@@ -530,7 +528,7 @@ USHORT SwTOXCustom::GetLevel() const
}
-void SwTOXCustom::_GetText( String& rTxt, String &rTxtReading )
+void SwTOXCustom::GetText_Impl( String& rTxt, String &rTxtReading ) const
{
rTxt = aKey;
rTxtReading = sReading;
@@ -553,7 +551,7 @@ SwTOXContent::SwTOXContent( const SwTxtNode& rNd, const SwTxtTOXMark* pMark,
// Der Text des Inhalts
//
-void SwTOXContent::_GetText( String& rTxt, String& rTxtReading )
+void SwTOXContent::GetText_Impl( String& rTxt, String& rTxtReading ) const
{
const xub_StrLen* pEnd = pTxtMark->GetEnd();
if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() )
@@ -612,7 +610,7 @@ SwTOXPara::SwTOXPara( const SwCntntNode& rNd, SwTOXElement eT, USHORT nLevel )
}
-void SwTOXPara::_GetText( String& rTxt, String& )
+void SwTOXPara::GetText_Impl( String& rTxt, String& ) const
{
const SwCntntNode* pNd = aTOXSources[0].pNd;
switch( eType )
@@ -801,7 +799,7 @@ SwTOXTable::SwTOXTable( const SwCntntNode& rNd )
}
-void SwTOXTable::_GetText( String& rTxt, String& )
+void SwTOXTable::GetText_Impl( String& rTxt, String& ) const
{
const SwNode* pNd = aTOXSources[0].pNd;
if( pNd && 0 != ( pNd = pNd->FindTableNode() ) )
@@ -868,11 +866,14 @@ USHORT SwTOXAuthority::GetLevel() const
/*-- 15.09.99 14:28:08---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwTOXAuthority::_GetText( String& rTxt, String& )
+static String lcl_GetText(SwFmtFld const& rField)
+{
+ return rField.GetFld()->ExpandField(true);
+}
+
+void SwTOXAuthority::GetText_Impl( String& rTxt, String& ) const
{
- bool const isClipBoard(
- m_rField.GetTxtFld()->GetTxtNode().GetDoc()->IsClipBoard());
- rTxt = m_rField.GetFld()->ExpandField(isClipBoard);
+ rTxt = lcl_GetText(m_rField);
}
/* -----------------21.09.99 12:50-------------------
@@ -885,7 +886,7 @@ void SwTOXAuthority::FillText( SwTxtNode& rNd,
String sText;
if(AUTH_FIELD_IDENTIFIER == nAuthField)
{
- sText = pField->Expand();
+ sText = lcl_GetText(m_rField);
const SwAuthorityFieldType* pType = (const SwAuthorityFieldType*)pField->GetTyp();
sal_Unicode cChar = pType->GetPrefix();
if(cChar && cChar != ' ')
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 6b1adc76fbec..be01f06cd472 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -259,10 +259,9 @@ BOOL SwFmtFld::IsProtect() const
|*
*************************************************************************/
-SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos,
- bool const bInClipboard)
+SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos)
: SwTxtAttr( rAttr, nStartPos )
- , m_aExpand( rAttr.GetFld()->ExpandField(bInClipboard) )
+ , m_aExpand( rAttr.GetFld()->ExpandField(true) )
, m_pTxtNode( 0 )
{
rAttr.pTxtAttr = this;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 76560bae91d7..a708b2d60312 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -99,6 +99,10 @@
#include <list.hxx>
// <--
+
+using namespace ::com::sun::star;
+
+
SV_DECL_PTRARR( TmpHints, SwTxtAttr*, 0, 4 )
TYPEINIT1( SwTxtNode, SwCntntNode )
@@ -2834,13 +2838,19 @@ XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, cons
}
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule &&
- IsCountedInList() &&
- pRule->Get( static_cast<USHORT>(GetActualListLevel()) ).IsTxtFmt() )
+ IsCountedInList() )
{
- return pRule->MakeNumString( GetNum()->GetNumberVector(),
+ SvxNumberType const& rNumberType(
+ pRule->Get( static_cast<USHORT>(GetActualListLevel()) ) );
+ if (rNumberType.IsTxtFmt() ||
+ // #b6432095#
+ (style::NumberingType::NUMBER_NONE == rNumberType.GetNumberingType()))
+ {
+ return pRule->MakeNumString( GetNum()->GetNumberVector(),
_bInclPrefixAndSuffixStrings ? TRUE : FALSE,
FALSE,
_nRestrictToThisLevel );
+ }
}
return aEmptyStr;
@@ -3057,8 +3067,7 @@ void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
{
const XubString aExpand(
static_cast<SwTxtFld const*>(pAttr)->GetFld()
- .GetFld()->ExpandField(
- GetDoc()->IsClipBoard()));
+ .GetFld()->ExpandField(true));
rTxt.Insert( aExpand, nPos );
nPos = nPos + aExpand.Len();
nEndPos = nEndPos + aExpand.Len();
@@ -3207,7 +3216,7 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
{
XubString const aExpand(
static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld()
- ->ExpandField(GetDoc()->IsClipBoard()));
+ ->ExpandField(true));
if( aExpand.Len() )
{
aDestIdx++; // dahinter einfuegen;
@@ -3305,7 +3314,7 @@ const ModelToViewHelper::ConversionMap*
{
const XubString aExpand(
static_cast<SwTxtFld const*>(pAttr)->GetFld().GetFld()
- ->ExpandField(GetDoc()->IsClipBoard()));
+ ->ExpandField(true));
if ( aExpand.Len() > 0 )
{
const xub_StrLen nFieldPos = *pAttr->GetStart();
@@ -5080,8 +5089,6 @@ bool SwTxtNode::IsInContent() const
#include <unoparagraph.hxx>
-using namespace ::com::sun::star;
-
uno::Reference< rdf::XMetadatable >
SwTxtNode::MakeUnoObject()
{
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index ac2f281b0d90..4d56942ecef4 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1043,8 +1043,7 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
pNew = new SwTxtINetFmt( (SwFmtINetFmt&)rNew, nStt, nEnd );
break;
case RES_TXTATR_FIELD:
- pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt,
- rDoc.IsClipBoard() );
+ pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt );
break;
case RES_TXTATR_FLYCNT:
{
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index bd4a4ce5ef98..f63fee217e29 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1267,13 +1267,16 @@ uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) th
OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
- OUString sRet;
- const SwField* pField = GetField();
- if(pField)
- sRet = pField->GetCntnt(bShowCommand);
- else
+
+ SwField const*const pField = GetField();
+ if (!pField)
+ {
throw uno::RuntimeException();
- return sRet;
+ }
+ ::rtl::OUString const ret( (bShowCommand)
+ ? pField->GetFieldName()
+ : pField->ExpandField(true) );
+ return ret;
}
/* -----------------18.02.99 13:39-------------------
*
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index c1ba4908a339..f2a8229c3092 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -125,7 +125,7 @@ BOOL SwASC_AttrIter::OutAttr( xub_StrLen nSwPos )
{
case RES_TXTATR_FIELD:
sOut = static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld()
- ->ExpandField(rWrt.pDoc->IsClipBoard());
+ ->ExpandField(true);
break;
case RES_TXTATR_FTN:
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index 50b7bdc7ddc8..6b905e450dee 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -305,7 +305,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
}
// Inhalt des Feldes ausgeben
- String const sExpand( pFld->ExpandField(rWrt.pDoc->IsClipBoard()) );
+ String const sExpand( pFld->ExpandField(true) );
sal_Bool bNeedsCJKProcessing = sal_False;
if( sExpand.Len() )
{
diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx
index 17050299c84b..db91ec79d2e7 100644
--- a/sw/source/filter/rtf/rtfatr.cxx
+++ b/sw/source/filter/rtf/rtfatr.cxx
@@ -1425,7 +1425,7 @@ void ExportPICT(const Size &rOrig, const Size &rRendered, const Size &rMapped,
const SwCropGrf &rCr, const char *pBLIPType, const sal_uInt8 *pGraphicAry,
unsigned long nSize, SwRTFWriter &rWrt)
{
- bool bIsWMF = (const char *)pBLIPType == (const char *)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false;
+ bool bIsWMF = (pBLIPType && !strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE)) ? true : false;
if (pBLIPType && nSize && pGraphicAry)
{
rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_PICT;
@@ -1570,7 +1570,7 @@ static Writer& OutRTF_SwGrfNode(Writer& rWrt, SwCntntNode & rNode)
the wmf format wrapped in nonshppict, so as to keep wordpad happy. If its
a wmf already then we don't need any such wrapping
*/
- bool bIsWMF = (const sal_Char*)pBLIPType == (const sal_Char*)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false;
+ bool bIsWMF = (pBLIPType && !strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE)) ? true : false;
if (!bIsWMF)
OutComment(rRTFWrt, OOO_STRING_SVTOOLS_RTF_SHPPICT);
@@ -2903,7 +2903,7 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
case RES_HIDDENTXTFLD:
if( TYP_CONDTXTFLD == ((SwHiddenTxtField*)pFld)->GetSubType() )
RTFOutFuncs::Out_String( rWrt.Strm(),
- pFld->ExpandField(rWrt.pDoc->IsClipBoard()),
+ pFld->ExpandField(true),
rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
else
{
@@ -2960,7 +2960,7 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
if( ' ' != cCh ) // vorweg immer einen Trenner
rWrt.Strm() << ' ';
RTFOutFuncs::Out_String( rWrt.Strm(),
- pFld->ExpandField(rWrt.pDoc->IsClipBoard()),
+ pFld->ExpandField(true),
rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
}
break;
@@ -2970,7 +2970,7 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
{
rWrt.Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << ' ';
RTFOutFuncs::Out_String( rWrt.Strm(),
- pFld->ExpandField(rWrt.pDoc->IsClipBoard()),
+ pFld->ExpandField(true),
rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
rWrt.Strm() << "}}";
rRTFWrt.bOutFmtAttr = FALSE;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 7f1b6658800e..c7f5c06cb81c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -343,7 +343,8 @@ void WW8Export::DoFormText(const SwInputField * pFld)
OutputField(0, ww::eFORMTEXT, aEmptyStr, WRITEFIELD_CMD_END);
- SwWW8Writer::WriteString16(Strm(), pFld->Expand(), false);
+ String const fieldStr( pFld->ExpandField(true) );
+ SwWW8Writer::WriteString16(Strm(), fieldStr, false);
static BYTE aArr2[] = {
0x03, 0x6a, 0x00, 0x00, 0x00, 0x00, // sprmCPicLocation
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 89aef162ec01..6e00687ffafa 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1743,9 +1743,9 @@ static void InsertSpecialChar( WW8Export& rWrt, BYTE c,
aItems.GetData());
}
-String lcl_GetExpandedField(const SwField &rFld, SwDoc const& rDoc)
+String lcl_GetExpandedField(const SwField &rFld)
{
- String sRet(rFld.ExpandField(rDoc.IsClipBoard()));
+ String sRet(rFld.ExpandField(true));
//replace LF 0x0A with VT 0x0B
sRet.SearchAndReplaceAll(0x0A, 0x0B);
@@ -1871,7 +1871,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
{
String sOut;
if( pFld )
- sOut = lcl_GetExpandedField(*pFld, *pDoc);
+ sOut = lcl_GetExpandedField(*pFld);
else
sOut = rFldCmd;
if( sOut.Len() )
@@ -2598,7 +2598,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef)
sStr.APPEND_CONST_ASC( "\" " );
m_rWW8Export.OutputField( &rFld, ww::eREF, sStr, WRITEFIELD_START |
WRITEFIELD_CMD_START | WRITEFIELD_CMD_END );
- String sVar = lcl_GetExpandedField( rFld, *GetExport().pDoc );
+ String sVar = lcl_GetExpandedField( rFld );
if ( sVar.Len() )
{
if ( m_rWW8Export.IsUnicode() )
@@ -2614,7 +2614,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef)
void WW8AttributeOutput::WriteExpand( const SwField* pFld )
{
- String sExpand( lcl_GetExpandedField( *pFld, *GetExport().pDoc ) );
+ String sExpand( lcl_GetExpandedField( *pFld ) );
if ( m_rWW8Export.IsUnicode() )
SwWW8Writer::WriteString16( m_rWW8Export.Strm(), sExpand, false );
else
@@ -2776,7 +2776,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
if (pDocInfoField != NULL)
{
- String sFieldname = pDocInfoField->GetCntnt(TRUE);
+ String sFieldname = pDocInfoField->GetFieldName();
xub_StrLen nIndex = sFieldname.Search(':');
if (nIndex != sFieldname.Len())
diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx
index 91ea1e13b077..08fb91dcc3c6 100644
--- a/sw/source/ui/docvw/AnnotationWin.cxx
+++ b/sw/source/ui/docvw/AnnotationWin.cxx
@@ -208,7 +208,8 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText)
{
//collect our old meta data
SwSidebarWin* pWin = Mgr().GetNextPostIt(KEY_PAGEUP, this);
- const LocaleDataWrapper& rLocalData = SvtSysLocale().GetLocaleData();
+ const SvtSysLocale aSysLocale;
+ const LocaleDataWrapper& rLocalData = aSysLocale.GetLocaleData();
String aText = String(SW_RES(STR_REPLY));
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pWin->GetAuthor());
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index dc4f006e2026..884409826362 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -389,7 +389,8 @@ void SwSidebarWin::InitControls()
void SwSidebarWin::CheckMetaText()
{
- const LocaleDataWrapper& rLocalData = SvtSysLocale().GetLocaleData();
+ const SvtSysLocale aSysLocale;
+ const LocaleDataWrapper& rLocalData = aSysLocale.GetLocaleData();
String sMeta = GetAuthor();
if (sMeta.Len() == 0)
{
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index be201c32c24e..1ecf32144ee5 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -304,8 +304,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
{
USHORT nOldSubType = pFld->GetSubType();
((SwField*)pFld)->SetSubType(nsSwExtendedSubType::SUB_CMD);
- sTxt =
- pFld->ExpandField(rSh.GetDoc()->IsClipBoard());
+ sTxt = pFld->ExpandField(true);
((SwField*)pFld)->SetSubType(nOldSubType);
}
break;
@@ -340,7 +339,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
break;
case RES_DBFLD:
- sTxt = ((SwDBField*)pFld)->GetCntnt(TRUE);
+ sTxt = pFld->GetFieldName();
break;
case RES_USERFLD:
diff --git a/sw/source/ui/fldui/DropDownFieldDialog.cxx b/sw/source/ui/fldui/DropDownFieldDialog.cxx
index 68ce692f6a32..1d3fafa880a1 100644
--- a/sw/source/ui/fldui/DropDownFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFieldDialog.cxx
@@ -32,21 +32,14 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
#include <wrtsh.hxx>
#include <fldbas.hxx>
#include <fldmgr.hxx>
-#ifndef _MSGBOX_HXX
#include <vcl/msgbox.hxx>
-#endif
#include <DropDownFieldDialog.hxx>
#include <flddropdown.hxx>
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _SW_DROPDOWNFIELDDIALOG_HRC
#include <DropDownFieldDialog.hrc>
-#endif
using namespace ::com::sun::star;
@@ -124,13 +117,12 @@ void sw::DropDownFieldDialog::Apply()
{
rSh.StartAllAction();
- SwDropDownField * pCopy = (SwDropDownField *) pDropField->Copy();
+ ::std::auto_ptr<SwDropDownField> const pCopy(
+ static_cast<SwDropDownField *>( pDropField->CopyField() ) );
pCopy->SetPar1(sSelect);
rSh.SwEditShell::UpdateFlds(*pCopy);
- delete pCopy;
-
rSh.SetUndoNoResetModified();
rSh.EndAllAction();
}
diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx
index 46c05c4ac63b..6676b72a1f84 100644
--- a/sw/source/ui/fldui/inpdlg.cxx
+++ b/sw/source/ui/fldui/inpdlg.cxx
@@ -32,13 +32,7 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
-
-#define _INPDLG_CXX
-
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <unotools/charclass.hxx>
#include <editeng/unolingu.hxx>
#include <wrtsh.hxx>
@@ -48,12 +42,8 @@
#include <inpdlg.hxx>
#include <fldmgr.hxx>
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _INPDLG_HRC
#include <inpdlg.hrc>
-#endif
/*--------------------------------------------------------------------
@@ -128,7 +118,9 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS,
//values are formatted - formulas are not
CharClass aCC( SvxCreateLocale( pSetFld->GetLanguage() ));
if( aCC.isNumeric( sFormula ))
- aStr = pSetFld->Expand();
+ {
+ aStr = pSetFld->ExpandField(true);
+ }
else
aStr = sFormula;
aLabelED.SetText( pSetFld->GetPromptText() );
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 5bff86b1a4c7..49bd1b2a0c7e 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1080,7 +1080,7 @@ BOOL SwFrmPage::FillItemSet(SfxItemSet &rSet)
aWidthED .GetValue() == aWidthED .GetMin() &&
aHeightED.GetValue() == aHeightED.GetMin());
- if ((bNew && !bFormat) || (bValueModified || bCheckChanged) && bLegalValue)
+ if ((bNew && !bFormat) || ((bValueModified || bCheckChanged) && bLegalValue))
{
sal_Int64 nNewWidth = aWidthED.DenormalizePercent(aWidthED.GetRealValue(FUNIT_TWIP));
sal_Int64 nNewHeight = aHeightED.DenormalizePercent(aHeightED.GetRealValue(FUNIT_TWIP));
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index c3d56910ad5a..75b76b6de887 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -916,7 +916,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
case HANDLE_VIEWSET_TABSTOPS : bBoolVal = mpConstViewOption->IsTab(sal_True); break;
case HANDLE_VIEWSET_BREAKS : bBoolVal = mpConstViewOption->IsLineBreak(sal_True); break;
case HANDLE_VIEWSET_HIDDEN_TEXT : bBoolVal = mpConstViewOption->IsShowHiddenField(); break;
- case HANDLE_VIEWSET_HIDDEN_CHARACTERS : bBoolVal = mpConstViewOption->IsShowHiddenChar(); break;
+ case HANDLE_VIEWSET_HIDDEN_CHARACTERS : bBoolVal = mpConstViewOption->IsShowHiddenChar(sal_True); break;
case HANDLE_VIEWSET_HIDDEN_PARAGRAPHS : bBoolVal = mpConstViewOption->IsShowHiddenPara(); break;
case HANDLE_VIEWSET_TABLE_BOUNDARIES : bBoolVal = SwViewOption::IsTableBoundaries(); break;
case HANDLE_VIEWSET_TEXT_BOUNDARIES : bBoolVal = SwViewOption::IsDocBoundaries(); break;
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 1f1fc9149e34..df068ad0673d 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -910,7 +910,10 @@ SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/
SwDocShell* pDocSh;
SfxObjectShellRef xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SFX_CREATE_MODE_STANDARD ) );
xDocSh->DoInitNew( 0 );
- rOldSh.FillPrtDoc(pDocSh->GetDoc(), pPrt);
+ SwDoc *const pTempDoc( pDocSh->GetDoc() );
+ // #i103634#, #i112425#: do not expand numbering and fields on PDF export
+ pTempDoc->SetClipBoard(true);
+ rOldSh.FillPrtDoc(pTempDoc, pPrt);
SfxViewFrame* pDocFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 );
SwView* pDocView = (SwView*) pDocFrame->GetViewShell();
pDocView->AttrChangedNotify( &pDocView->GetWrtShell() );//Damit SelectShell gerufen wird.
diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx
index d40283e39146..75e412a27eb6 100644
--- a/sw/source/ui/utlui/initui.cxx
+++ b/sw/source/ui/utlui/initui.cxx
@@ -260,7 +260,8 @@ ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( SvStringsDtor& rLst )
p->SearchAndReplace(C2S("%1"), C2S(",,"));
p->SearchAndReplace(C2S("%2"), C2S("''"));
#else
- const LocaleDataWrapper& rLclD = SvtSysLocale().GetLocaleData();
+ const SvtSysLocale aSysLocale;
+ const LocaleDataWrapper& rLclD = aSysLocale.GetLocaleData();
//unter richtigen Betriebssystemen funktioniert es auch so
p->SearchAndReplace(C2S("%1"), rLclD.getDoubleQuotationMarkStart());
p->SearchAndReplace(C2S("%2"), rLclD.getDoubleQuotationMarkEnd());
diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx
index 01f6c4e84d7a..32c355313d7f 100644
--- a/sw/source/ui/utlui/uitool.cxx
+++ b/sw/source/ui/utlui/uitool.cxx
@@ -730,7 +730,8 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, USHORT *pPercent,
String GetAppLangDateTimeString( const DateTime& rDT )
{
- const LocaleDataWrapper& rAppLclData = SvtSysLocale().GetLocaleData();
+ const SvtSysLocale aSysLocale;
+ const LocaleDataWrapper& rAppLclData = aSysLocale.GetLocaleData();
String sRet( rAppLclData.getDate( rDT ));
( sRet += ' ' ) += rAppLclData.getTime( rDT, FALSE, FALSE );
return sRet;