diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-01-09 01:17:26 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-01-09 01:21:13 +0100 |
commit | 741e8b7b9d8e1a8f758edfe1c017801aa3d51247 (patch) | |
tree | b48f614e95270b503b08e53c50c9907f767b1470 /sw/inc | |
parent | 9669d2bdea00b86874831d0c2555e7f85f2ca209 (diff) |
fdo#58074: store page number in SwPageNumberField
Should hopefully fix the problem, which is essentially that all
SwPageNumberFields share a single SwPageNumberFieldType, which is only
updated properly in SwTxtFormatter::NewFldPortion, hence all expansions
of a SwPageNumberField other than that return wrong values.
Does not fix the problem for fields in headers though, which appears
much harder...
Change-Id: Iecf363c8acbc2aaa418cc0c980e0b62c8e0e7d14
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/docufld.hxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index d1ae27fbd7ee..0779b256dd69 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -142,14 +142,14 @@ enum SwJumpEditFormat class SwPageNumberFieldType : public SwFieldType { sal_Int16 nNumberingType; - sal_uInt16 nNum, nMax; bool bVirtuell; public: SwPageNumberFieldType(); - String& Expand( sal_uInt32 nFmt, short nOff, const String&, String& rRet ) const; - void ChangeExpansion( SwDoc* pDoc, sal_uInt16 nNum, sal_uInt16 nMax, + String& Expand( sal_uInt32 nFmt, short nOff, sal_uInt16 const nPageNumber, + sal_uInt16 const nMaxPage, const String&, String& rRet ) const; + void ChangeExpansion( SwDoc* pDoc, sal_Bool bVirtPageNum, const sal_Int16* pNumFmt = 0 ); virtual SwFieldType* Copy() const; }; @@ -163,10 +163,18 @@ class SW_DLLPUBLIC SwPageNumberField : public SwField String sUserStr; sal_uInt16 nSubType; short nOffset; + // fdo#58074 store page number in SwField, not SwFieldType + sal_uInt16 m_nPageNumber; + sal_uInt16 m_nMaxPage; public: SwPageNumberField(SwPageNumberFieldType*, sal_uInt16 nSub = PG_RANDOM, - sal_uInt32 nFmt = 0, short nOff = 0); + sal_uInt32 nFmt = 0, short nOff = 0, + sal_uInt16 const nPageNumber = 0, + sal_uInt16 const nMaxPage = 0); + + void ChangeExpansion(sal_uInt16 const nPageNumber, + sal_uInt16 const nMaxPage); virtual String Expand() const; virtual SwField* Copy() const; |