summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2020-03-07 16:49:42 +0100
committerBjörn Michaelsen <bjoern.michaelsen@libreoffice.org>2020-03-08 17:05:49 +0100
commit6a2958f3d91af30a93f0b8726eba626d809186b0 (patch)
tree2ebbdea71837dee7379180cb7e52d5e8349f5ce8
parentbb51f81507a405266d251297684bd3ab60998197 (diff)
SwAuthorityFieldType::GetSequencePos(): SwIterator no more ...
Change-Id: Ibe6b2d2f534fad296c46ef6c3c18c63ccbf265e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90170 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
-rw-r--r--sw/source/core/fields/authfld.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 6e0af56c4a51..018a6d4908f3 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -181,31 +181,23 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(const SwAuthEntry* pAuthEntry,
SwRootFrame const*const pLayout)
{
//find the field in a sorted array of handles,
-#if OSL_DEBUG_LEVEL > 0
- bool bCurrentFieldWithoutTextNode = false;
-#endif
if(!m_SequArr.empty() && m_SequArr.size() != m_DataArr.size())
DelSequenceArray();
if(m_SequArr.empty())
{
IDocumentRedlineAccess const& rIDRA(m_pDoc->getIDocumentRedlineAccess());
+ SwTOXInternational aIntl(m_eLanguage, SwTOIOptions::NONE, m_sSortAlgorithm);
// sw_redlinehide: need 2 arrays because the sorting may be different,
// if multiple fields refer to the same entry and first one is deleted
std::vector<std::unique_ptr<SwTOXSortTabBase>> aSortArr;
std::vector<std::unique_ptr<SwTOXSortTabBase>> aSortArrRLHidden;
- SwIterator<SwFormatField,SwFieldType> aIter( *this );
-
- SwTOXInternational aIntl(m_eLanguage, SwTOIOptions::NONE, m_sSortAlgorithm);
-
- for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() )
+ std::vector<SwFormatField*> vFields;
+ GatherFields(vFields);
+ for(SwFormatField* pFormatField : vFields)
{
const SwTextField* pTextField = pFormatField->GetTextField();
if(!pTextField || !pTextField->GetpTextNode())
{
-#if OSL_DEBUG_LEVEL > 0
- if(pAuthEntry == static_cast<SwAuthorityField*>(pFormatField->GetField())->GetAuthEntry())
- bCurrentFieldWithoutTextNode = true;
-#endif
continue;
}
const SwTextNode& rFieldTextNode = pTextField->GetTextNode();
@@ -289,9 +281,6 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(const SwAuthEntry* pAuthEntry,
return i + 1;
}
}
-#if OSL_DEBUG_LEVEL > 0
- OSL_ENSURE(bCurrentFieldWithoutTextNode, "Handle not found");
-#endif
return 0;
}