From 12cbb804a5ad8b076dd330bb7e2ea67d4bb1bba1 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 8 Nov 2018 11:56:54 +0100 Subject: sw_redlinehide_3: SwNodeText::GetExpandText overload is... ... apparently only used by ToX code; rename uniquely & add layout parameter. Change-Id: I0f94787fecd913912f122a654f183ac59b16e30a --- sw/inc/ndtxt.hxx | 3 ++- sw/source/core/tox/txmsrt.cxx | 10 +++++----- sw/source/core/txtnode/ndtxt.cxx | 14 +++++++++----- 3 files changed, 16 insertions(+), 11 deletions(-) (limited to 'sw') 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(aTOXSources[0].pNd)->GetExpandText( rNd, &rInsPos, - pTextMark->GetStart(), - *pEnd - pTextMark->GetStart() ); + static_cast(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(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; -- cgit v1.2.3