summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-03-02 00:45:44 +0100
committerAlbert Astals Cid <aacid@kde.org>2017-03-02 00:45:44 +0100
commitbbfc56b3c9a1e613e6db008a56c9c3333ae1427a (patch)
tree7cd2efe30d1abf40eaaba6c58a22d2030e05c9cf
parentf853145556a61a3d1104d6fd62261924d9fc9e50 (diff)
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
-rw-r--r--poppler/Form.cc23
1 files changed, 1 insertions, 22 deletions
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 8f8d14c4..b73f52d1 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 @@ 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;