summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2022-08-12 23:29:01 +0200
committerAlbert Astals Cid <tsdgeos@yahoo.es>2022-09-06 14:03:37 +0000
commitd06eb33d1668ca3a08055bd033d8f5ea725e5be7 (patch)
treeb2ee20290a4545dfca82fa60391c87cba4db9d2d
parent9e0d0e65261384bde8cb7f1932738bbeb19d3292 (diff)
qt: Also take into account flagNoView when getting/setting the visible status
KDE bug #456313
-rw-r--r--qt5/src/poppler-form.cc10
-rw-r--r--qt6/src/poppler-form.cc10
2 files changed, 18 insertions, 2 deletions
diff --git a/qt5/src/poppler-form.cc b/qt5/src/poppler-form.cc
index a6d40910..a4111511 100644
--- a/qt5/src/poppler-form.cc
+++ b/qt5/src/poppler-form.cc
@@ -194,7 +194,14 @@ void FormField::setReadOnly(bool value)
bool FormField::isVisible() const
{
- return !(m_formData->fm->getWidgetAnnotation()->getFlags() & Annot::flagHidden);
+ const unsigned int flags = m_formData->fm->getWidgetAnnotation()->getFlags();
+ if (flags & Annot::flagHidden) {
+ return false;
+ }
+ if (flags & Annot::flagNoView) {
+ return false;
+ }
+ return true;
}
void FormField::setVisible(bool value)
@@ -202,6 +209,7 @@ void FormField::setVisible(bool value)
unsigned int flags = m_formData->fm->getWidgetAnnotation()->getFlags();
if (value) {
flags &= ~Annot::flagHidden;
+ flags &= ~Annot::flagNoView;
} else {
flags |= Annot::flagHidden;
}
diff --git a/qt6/src/poppler-form.cc b/qt6/src/poppler-form.cc
index c06eb9ae..6f264bd0 100644
--- a/qt6/src/poppler-form.cc
+++ b/qt6/src/poppler-form.cc
@@ -194,7 +194,14 @@ void FormField::setReadOnly(bool value)
bool FormField::isVisible() const
{
- return !(m_formData->fm->getWidgetAnnotation()->getFlags() & Annot::flagHidden);
+ const unsigned int flags = m_formData->fm->getWidgetAnnotation()->getFlags();
+ if (flags & Annot::flagHidden) {
+ return false;
+ }
+ if (flags & Annot::flagNoView) {
+ return false;
+ }
+ return true;
}
void FormField::setVisible(bool value)
@@ -202,6 +209,7 @@ void FormField::setVisible(bool value)
unsigned int flags = m_formData->fm->getWidgetAnnotation()->getFlags();
if (value) {
flags &= ~Annot::flagHidden;
+ flags &= ~Annot::flagNoView;
} else {
flags |= Annot::flagHidden;
}