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

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 10 07:18:29 UTC 2020


 sw/source/core/doc/docfld.cxx |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit a2f3c4b7a40acd28eba313730bed8b2474165970
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sat Mar 7 17:08:17 2020 +0100
Commit:     Björn Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Tue Mar 10 08:17:57 2020 +0100

    SwDoc::GetDBDesc(): SwIterator no more ...
    
    Change-Id: I1ed505d07cd8b96ac7f683846ef2053077792a12
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90172
    Tested-by: Jenkins
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at libreoffice.org>

diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 16acdec86cfa..36d7f5118def 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -363,17 +363,14 @@ const SwDBData& SwDoc::GetDBDesc()
                     case SwFieldIds::DbNumSet:
                     case SwFieldIds::DbSetNumber:
                     {
-                        SwIterator<SwFormatField,SwFieldType> aIter( rFieldType );
-                        for( SwFormatField* pField = aIter.First(); pField; pField = aIter.Next() )
+                        std::vector<SwFormatField*> vFields;
+                        rFieldType.GatherFields(vFields);
+                        if(vFields.size())
                         {
-                            if(pField->IsFieldInDoc())
-                            {
-                                if(SwFieldIds::Database == nWhich)
-                                    maDBData = static_cast < SwDBFieldType * > (pField->GetField()->GetTyp())->GetDBData();
-                                else
-                                    maDBData = static_cast < SwDBNameInfField* > (pField->GetField())->GetRealDBData();
-                                break;
-                            }
+                            if(SwFieldIds::Database == nWhich)
+                                maDBData = static_cast<SwDBFieldType*>(vFields.front()->GetField()->GetTyp())->GetDBData();
+                            else
+                                maDBData = static_cast<SwDBNameInfField*> (vFields.front()->GetField())->GetRealDBData();
                         }
                     }
                     break;


More information about the Libreoffice-commits mailing list