[poppler] poppler/Form.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Mar 1 23:46:47 UTC 2017


 poppler/Form.cc |   23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

New commits:
commit bbfc56b3c9a1e613e6db008a56c9c3333ae1427a
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Mar 2 00:45:44 2017 +0100

    Make FormWidget* setters ignore isReadOnly
    
    isReadOnly is for the user but poppler needs to be able to set the value for example for fields whose value is autocalculated

diff --git a/poppler/Form.cc b/poppler/Form.cc
index 8f8d14c..b73f52d 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -5,7 +5,7 @@
 // This file is licensed under the GPLv2 or later
 //
 // Copyright 2006-2008 Julien Rebetez <julienr at svn.gnome.org>
-// Copyright 2007-2012, 2015, 2016 Albert Astals Cid <aacid at kde.org>
+// Copyright 2007-2012, 2015-2017 Albert Astals Cid <aacid at kde.org>
 // Copyright 2007-2008, 2011 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright 2007, 2013, 2016 Adrian Johnson <ajohnson at redneon.com>
 // Copyright 2007 Iñigo Martínez <inigomartinez at gmail.com>
@@ -317,11 +317,6 @@ int FormWidgetText::getMaxLen () const
 
 void FormWidgetText::setContent(GooString* new_content)
 {
-  if (isReadOnly()) {
-    error(errInternal, -1, "FormWidgetText::setContentCopy called on a read only field\n");
-    return;
-  }
-
   parent()->setContentCopy(new_content);
 }
 
@@ -351,30 +346,18 @@ bool FormWidgetChoice::_checkRange (int i)
 
 void FormWidgetChoice::select (int i)
 {
-  if (isReadOnly()) {
-    error(errInternal, -1, "FormWidgetChoice::select called on a read only field\n");
-    return;
-  }
   if (!_checkRange(i)) return;
   parent()->select(i);
 }
 
 void FormWidgetChoice::toggle (int i)
 {
-  if (isReadOnly()) {
-    error(errInternal, -1, "FormWidgetChoice::toggle called on a read only field\n");
-    return;
-  }
   if (!_checkRange(i)) return;
   parent()->toggle(i);
 }
 
 void FormWidgetChoice::deselectAll ()
 {
-  if (isReadOnly()) {
-    error(errInternal, -1, "FormWidgetChoice::deselectAll called on a read only field\n");
-    return;
-  }
   parent()->deselectAll();
 }
 
@@ -401,10 +384,6 @@ bool FormWidgetChoice::isSelected (int i)
 
 void FormWidgetChoice::setEditChoice (GooString* new_content)
 {
-  if (isReadOnly()) {
-    error(errInternal, -1, "FormWidgetText::setEditChoice called on a read only field\n");
-    return;
-  }
   if (!hasEdit()) {
     error(errInternal, -1, "FormFieldChoice::setEditChoice : trying to edit an non-editable choice\n");
     return;


More information about the poppler mailing list