From ab9f13a659e73e3bb15f995f8d78fb439b73ae59 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Tue, 10 Mar 2020 22:59:38 +0100 Subject: DocumentStatisticsManager: SwIterator no more ... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I179db8fe1762a4931a4752c9c865f8c1e1b4fc4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90309 Tested-by: Jenkins Reviewed-by: Björn Michaelsen --- sw/source/core/doc/DocumentStatisticsManager.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx index e8bef7ca9d25..75e605a4f83d 100644 --- a/sw/source/core/doc/DocumentStatisticsManager.cxx +++ b/sw/source/core/doc/DocumentStatisticsManager.cxx @@ -134,15 +134,12 @@ bool DocumentStatisticsManager::IncrementalDocStatCalculate(long nChars, bool bF // #i93174#: notes contain paragraphs that are not nodes { SwFieldType * const pPostits( m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::Postit) ); - SwIterator aIter( *pPostits ); - for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) + std::vector vFields; + pPostits->GatherFields(vFields); + for(auto pFormatField : vFields) { - if (pFormatField->IsFieldInDoc()) - { - SwPostItField const * const pField( - static_cast(pFormatField->GetField())); - mpDocStat->nAllPara += pField->GetNumberOfParagraphs(); - } + const auto pField = static_cast(pFormatField->GetField()); + mpDocStat->nAllPara += pField->GetNumberOfParagraphs(); } } -- cgit