summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-08 11:56:54 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-10 19:49:27 +0100
commit12cbb804a5ad8b076dd330bb7e2ea67d4bb1bba1 (patch)
treebcbe60186dea29f506bfb04266d625610dca6fa7
parent0a258ae8698639b6fd62dcea3663d7ce510bc3c2 (diff)
sw_redlinehide_3: SwNodeText::GetExpandText overload is...
... apparently only used by ToX code; rename uniquely & add layout parameter. Change-Id: I0f94787fecd913912f122a654f183ac59b16e30a
-rw-r--r--sw/inc/ndtxt.hxx3
-rw-r--r--sw/source/core/tox/txmsrt.cxx10
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx14
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;