Kaydet (Commit) f1db4171 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide_3: adapt SwSetExpFieldType::GetSeqFieldList()

Change-Id: Iea24b3823b648066e331dc5e9789c79662727a12
üst 17cf1b26
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
class SfxPoolItem; class SfxPoolItem;
class SwTextNode; class SwTextNode;
class SwFrame; class SwFrame;
class SwRootFrame;
struct SwPosition; struct SwPosition;
class SwTextField; class SwTextField;
class SwDoc; class SwDoc;
...@@ -170,7 +171,7 @@ public: ...@@ -170,7 +171,7 @@ public:
void SetSeqRefNo( SwSetExpField& rField ); void SetSeqRefNo( SwSetExpField& rField );
size_t GetSeqFieldList( SwSeqFieldList& rList ); size_t GetSeqFieldList(SwSeqFieldList& rList, SwRootFrame const* pLayout);
/// Number sequence fields chapterwise if required. /// Number sequence fields chapterwise if required.
const OUString& GetDelimiter() const { return m_sDelim; } const OUString& GetDelimiter() const { return m_sDelim; }
......
...@@ -617,20 +617,25 @@ void SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rField ) ...@@ -617,20 +617,25 @@ void SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rField )
rField.SetSeqNumber( n ); rField.SetSeqNumber( n );
} }
size_t SwSetExpFieldType::GetSeqFieldList( SwSeqFieldList& rList ) size_t SwSetExpFieldType::GetSeqFieldList(SwSeqFieldList& rList,
SwRootFrame const*const pLayout)
{ {
rList.Clear(); rList.Clear();
IDocumentRedlineAccess const& rIDRA(GetDoc()->getIDocumentRedlineAccess());
SwIterator<SwFormatField,SwFieldType> aIter( *this ); SwIterator<SwFormatField,SwFieldType> aIter( *this );
for( SwFormatField* pF = aIter.First(); pF; pF = aIter.Next() ) for( SwFormatField* pF = aIter.First(); pF; pF = aIter.Next() )
{ {
const SwTextNode* pNd; const SwTextNode* pNd;
if( pF->GetTextField() && if( pF->GetTextField() &&
nullptr != ( pNd = pF->GetTextField()->GetpTextNode() ) && nullptr != ( pNd = pF->GetTextField()->GetpTextNode() ) &&
pNd->GetNodes().IsDocNodes() ) pNd->GetNodes().IsDocNodes()
&& (!pLayout || !pLayout->IsHideRedlines()
|| !sw::IsFieldDeletedInModel(rIDRA, *pF->GetTextField())))
{ {
SeqFieldLstElem aNew( SeqFieldLstElem aNew(
pNd->GetExpandText(nullptr/*TODO*/), pNd->GetExpandText(pLayout),
static_cast<SwSetExpField*>(pF->GetField())->GetSeqNumber() ); static_cast<SwSetExpField*>(pF->GetField())->GetSeqNumber() );
rList.InsertSort( aNew ); rList.InsertSort( aNew );
} }
......
...@@ -667,7 +667,7 @@ void SwFieldRefPage::UpdateSubType(const OUString& filterString) ...@@ -667,7 +667,7 @@ void SwFieldRefPage::UpdateSubType(const OUString& filterString)
if(IsFieldEdit()) if(IsFieldEdit())
sOldSel.clear(); 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 ) for( size_t n = 0; n < nCnt; ++n )
{ {
bool isSubstring = MatchSubstring(aArr[ n ].sDlgEntry, filterString); bool isSubstring = MatchSubstring(aArr[ n ].sDlgEntry, filterString);
...@@ -1085,7 +1085,8 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* ) ...@@ -1085,7 +1085,8 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* )
nSubType = REF_SEQUENCEFLD; nSubType = REF_SEQUENCEFLD;
aName = pType->GetName(); 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 ); aVal = OUString::number( aArr[nPos].nSeqNo );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment