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:24:01 +0100 |
commit | 0cb7aa288537d8740f4781e0c38e4df7394888ab (patch) | |
tree | 21af1ab4bde1cbfe1ad37b794d6228126e464596 /sw/inc | |
parent | ca3f80193d52e058170aa91ec21b61343ac07fbe (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
(cherry picked from commit 741e8b7b9d8e1a8f758edfe1c017801aa3d51247)
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; |