[PATCH] FormWidget's modified field is now correctly updated.

Julien Rebetez julien at fhtagn.net
Fri Oct 26 05:24:32 PDT 2007


---
 poppler/Form.cc |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/poppler/Form.cc b/poppler/Form.cc
index 334e45c..21cc19a 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -163,6 +163,7 @@ void FormWidgetButton::setState (GBool astate, GBool calledByParent)
     return;
   //the state modification may be denied by the parent. e.g we don't want to let the user put all combo boxes to false
   if (!calledByParent) { //avoid infinite recursion
+    modified = gTrue;
     if (!parent->setState(childNum, astate)) {
       return;
     }
@@ -348,6 +349,7 @@ void FormWidgetText::setContent(GooString* new_content)
     return;
   }
 
+  modified = gTrue;
   if (new_content == NULL) {
     parent->setContentCopy(NULL);
   } else {
@@ -364,7 +366,6 @@ void FormWidgetText::setContent(GooString* new_content)
     obj.getDict()->set("V", &obj1);
     //notify the xref about the update
     xref->setModifiedObject(&obj, ref);
-    modified = gTrue;
   }
 }
 
@@ -524,6 +525,7 @@ void FormWidgetChoice::select (int i)
     return;
   }
   if (!_checkRange(i)) return;
+  modified = gTrue;
   parent->select(i);
   _updateV();
 }
@@ -535,6 +537,7 @@ void FormWidgetChoice::toggle (int i)
     return;
   }
   if (!_checkRange(i)) return;
+  modified = gTrue;
   parent->toggle(i);
   _updateV();
 }
@@ -545,6 +548,7 @@ void FormWidgetChoice::deselectAll ()
     error(-1, "FormWidgetChoice::deselectAll called on a read only field\n");
     return;
   }
+  modified = gTrue;
   parent->deselectAll();
   _updateV();
 }
@@ -575,6 +579,7 @@ void FormWidgetChoice::setEditChoice (GooString* new_content)
     return;
   }
 
+  modified = gTrue;
   if (new_content == NULL) {
     parent->setEditChoice(NULL);
   } else {
-- 
1.5.2.5


--------------030500050101040903030608
Content-Type: text/x-patch;
 name="0007-Fix-memory-management-problem-with-appearBuf-in-Anno.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename*0="0007-Fix-memory-management-problem-with-appearBuf-in-Anno.pa";
 filename*1="tch"



More information about the poppler mailing list