qt5/src/poppler-form.cc | 10 +++++++++- qt6/src/poppler-form.cc | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-)
New commits: commit d06eb33d1668ca3a08055bd033d8f5ea725e5be7 Author: Albert Astals Cid <aa...@kde.org> Date: Fri Aug 12 23:29:01 2022 +0200 qt: Also take into account flagNoView when getting/setting the visible status KDE bug #456313 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; }