qt5: Fix regression in annotation handling
diff --git a/qt5/src/poppler-annotation.cc b/qt5/src/poppler-annotation.cc
index 207d6ca..c279840 100644
--- a/qt5/src/poppler-annotation.cc
+++ b/qt5/src/poppler-annotation.cc
@@ -412,7 +412,7 @@
         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 1145cee..20b33f2 100644
--- a/qt5/tests/check_annotations.cpp
+++ b/qt5/tests/check_annotations.cpp
@@ -20,6 +20,7 @@
   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 @@
     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"