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

Miklos Vajna vmiklos at collabora.co.uk
Thu Oct 26 10:19:58 UTC 2017


 include/vcl/filter/pdfdocument.hxx     |   18 +++++++++---------
 vcl/source/filter/ipdf/pdfdocument.cxx |   27 ++++++---------------------
 2 files changed, 15 insertions(+), 30 deletions(-)

New commits:
commit f2fa3440330c8bdc352c0633a133e773b0ac0fcf
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Oct 26 09:06:55 2017 +0200

    vcl: minor cleanups in pdfdocument
    
    Change-Id: Ib1284b819d4af2e8055698be4160bbb41acba851
    Reviewed-on: https://gerrit.libreoffice.org/43866
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/include/vcl/filter/pdfdocument.hxx b/include/vcl/filter/pdfdocument.hxx
index e36fb687e0a0..dfc13534bff8 100644
--- a/include/vcl/filter/pdfdocument.hxx
+++ b/include/vcl/filter/pdfdocument.hxx
@@ -168,9 +168,9 @@ class VCL_DLLPUBLIC PDFNameElement : public PDFElement
 {
     OString m_aValue;
     /// Offset after the '/' token.
-    sal_uInt64 m_nLocation;
+    sal_uInt64 m_nLocation = 0;
     /// Length till the next token start.
-    sal_uInt64 m_nLength;
+    sal_uInt64 m_nLength = 0;
 public:
     PDFNameElement();
     bool Read(SvStream& rStream) override;
@@ -234,16 +234,16 @@ enum class XRefEntryType
 /// An entry in a cross-reference stream.
 struct XRefEntry
 {
-    XRefEntryType m_eType;
+    XRefEntryType m_eType = XRefEntryType::NOT_COMPRESSED;
     /**
      * Non-compressed: The byte offset of the object, starting from the
      * beginning of the file.
      * Compressed: The object number of the object stream in which this object is
      * stored.
      */
-    sal_uInt64 m_nOffset;
+    sal_uInt64 m_nOffset = 0;
     /// Are changed as part of an incremental update?.
-    bool m_bDirty;
+    bool m_bDirty = false;
 
     XRefEntry();
 };
@@ -308,16 +308,16 @@ class VCL_DLLPUBLIC PDFDocument
     std::map<size_t, PDFTrailerElement*> m_aOffsetTrailers;
     /// List of EOF offsets we know.
     std::vector<size_t> m_aEOFs;
-    PDFTrailerElement* m_pTrailer;
+    PDFTrailerElement* m_pTrailer = nullptr;
     /// When m_pTrailer is nullptr, this can still have a dictionary.
-    PDFObjectElement* m_pXRefStream;
+    PDFObjectElement* m_pXRefStream = nullptr;
     /// All editing takes place in this buffer, if it happens.
     SvMemoryStream m_aEditBuffer;
 
     /// Suggest a minimal, yet free signature ID to use for the next signature.
     sal_uInt32 GetNextSignature();
     /// Write the signature object as part of signing.
-    sal_Int32 WriteSignatureObject(const OUString& rDescription, bool bAdES, sal_uInt64& rLastByteRangeOffset, sal_Int64& rSignatureContentOffset);
+    sal_Int32 WriteSignatureObject(const OUString& rDescription, bool bAdES, sal_uInt64& rLastByteRangeOffset, sal_Int64& rContentOffset);
     /// Write the appearance object as part of signing.
     sal_Int32 WriteAppearanceObject();
     /// Write the annot object as part of signing.
@@ -354,7 +354,7 @@ public:
     /// Access to the input document, even after the input stream is gone.
     SvMemoryStream& GetEditBuffer();
     /// Tokenize elements from current offset.
-    bool Tokenize(SvStream& rStream, TokenizeMode eMode, std::vector< std::unique_ptr<PDFElement> >& rElements, PDFObjectElement* pObject);
+    bool Tokenize(SvStream& rStream, TokenizeMode eMode, std::vector< std::unique_ptr<PDFElement> >& rElements, PDFObjectElement* pObjectElement);
     /// Register an object (owned directly or indirectly by m_aElements) as a provider for a given ID.
     void SetIDObject(size_t nID, PDFObjectElement* pObject);
     //@}
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index 619041595c6b..7689597699a4 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -123,18 +123,9 @@ public:
     sal_uInt64 GetLocation() const;
 };
 
-XRefEntry::XRefEntry()
-    : m_eType(XRefEntryType::NOT_COMPRESSED),
-      m_nOffset(0),
-      m_bDirty(false)
-{
-}
+XRefEntry::XRefEntry() = default;
 
-PDFDocument::PDFDocument()
-    : m_pTrailer(nullptr),
-      m_pXRefStream(nullptr)
-{
-}
+PDFDocument::PDFDocument() = default;
 
 bool PDFDocument::RemoveSignature(size_t nPosition)
 {
@@ -1332,11 +1323,9 @@ size_t PDFDocument::FindStartXRef(SvStream& rStream)
         it = std::search(it, aBuf.end(), aPrefix.getStr(), aPrefix.getStr() + aPrefix.getLength());
         if (it == aBuf.end())
             break;
-        else
-        {
-            itLastValid = it;
-            ++it;
-        }
+
+        itLastValid = it;
+        ++it;
     }
     if (itLastValid == aBuf.end())
     {
@@ -2864,11 +2853,7 @@ bool PDFEndDictionaryElement::Read(SvStream& rStream)
     return true;
 }
 
-PDFNameElement::PDFNameElement()
-    : m_nLocation(0),
-      m_nLength(0)
-{
-}
+PDFNameElement::PDFNameElement() = default;
 
 bool PDFNameElement::Read(SvStream& rStream)
 {


More information about the Libreoffice-commits mailing list