[poppler] poppler/Annot.cc

Inigo Martinez inigomartinez at kemper.freedesktop.org
Tue Apr 22 14:02:39 PDT 2008


 poppler/Annot.cc |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

New commits:
commit a567c921ce538616f4ba0b7933086ef5a8ab0f55
Author: Iñigo Martínez <inigomartinez at gmail.com>
Date:   Tue Apr 22 23:09:10 2008 +0200

    Little change to avoid AnnotWidget crashing when they aren't related to FormWidgets.
    
    Signed-off-by: Iñigo Martínez <inigomartinez at gmail.com>

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 7ec7348..39c3517 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -1808,15 +1808,16 @@ AnnotWidget::~AnnotWidget() {
 void AnnotWidget::initialize(XRef *xrefA, Catalog *catalog, Dict *dict) {
   Object obj1;
 
-  form = catalog->getForm ();
-  widget = form->findWidgetByRef (ref);
-
-  // check if field apperances need to be regenerated
-  // Only text or choice fields needs to have appearance regenerated
-  // see section 8.6.2 "Variable Text" of PDFReference
-  regen = gFalse;
-  if (widget->getType () == formText || widget->getType () == formChoice) {
-    regen = form->getNeedAppearances ();
+  if ((form = catalog->getForm ())) {
+    widget = form->findWidgetByRef (ref);
+
+    // check if field apperances need to be regenerated
+    // Only text or choice fields needs to have appearance regenerated
+    // see section 8.6.2 "Variable Text" of PDFReference
+    regen = gFalse;
+    if (widget->getType () == formText || widget->getType () == formChoice) {
+      regen = form->getNeedAppearances ();
+    }
   }
 
   // If field doesn't have an AP we'll have to generate it


More information about the poppler mailing list