[Libreoffice-commits] core.git: sw/source

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Sun Mar 8 16:06:29 UTC 2020


 sw/source/core/fields/authfld.cxx |   19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

New commits:
commit 6a2958f3d91af30a93f0b8726eba626d809186b0
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sat Mar 7 16:49:42 2020 +0100
Commit:     Björn Michaelsen <bjoern.michaelsen at 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.michaelsen at 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;
 }
 


More information about the Libreoffice-commits mailing list