sw/source/core/doc/DocumentFieldsManager.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit f1e5f9040234575a023c023b2b4654e4fbcd6389
Author:     Bjoern Michaelsen <bjoern.michael...@libreoffice.org>
AuthorDate: Sun Mar 15 00:36:51 2020 +0100
Commit:     Björn Michaelsen <bjoern.michael...@libreoffice.org>
CommitDate: Sun Mar 15 02:22:25 2020 +0100

    DocumentFieldManager::UpdateTableFields(): SwIterator no more ...
    
    Change-Id: Ic2d4fa7fe191f60837feab578e3573e21dab3d7f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90504
    Tested-by: Jenkins
    Reviewed-by: Björn Michaelsen <bjoern.michael...@libreoffice.org>

diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx 
b/sw/source/core/doc/DocumentFieldsManager.cxx
index f68fdf02e27b..9b06c4d1998c 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -710,15 +710,14 @@ void DocumentFieldsManager::UpdateTableFields( 
SfxPoolItem* pHt )
 
     if( pFieldType )
     {
-        SwIterator<SwFormatField,SwFieldType> aIter( *pFieldType );
-        for( SwFormatField* pFormatField = aIter.Last(); pFormatField; 
pFormatField = aIter.Previous() )
+        std::vector<SwFormatField*> vFields;
+        pFieldType->GatherFields(vFields);
+        for(SwFormatField* pFormatField: vFields)
         {
                 // start calculation at the end
                 // new fields are inserted at the beginning of the modify chain
                 // that gives faster calculation on import
                 // mba: do we really need this "optimization"? Is it still 
valid?
-                if (!pFormatField->GetTextField())
-                    continue;
                 SwTableField *const 
pField(static_cast<SwTableField*>(pFormatField->GetField()));
                 if (nsSwExtendedSubType::SUB_CMD & pField->GetSubType())
                     continue;
@@ -728,8 +727,6 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* 
pHt )
                 {
                     // table where this field is located
                     const SwTextNode& rTextNd = 
pFormatField->GetTextField()->GetTextNode();
-                    if( !rTextNd.GetNodes().IsDocNodes() )
-                        continue;
                     const SwTableNode* pTableNd = rTextNd.FindTableNode();
                     if( !pTableNd )
                         continue;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to