diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-07 14:42:02 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-15 15:10:05 +0100 |
commit | da6aeed295599217df56d84580672391561b268f (patch) | |
tree | 55ff30c27544a65e6703cf593587f5024e3690df | |
parent | b8b53e54e3873275c3ab40b4ec9217c00727ed26 (diff) |
sw: parameter of SwChapterField::ChangeExpansion() is required
Change-Id: I2d992719c86ec7d0203173c6f9008cf4845b3855
-rw-r--r-- | sw/inc/chpfld.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/chpfld.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/fields/reffld.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/text/txtfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/tox/ToxTextGenerator.cxx | 2 |
5 files changed, 7 insertions, 9 deletions
diff --git a/sw/inc/chpfld.hxx b/sw/inc/chpfld.hxx index 695a21c395c4..51c2ef040c09 100644 --- a/sw/inc/chpfld.hxx +++ b/sw/inc/chpfld.hxx @@ -61,7 +61,7 @@ public: SwChapterField(SwChapterFieldType*, sal_uInt32 nFormat = 0); // #i53420# - void ChangeExpansion( const SwFrame*, + void ChangeExpansion( const SwFrame&, const SwContentNode*, bool bSrchNum = false); void ChangeExpansion(const SwTextNode &rNd, bool bSrchNum); diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx index 7093e940764a..b96f3e887687 100644 --- a/sw/source/core/fields/chpfld.cxx +++ b/sw/source/core/fields/chpfld.cxx @@ -98,18 +98,17 @@ std::unique_ptr<SwField> SwChapterField::Copy() const } // #i53420# -void SwChapterField::ChangeExpansion(const SwFrame* pFrame, +void SwChapterField::ChangeExpansion(const SwFrame & rFrame, const SwContentNode* pContentNode, bool bSrchNum ) { - OSL_ENSURE( pFrame, "In which frame am I?" ); SwDoc* pDoc = const_cast<SwDoc*>(pContentNode->GetDoc()); const SwTextNode* pTextNode = dynamic_cast<const SwTextNode*>(pContentNode); - if ( !pTextNode || !pFrame->IsInDocBody() ) + if (!pTextNode || !rFrame.IsInDocBody()) { SwPosition aDummyPos( pDoc->GetNodes().GetEndOfContent() ); - pTextNode = GetBodyTextNode( *pDoc, aDummyPos, *pFrame ); + pTextNode = GetBodyTextNode( *pDoc, aDummyPos, rFrame ); } if ( pTextNode ) diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 90eff6796a67..d73494e20ab3 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -605,12 +605,11 @@ void SwGetRefField::UpdateField( const SwTextField* pFieldTextAttr ) SwChapterFieldType aFieldTyp; SwChapterField aField( &aFieldTyp, 0 ); aField.SetLevel( MAXLEVEL - 1 ); - aField.ChangeExpansion( pFrame, pTextNd, true ); + aField.ChangeExpansion( *pFrame, pTextNd, true ); m_sText = aField.GetNumber(); if (!m_sSetReferenceLanguage.isEmpty()) lcl_formatReferenceLanguage(m_sText, false, GetLanguage(), m_sSetReferenceLanguage); - } } break; diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 52b6c57e6c10..ce9ede4c13f6 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -123,7 +123,7 @@ SwExpandPortion *SwTextFormatter::NewFieldPortion( SwTextFormatInfo &rInf, case SwFieldIds::Chapter: if( !bName && pSh && !pSh->Imp()->IsUpdateExpFields() ) { - static_cast<SwChapterField*>(pField)->ChangeExpansion( pFrame, + static_cast<SwChapterField*>(pField)->ChangeExpansion(*pFrame, &static_txtattr_cast<SwTextField const*>(pHint)->GetTextNode()); } { diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx index 43df06ad2e07..9ff14b6eedb6 100644 --- a/sw/source/core/tox/ToxTextGenerator.cxx +++ b/sw/source/core/tox/ToxTextGenerator.cxx @@ -368,7 +368,7 @@ ToxTextGenerator::ObtainChapterField(SwChapterFieldType* chapterFieldType, SwChapterField retval(chapterFieldType, chapterToken->nChapterFormat); retval.SetLevel(static_cast<sal_uInt8>(chapterToken->nOutlineLevel - 1)); // #i53420# - retval.ChangeExpansion(contentFrame, contentNode, true); + retval.ChangeExpansion(*contentFrame, contentNode, true); return retval; } } // end namespace sw |