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

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 20 13:57:04 UTC 2019


 xmloff/source/style/XMLFontAutoStylePool.cxx |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 3e52f67c49b5cde7661d0cca2ea72ff10d55a12c
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Aug 20 14:32:46 2019 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Aug 20 15:56:03 2019 +0200

    Simplify iteration over XMLFontAutoStylePool_Impl
    
    ... which has begin() and end().
    
    Change-Id: I3de0abdcdfc31825693e594d67318a7267bb8d83
    Reviewed-on: https://gerrit.libreoffice.org/77810
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index af44e28525d7..d8e9462f965c 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -394,16 +394,13 @@ void XMLFontAutoStylePool::exportXML()
     const SvXMLUnitConverter& rUnitConv = GetExport().GetMM100UnitConverter();
 
     std::map<OUString, OUString> fontFilesMap; // our url to document url
-    sal_uInt32 nCount = m_pFontAutoStylePool->size();
 
     std::unordered_set<OUString> aUsedFontNames;
     if (m_bEmbedUsedOnly)
         aUsedFontNames = getUsedFontList();
 
-    for (sal_uInt32 i = 0; i < nCount; i++)
+    for (const auto& pEntry : *m_pFontAutoStylePool)
     {
-        const XMLFontAutoStylePoolEntry_Impl* pEntry = (*m_pFontAutoStylePool)[i].get();
-
         GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, pEntry->GetName());
 
         aAny <<= pEntry->GetFamilyName();


More information about the Libreoffice-commits mailing list