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@svn.gnome.org>
-// Copyright 2007-2012, 2015, 2016 Albert Astals Cid <aacid@kde.org>
+// Copyright 2007-2012, 2015-2017 Albert Astals Cid <aacid@kde.org>
// Copyright 2007-2008, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright 2007, 2013, 2016 Adrian Johnson <ajohnson@redneon.com>
// Copyright 2007 Iñigo Martínez <inigomartinez@gmail.com>
@@ -317,11 +317,6 @@
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 @@
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 @@
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;