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

New commits:
commit b87e2d3c25c8e97330f001fc525de90a372492f0
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Wed Apr 30 21:07:00 2025 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Mon May 5 05:35:58 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>

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 524b3b5d88a0..ec7e718f3b82 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