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

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Sun Oct 4 06:39:29 UTC 2020


 include/vcl/filter/PDFiumLibrary.hxx |    5 +++++
 vcl/source/pdf/PDFiumLibrary.cxx     |   16 ++++++++++++++++
 2 files changed, 21 insertions(+)

New commits:
commit d30d41b36118ccfa473fab1e82c94c016e3a3f21
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Sep 29 11:42:20 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sun Oct 4 08:38:41 2020 +0200

    pdfium: add getObject, getValueType for PDFiumAnnotation
    
    Change-Id: Iadfd767463a57958f5ffb2dc5c8b5387b59373fd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103883
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx
index bc3314fa56f6..3688d091d601 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -20,6 +20,7 @@
 #include <rtl/instance.hxx>
 #include <basegfx/vector/b2dsize.hxx>
 #include <basegfx/range/b2drectangle.hxx>
+#include <basegfx/point/b2dpoint.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <rtl/ustring.hxx>
 #include <tools/color.hxx>
@@ -34,7 +35,9 @@ constexpr char constDictionaryKeyTitle[] = "T";
 constexpr char constDictionaryKeyContents[] = "Contents";
 constexpr char constDictionaryKeyPopup[] = "Popup";
 constexpr char constDictionaryKeyModificationDate[] = "M";
+
 class PDFiumDocument;
+class PDFiumPageObject;
 
 class VCL_DLLPUBLIC PDFium final
 {
@@ -69,9 +72,11 @@ public:
     PDFAnnotationSubType getSubType();
     basegfx::B2DRectangle getRectangle();
     bool hasKey(OString const& rKey);
+    int getValueType(OString const& rKey);
     OUString getString(OString const& rKey);
     std::unique_ptr<PDFiumAnnotation> getLinked(OString const& rKey);
     int getObjectCount();
+    std::unique_ptr<PDFiumPageObject> getObject(int nIndex);
 };
 
 class PDFiumTextPage;
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index f25ff480f7d4..136a40786112 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -432,6 +432,11 @@ bool PDFiumAnnotation::hasKey(OString const& rKey)
     return FPDFAnnot_HasKey(mpAnnotation, rKey.getStr());
 }
 
+int PDFiumAnnotation::getValueType(OString const& rKey)
+{
+    return FPDFAnnot_GetValueType(mpAnnotation, rKey.getStr());
+}
+
 OUString PDFiumAnnotation::getString(OString const& rKey)
 {
     OUString rString;
@@ -473,6 +478,17 @@ std::unique_ptr<PDFiumAnnotation> PDFiumAnnotation::getLinked(OString const& rKe
 
 int PDFiumAnnotation::getObjectCount() { return FPDFAnnot_GetObjectCount(mpAnnotation); }
 
+std::unique_ptr<PDFiumPageObject> PDFiumAnnotation::getObject(int nIndex)
+{
+    std::unique_ptr<PDFiumPageObject> pPDFiumPageObject;
+    FPDF_PAGEOBJECT pPageObject = FPDFAnnot_GetObject(mpAnnotation, nIndex);
+    if (pPageObject)
+    {
+        pPDFiumPageObject = std::make_unique<PDFiumPageObject>(pPageObject);
+    }
+    return pPDFiumPageObject;
+}
+
 PDFiumTextPage::PDFiumTextPage(FPDF_TEXTPAGE pTextPage)
     : mpTextPage(pTextPage)
 {


More information about the Libreoffice-commits mailing list