sd/source/filter/eppt/pptx-epptooxml.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit ab7038a68de4c345b43ff1ec5a45ae962ccee8ab
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Wed Apr 30 21:07:00 2025 +0900
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon May 5 09:48:25 2025 +0200

    sd: rename FontCollector to FontNameCollector, comments, fixes
    
    Rename FotnCollector to FontNameCollector, as it better reflects
    what the class does. Document the class and add some minor
    changes to make the code nicer.
    
    Change-Id: I7e7b08f5e8913bed29b74a240eeaeacbf4984379
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184828
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit b87e2d3c25c8e97330f001fc525de90a372492f0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184948
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index a8841e2c1ba6..71763d973ca2 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -553,7 +553,13 @@ struct EmbeddedFont
 
 namespace
 {
-class FontCollector : public sd::ModelTraverseHandler
+
+/** Collects font names of fonts used in the document
+ *
+ * Uses the model traverser to traverse the document model.
+ * Can be parameterized to filter latin, asian or complex scripts.
+ */
+class FontNameCollector : public sd::ModelTraverseHandler
 {
 private:
     std::unordered_set<OUString>& mrUsedFontNames;
@@ -600,7 +606,7 @@ private:
     }
 
 public:
-    FontCollector(std::unordered_set<OUString>& rUsedFontNames, bool 
bEmbedLatinScript, bool bEmbedAsianScript, bool bEmbedComplexScript)
+    FontNameCollector(std::unordered_set<OUString>& rUsedFontNames, bool 
bEmbedLatinScript, bool bEmbedAsianScript, bool bEmbedComplexScript)
         : mrUsedFontNames(rUsedFontNames)
         , mbEmbedLatinScript(bEmbedLatinScript)
         , mbEmbedAsianScript(bEmbedAsianScript)
@@ -706,9 +712,9 @@ std::unordered_set<OUString> 
PowerPointExport::getUsedFontList()
         }
     }
 
-    std::shared_ptr<FontCollector> pFontCollector(new 
FontCollector(aReturnSet, mbEmbedLatinScript, mbEmbedAsianScript, 
mbEmbedComplexScript));
+    auto pCollector = std::make_shared<FontNameCollector>(aReturnSet, 
mbEmbedLatinScript, mbEmbedAsianScript, mbEmbedComplexScript);
     sd::ModelTraverser aModelTraverser(pDocument, { .mbPages = true, 
.mbMasterPages = true });
-    aModelTraverser.addNodeHandler(pFontCollector);
+    aModelTraverser.addNodeHandler(pCollector);
     aModelTraverser.traverse();
 
     return aReturnSet;

Reply via email to