sw/source/core/fields/authfld.cxx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
New commits: commit 6a2958f3d91af30a93f0b8726eba626d809186b0 Author: Bjoern Michaelsen <bjoern.michael...@libreoffice.org> AuthorDate: Sat Mar 7 16:49:42 2020 +0100 Commit: Björn Michaelsen <bjoern.michael...@libreoffice.org> CommitDate: Sun Mar 8 17:05:49 2020 +0100 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.michael...@libreoffice.org> 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; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits