diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/ndtxt.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/tox/txmsrt.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 14 |
3 files changed, 16 insertions, 11 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 10c227a0a056..d204527165e0 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -679,8 +679,9 @@ public: const bool bAddSpaceAfterListLabelStr = false, const bool bWithSpacesForLevel = false, const ExpandMode eAdditionalMode = ExpandMode(0)) const; - bool GetExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx, + bool CopyExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx, sal_Int32 nIdx, sal_Int32 nLen, + SwRootFrame const* pLayout, bool bWithNum = false, bool bWithFootnote = true, bool bReplaceTabsWithSpaces = false ) const; diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 21897e4c8530..9b0da776fc5d 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -464,9 +464,9 @@ void SwTOXContent::FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 { const sal_Int32* pEnd = pTextMark->End(); if( pEnd && !pTextMark->GetTOXMark().IsAlternativeText() ) - static_cast<const SwTextNode*>(aTOXSources[0].pNd)->GetExpandText( rNd, &rInsPos, - pTextMark->GetStart(), - *pEnd - pTextMark->GetStart() ); + static_cast<const SwTextNode*>(aTOXSources[0].pNd)->CopyExpandText( + rNd, &rInsPos, pTextMark->GetStart(), + *pEnd - pTextMark->GetStart(), nullptr ); else { rNd.InsertText( GetText().sText, rInsPos ); @@ -538,9 +538,9 @@ void SwTOXPara::FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) if( SwTOXElement::Template == eType || SwTOXElement::Sequence == eType || SwTOXElement::OutlineLevel == eType) { const SwTextNode* pSrc = static_cast<const SwTextNode*>(aTOXSources[0].pNd); - pSrc->GetExpandText( rNd, &rInsPos, nStartIndex, + pSrc->CopyExpandText( rNd, &rInsPos, nStartIndex, nEndIndex == -1 ? -1 : nEndIndex - nStartIndex, - false, false, true ); + nullptr, false, false, true ); } else { diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index e8ffba5f77e5..cbf522687445 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3427,8 +3427,9 @@ OUString SwTextNode::GetExpandText( const sal_Int32 nIdx, return aText.makeStringAndClear(); } -bool SwTextNode::GetExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx, - sal_Int32 nIdx, sal_Int32 nLen, bool bWithNum, +bool SwTextNode::CopyExpandText(SwTextNode& rDestNd, const SwIndex* pDestIdx, + sal_Int32 nIdx, sal_Int32 nLen, + SwRootFrame const*const pLayout, bool bWithNum, bool bWithFootnote, bool bReplaceTabsWithSpaces ) const { if( &rDestNd == this ) @@ -3519,14 +3520,17 @@ bool SwTextNode::GetExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx, { const SwFormatFootnote& rFootnote = pHt->GetFootnote(); OUString sExpand; + auto const number(pLayout && pLayout->IsHideRedlines() + ? rFootnote.GetNumberRLHidden() + : rFootnote.GetNumber()); if( !rFootnote.GetNumStr().isEmpty() ) sExpand = rFootnote.GetNumStr(); else if( rFootnote.IsEndNote() ) sExpand = GetDoc()->GetEndNoteInfo().aFormat. - GetNumStr( rFootnote.GetNumber() ); + GetNumStr(number); else sExpand = GetDoc()->GetFootnoteInfo().aFormat. - GetNumStr( rFootnote.GetNumber() ); + GetNumStr(number); if( !sExpand.isEmpty() ) { ++aDestIdx; // insert behind @@ -3558,7 +3562,7 @@ bool SwTextNode::GetExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx, if( bWithNum ) { aDestIdx = nDestStt; - rDestNd.InsertText( GetNumString(), aDestIdx ); + rDestNd.InsertText( GetNumString(true, MAXLEVEL, pLayout), aDestIdx ); } aDestIdx = 0; |