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

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Sun Dec 29 20:39:49 UTC 2019


 vcl/inc/pdf/BitmapID.hxx          |   44 ++++++++++++++++++++++++++++++++++++++
 vcl/source/gdi/pdfwriter_impl.cxx |    2 -
 vcl/source/gdi/pdfwriter_impl.hxx |   31 ++++++--------------------
 3 files changed, 53 insertions(+), 24 deletions(-)

New commits:
commit 1e3118326f84fd8f73c21c3a5d98a249f9c174f8
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Dec 29 19:19:56 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sun Dec 29 21:39:30 2019 +0100

    pdf: remove ResourceMap typedef
    
    Change-Id: I474fb032d8b57ef1cf09d0a22b6452aafb1ec540
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85957
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 51a78f8f8efa..553c109dcafb 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -683,7 +683,7 @@ void Matrix3::append( PDFWriterImpl::PDFPage const & rPage, OStringBuffer& rBuff
     rPage.appendPoint( Point( static_cast<long>(f[4]), static_cast<long>(f[5]) ), rBuffer );
 }
 
-static void appendResourceMap( OStringBuffer& rBuf, const char* pPrefix, const PDFWriterImpl::ResourceMap& rList )
+static void appendResourceMap( OStringBuffer& rBuf, const char* pPrefix, std::map<OString, sal_Int32> const & rList )
 {
     if( rList.empty() )
         return;
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index fec660ece79b..4ce2112715a9 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -104,14 +104,13 @@ class PDFWriterImpl : public VirtualDevice
 
 public:
     enum ResourceKind { ResXObject, ResExtGState, ResShading, ResPattern };
-    typedef std::map< OString, sal_Int32 > ResourceMap;
     struct ResourceDict
     {
         // note: handle fonts globally for performance
-        ResourceMap m_aXObjects;
-        ResourceMap m_aExtGStates;
-        ResourceMap m_aShadings;
-        ResourceMap m_aPatterns;
+        std::map<OString, sal_Int32> m_aXObjects;
+        std::map<OString, sal_Int32> m_aExtGStates;
+        std::map<OString, sal_Int32> m_aShadings;
+        std::map<OString, sal_Int32> m_aPatterns;
 
         void append( OStringBuffer&, sal_Int32 nFontDictObject );
     };
commit 2296e50a41f4c32bc70e8e27b60dc4eeed3be299
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Dec 29 19:13:17 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sun Dec 29 21:39:16 2019 +0100

    pdf: move struct BitmapID to it's own file
    
    This is done to decrease bloat in pdfwriter_impl.hxx. More will
    follow, but it is safer to do it one by one.
    
    Change-Id: I700f9c729d6521df732d19e3fca866c83e2fb05c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85956
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/inc/pdf/BitmapID.hxx b/vcl/inc/pdf/BitmapID.hxx
new file mode 100644
index 000000000000..cedc5790338f
--- /dev/null
+++ b/vcl/inc/pdf/BitmapID.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef INCLUDED_VCL_INC_PDF_BITMAPID_HXX
+#define INCLUDED_VCL_INC_PDF_BITMAPID_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/checksum.hxx>
+#include <tools/gen.hxx>
+
+namespace vcl::pdf
+{
+struct BitmapID
+{
+    Size m_aPixelSize;
+    sal_Int32 m_nSize;
+    BitmapChecksum m_nChecksum;
+    BitmapChecksum m_nMaskChecksum;
+
+    BitmapID()
+        : m_nSize(0)
+        , m_nChecksum(0)
+        , m_nMaskChecksum(0)
+    {
+    }
+
+    bool operator==(const BitmapID& rComp) const
+    {
+        return (m_aPixelSize == rComp.m_aPixelSize && m_nSize == rComp.m_nSize
+                && m_nChecksum == rComp.m_nChecksum && m_nMaskChecksum == rComp.m_nMaskChecksum);
+    }
+};
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 6c1dd623951e..fec660ece79b 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -25,6 +25,8 @@
 #include <memory>
 #include <vector>
 
+#include <pdf/BitmapID.hxx>
+
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/util/XURLTransformer.hpp>
 #include <com/sun/star/uno/Sequence.h>
@@ -86,6 +88,8 @@ namespace o3tl {
 namespace vcl
 {
 
+using namespace vcl::pdf;
+
 class PDFStreamIf;
 class Matrix3;
 
@@ -172,24 +176,6 @@ public:
 
     friend struct PDFPage;
 
-    struct BitmapID
-    {
-        Size        m_aPixelSize;
-        sal_Int32   m_nSize;
-        BitmapChecksum   m_nChecksum;
-        BitmapChecksum   m_nMaskChecksum;
-
-        BitmapID() : m_nSize( 0 ), m_nChecksum( 0 ), m_nMaskChecksum( 0 ) {}
-
-        bool operator==( const BitmapID& rComp ) const
-        {
-            return (m_aPixelSize == rComp.m_aPixelSize &&
-                    m_nSize == rComp.m_nSize &&
-                    m_nChecksum == rComp.m_nChecksum &&
-                    m_nMaskChecksum == rComp.m_nMaskChecksum );
-        }
-    };
-
     /// Contains information to emit a reference XObject.
     struct ReferenceXObjectEmit
     {


More information about the Libreoffice-commits mailing list