diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-08 11:56:54 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-15 15:10:06 +0100 |
commit | 623d1c5017bba364f6bc28c7c99b46e5cd9f8b76 (patch) | |
tree | 34a8b1f46686886d0e68fed286d1450898d622bd /sw | |
parent | ae246b44da1708417aaaefe4f9186cfbbb9a9137 (diff) |
sw_redlinehide_3: SwNodeText::GetExpandText overload is...
... apparently only used by ToX code; rename uniquely & add layout
parameter.
Change-Id: I0f94787fecd913912f122a654f183ac59b16e30a
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; |