[poppler] qt5/src qt5/tests

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Apr 28 17:28:51 UTC 2019


 qt5/src/poppler-annotation.cc   |    2 +-
 qt5/tests/check_annotations.cpp |   18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 0d0630cd6f10d0586172b740290056620fe56b21
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Apr 28 19:25:08 2019 +0200

    qt5: Fix regression in annotation handling

diff --git a/qt5/src/poppler-annotation.cc b/qt5/src/poppler-annotation.cc
index 207d6ca4..c2798408 100644
--- a/qt5/src/poppler-annotation.cc
+++ b/qt5/src/poppler-annotation.cc
@@ -412,7 +412,7 @@ QList<Annotation*> AnnotationPrivate::findAnnotations(::Page *pdfPage, DocumentD
         if (!markupann)
         {
             // Assume it's a root annotation, and skip if user didn't request it
-            if (parentID != 0)
+            if (parentID != -1)
                 continue;
         }
         else if (markupann->getInReplyToID() != parentID)
diff --git a/qt5/tests/check_annotations.cpp b/qt5/tests/check_annotations.cpp
index 1145ceec..20b33f21 100644
--- a/qt5/tests/check_annotations.cpp
+++ b/qt5/tests/check_annotations.cpp
@@ -20,6 +20,7 @@ private slots:
   void checkFontSizeAndColor();
   void checkHighlightFromAndToQuads();
   void checkUTF16LEAnnot();
+  void checkNonMarkupAnnotations();
 };
 
 /* Is .5f sufficient for 16 bit color channel roundtrip trough save and load on all architectures? */
@@ -155,6 +156,23 @@ void TestAnnotations::checkUTF16LEAnnot()
     QCOMPARE(annot->contents(), QString::fromUtf8("Únîcödé豰")); //clazy:exclude=qstring-allocations
 }
 
+void TestAnnotations::checkNonMarkupAnnotations()
+{
+    std::unique_ptr<Poppler::Document> doc{
+      Poppler::Document::load(TESTDATADIR "/unittestcases/checkbox_issue_159.pdf")
+    };
+    QVERIFY(doc.get());
+
+    std::unique_ptr<Poppler::Page> page{
+      doc->page(0)
+    };
+    QVERIFY(page.get());
+
+    auto annots = page->annotations();
+    QCOMPARE(annots.size(), 17);
+}
+
+
 QTEST_GUILESS_MAIN(TestAnnotations)
 
 #include "check_annotations.moc"


More information about the poppler mailing list