summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-09-13 20:38:36 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-09-19 10:08:55 +0200
commit185e75da2e353f3d1245aa8f86618bd2912b26c4 (patch)
tree3b88a6c2411aaaf4fbb34579154f2b756019c623
parentsw_redlinehide_2: view cursor: IsSelOnePara(),IsStartPara(),IsEndPara() (diff)
downloadcore-185e75da2e353f3d1245aa8f86618bd2912b26c4.tar.gz
core-185e75da2e353f3d1245aa8f86618bd2912b26c4.zip
sw_redlinehide_2: remove one bool from SwTextNode::ExpandText()
... to make call sites both more readable and more flexible. Change-Id: I28932290799cb3c354cdcaad8e426050bcfede50
-rw-r--r--sw/inc/ndtxt.hxx3
-rw-r--r--sw/source/core/doc/DocumentOutlineNodesManager.cxx4
-rw-r--r--sw/source/core/fields/chpfld.cxx2
-rw-r--r--sw/source/core/fields/reffld.cxx4
-rw-r--r--sw/source/core/tox/txmsrt.cxx2
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx6
6 files changed, 11 insertions, 10 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 68a8a499b119..64bdaa3a5cc1 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -61,6 +61,7 @@ class SwWrongList;
class SwGrammarMarkUp;
struct SwDocStat;
struct SwParaIdleData_Impl;
+enum class ExpandMode;
namespace sw { namespace mark { enum class RestoreMode; } }
@@ -686,7 +687,7 @@ public:
const bool bWithNum = false,
const bool bAddSpaceAfterListLabelStr = false,
const bool bWithSpacesForLevel = false,
- const bool bWithFootnote = true ) const;
+ const ExpandMode eAdditionalMode = ExpandMode(0)) const;
bool GetExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx,
sal_Int32 nIdx, sal_Int32 nLen,
bool bWithNum = false, bool bWithFootnote = true,
diff --git a/sw/source/core/doc/DocumentOutlineNodesManager.cxx b/sw/source/core/doc/DocumentOutlineNodesManager.cxx
index c129887b7f68..db448ec4f609 100644
--- a/sw/source/core/doc/DocumentOutlineNodesManager.cxx
+++ b/sw/source/core/doc/DocumentOutlineNodesManager.cxx
@@ -19,6 +19,7 @@
#include <DocumentOutlineNodesManager.hxx>
#include <doc.hxx>
#include <ndtxt.hxx>
+#include <modeltoviewhelper.hxx>
namespace sw
{
@@ -45,7 +46,8 @@ OUString DocumentOutlineNodesManager::getOutlineText( const tSortedOutlineNodeLi
{
return m_rDoc.GetNodes().GetOutLineNds()[ nIdx ]->
GetTextNode()->GetExpandText( 0, -1, bWithNumber,
- bWithNumber, bWithSpacesForLevel, bWithFootnote );
+ bWithNumber, bWithSpacesForLevel,
+ bWithFootnote ? ExpandMode::ExpandFootnote : ExpandMode(0));
}
SwTextNode* DocumentOutlineNodesManager::getOutlineNode( const tSortedOutlineNodeList::size_type nIdx ) const
diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index 68b2749cedc6..7093e940764a 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -187,7 +187,7 @@ void SwChapterField::ChangeExpansion(const SwTextNode &rTextNd, bool bSrchNum)
sNumber = "??";
}
- sTitle = removeControlChars(pTextNd->GetExpandText(0, -1, false, false, false, false));
+ sTitle = removeControlChars(pTextNd->GetExpandText(0, -1, false, false, false));
}
}
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index b7ad1cb81f33..e1ca14410486 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -396,7 +396,7 @@ OUString SwGetRefField::GetExpandedTextOfReferencedTextNode() const
{
const SwTextNode* pReferencedTextNode( GetReferencedTextNode() );
return pReferencedTextNode
- ? pReferencedTextNode->GetExpandText( 0, -1, true, true, false, false )
+ ? pReferencedTextNode->GetExpandText(0, -1, true, true, false)
: OUString();
}
@@ -538,7 +538,7 @@ void SwGetRefField::UpdateField( const SwTextField* pFieldTextAttr )
if( nStart != nEnd ) // a section?
{
- m_sText = pTextNd->GetExpandText( nStart, nEnd - nStart, false, false, false, false );
+ m_sText = pTextNd->GetExpandText(nStart, nEnd - nStart, false, false, false);
// remove all special characters (replace them with blanks)
if( !m_sText.isEmpty() )
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index a5dbd956b0c5..801c7679d26d 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -502,7 +502,7 @@ TextAndReading SwTOXPara::GetText_Impl() const
return TextAndReading(static_cast<const SwTextNode*>(pNd)->GetExpandText(
nStartIndex,
nEndIndex == -1 ? -1 : nEndIndex - nStartIndex,
- false, false, false, false),
+ false, false, false),
OUString());
}
break;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 30cfed591c78..14f87719a334 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3392,12 +3392,10 @@ OUString SwTextNode::GetExpandText( const sal_Int32 nIdx,
const bool bWithNum,
const bool bAddSpaceAfterListLabelStr,
const bool bWithSpacesForLevel,
- const bool bWithFootnote ) const
+ const ExpandMode eAdditionalMode) const
{
- ExpandMode eMode = ExpandMode::ExpandFields;
- if (bWithFootnote)
- eMode |= ExpandMode::ExpandFootnote;
+ ExpandMode eMode = ExpandMode::ExpandFields | eAdditionalMode;
ModelToViewHelper aConversionMap(*this, eMode);
const OUString aExpandText = aConversionMap.getViewText();