[Libreoffice-commits] core.git: 2 commits - vcl/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 30 16:41:34 UTC 2019


 vcl/source/gdi/pdfwriter_impl.hxx |  106 +++++++++++++++++++-------------------
 1 file changed, 55 insertions(+), 51 deletions(-)

New commits:
commit 2351ee06d6c4d5af35b46d63510d93c618ad0276
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Dec 30 12:23:50 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Dec 30 17:41:15 2019 +0100

    pdf: move FontEmit, Glyph, FontSubset, EmbedFont from PDFWriterImpl
    
    Change-Id: I8032a31d3237459713ec386c6810b6f05daabf08
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86005
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 3696316c0626..e93d4005121e 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -286,6 +286,33 @@ public:
     }
 };
 
+struct FontEmit
+{
+    sal_Int32           m_nFontID;
+    std::map<sal_GlyphId, GlyphEmit>     m_aMapping;
+
+    explicit FontEmit( sal_Int32 nID ) : m_nFontID( nID ) {}
+};
+
+struct Glyph
+{
+    sal_Int32   m_nFontID;
+    sal_uInt8   m_nSubsetGlyphID;
+};
+
+struct FontSubset
+{
+    std::vector< FontEmit >        m_aSubsets;
+    std::map<sal_GlyphId, Glyph>         m_aMapping;
+};
+
+struct EmbedFont
+{
+    sal_Int32                       m_nNormalFontID;
+
+    EmbedFont() : m_nNormalFontID( 0 ) {}
+};
+
 }
 
 class PDFWriterImpl : public VirtualDevice
@@ -295,30 +322,6 @@ class PDFWriterImpl : public VirtualDevice
 public:
     friend struct vcl::pdf::PDFPage;
 
-    struct FontEmit
-    {
-        sal_Int32           m_nFontID;
-        std::map<sal_GlyphId, GlyphEmit>     m_aMapping;
-
-        explicit FontEmit( sal_Int32 nID ) : m_nFontID( nID ) {}
-    };
-    struct Glyph
-    {
-        sal_Int32   m_nFontID;
-        sal_uInt8   m_nSubsetGlyphID;
-    };
-    struct FontSubset
-    {
-        std::vector< FontEmit >        m_aSubsets;
-        std::map<sal_GlyphId, Glyph>         m_aMapping;
-    };
-    struct EmbedFont
-    {
-        sal_Int32                       m_nNormalFontID;
-
-        EmbedFont() : m_nNormalFontID( 0 ) {}
-    };
-
     struct PDFDest
     {
         sal_Int32                   m_nPage;
commit fffc244319a4f39beef3739c9d08c087e713f36b
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Dec 30 12:19:26 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Dec 30 17:41:01 2019 +0100

    pdf: move GlyphEmit out of PDFWriterImpl class
    
    Change-Id: I9ea67cd219a7304baa7abe20be207156a4c0e75e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86004
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 57e9ca4eb9c7..3696316c0626 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -256,6 +256,36 @@ struct TransparencyEmit
     {}
 };
 
+// font subsets
+class GlyphEmit
+{
+    // performance: actually this should probably a vector;
+    std::vector<sal_Ucs>            m_CodeUnits;
+    sal_uInt8                       m_nSubsetGlyphID;
+
+public:
+    GlyphEmit() : m_nSubsetGlyphID(0)
+    {
+    }
+
+    void setGlyphId( sal_uInt8 i_nId ) { m_nSubsetGlyphID = i_nId; }
+    sal_uInt8 getGlyphId() const { return m_nSubsetGlyphID; }
+
+    void addCode( sal_Ucs i_cCode )
+    {
+        m_CodeUnits.push_back(i_cCode);
+    }
+    sal_Int32 countCodes() const { return m_CodeUnits.size(); }
+    const std::vector<sal_Ucs>& codes() const { return m_CodeUnits; }
+    sal_Ucs getCode( sal_Int32 i_nIndex ) const
+    {
+        sal_Ucs nRet = 0;
+        if (static_cast<size_t>(i_nIndex) < m_CodeUnits.size())
+            nRet = m_CodeUnits[i_nIndex];
+        return nRet;
+    }
+};
+
 }
 
 class PDFWriterImpl : public VirtualDevice
@@ -265,35 +295,6 @@ class PDFWriterImpl : public VirtualDevice
 public:
     friend struct vcl::pdf::PDFPage;
 
-    // font subsets
-    class GlyphEmit
-    {
-        // performance: actually this should probably a vector;
-        std::vector<sal_Ucs>            m_CodeUnits;
-        sal_uInt8                       m_nSubsetGlyphID;
-
-    public:
-        GlyphEmit() : m_nSubsetGlyphID(0)
-        {
-        }
-
-        void setGlyphId( sal_uInt8 i_nId ) { m_nSubsetGlyphID = i_nId; }
-        sal_uInt8 getGlyphId() const { return m_nSubsetGlyphID; }
-
-        void addCode( sal_Ucs i_cCode )
-        {
-            m_CodeUnits.push_back(i_cCode);
-        }
-        sal_Int32 countCodes() const { return m_CodeUnits.size(); }
-        const std::vector<sal_Ucs>& codes() const { return m_CodeUnits; }
-        sal_Ucs getCode( sal_Int32 i_nIndex ) const
-        {
-            sal_Ucs nRet = 0;
-            if (static_cast<size_t>(i_nIndex) < m_CodeUnits.size())
-                nRet = m_CodeUnits[i_nIndex];
-            return nRet;
-        }
-    };
     struct FontEmit
     {
         sal_Int32           m_nFontID;


More information about the Libreoffice-commits mailing list