summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-08 14:59:17 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-14 18:42:15 +0100
commit76ea34e606b358f14f104e496f316fc616abd3f6 (patch)
tree30a1a48b28edd2e3279fdda25bd4da7907cf0876
parent11ab5aaeb9e50386b3cace4471fc2cd747420cce (diff)
sw_redlinehide_3: adapt SwSetExpFieldType::GetSeqFieldList()
Change-Id: Iea24b3823b648066e331dc5e9789c79662727a12
-rw-r--r--sw/inc/expfld.hxx3
-rw-r--r--sw/source/core/fields/expfld.cxx11
-rw-r--r--sw/source/ui/fldui/fldref.cxx5
3 files changed, 13 insertions, 6 deletions
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 6acf1a02c987..c82d1e0edab8 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -29,6 +29,7 @@
class SfxPoolItem;
class SwTextNode;
class SwFrame;
+class SwRootFrame;
struct SwPosition;
class SwTextField;
class SwDoc;
@@ -170,7 +171,7 @@ public:
void SetSeqRefNo( SwSetExpField& rField );
- size_t GetSeqFieldList( SwSeqFieldList& rList );
+ size_t GetSeqFieldList(SwSeqFieldList& rList, SwRootFrame const* pLayout);
/// Number sequence fields chapterwise if required.
const OUString& GetDelimiter() const { return m_sDelim; }
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index e7b9aebfdeb0..964d9d5d150f 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -617,20 +617,25 @@ void SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rField )
rField.SetSeqNumber( n );
}
-size_t SwSetExpFieldType::GetSeqFieldList( SwSeqFieldList& rList )
+size_t SwSetExpFieldType::GetSeqFieldList(SwSeqFieldList& rList,
+ SwRootFrame const*const pLayout)
{
rList.Clear();
+ IDocumentRedlineAccess const& rIDRA(GetDoc()->getIDocumentRedlineAccess());
+
SwIterator<SwFormatField,SwFieldType> aIter( *this );
for( SwFormatField* pF = aIter.First(); pF; pF = aIter.Next() )
{
const SwTextNode* pNd;
if( pF->GetTextField() &&
nullptr != ( pNd = pF->GetTextField()->GetpTextNode() ) &&
- pNd->GetNodes().IsDocNodes() )
+ pNd->GetNodes().IsDocNodes()
+ && (!pLayout || !pLayout->IsHideRedlines()
+ || !sw::IsFieldDeletedInModel(rIDRA, *pF->GetTextField())))
{
SeqFieldLstElem aNew(
- pNd->GetExpandText(nullptr/*TODO*/),
+ pNd->GetExpandText(pLayout),
static_cast<SwSetExpField*>(pF->GetField())->GetSeqNumber() );
rList.InsertSort( aNew );
}
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index ba94bc890781..47f5cc9b1692 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -667,7 +667,7 @@ void SwFieldRefPage::UpdateSubType(const OUString& filterString)
if(IsFieldEdit())
sOldSel.clear();
- const size_t nCnt = pType->GetSeqFieldList( aArr );
+ const size_t nCnt = pType->GetSeqFieldList(aArr, pSh->GetLayout());
for( size_t n = 0; n < nCnt; ++n )
{
bool isSubstring = MatchSubstring(aArr[ n ].sDlgEntry, filterString);
@@ -1085,7 +1085,8 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* )
nSubType = REF_SEQUENCEFLD;
aName = pType->GetName();
- if (pType->GetSeqFieldList(aArr) && aArr.SeekEntry(aElem, &nPos))
+ if (pType->GetSeqFieldList(aArr, pSh->GetLayout())
+ && aArr.SeekEntry(aElem, &nPos))
{
aVal = OUString::number( aArr[nPos].nSeqNo );