qt4/src/poppler-form.cc | 43 +++++++++---------------------------------- qt4/src/poppler-private.h | 4 +--- 2 files changed, 10 insertions(+), 37 deletions(-)
New commits: commit 85615f04e040dd38792533a4522e437644e97548 Author: Pino Toscano <[email protected]> Date: Thu Nov 3 16:15:40 2011 +0100 qt4: get rid of the own F and Ff flags reading no more useful now, as they are available either directly or as parsed values in both Annot and FormField diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc index 5b9711a..1703784 100644 --- a/qt4/src/poppler-form.cc +++ b/qt4/src/poppler-form.cc @@ -82,22 +82,6 @@ FormField::FormField(FormFieldData &dd) QPointF bottomRight; XPDFReader::transform( MTX, qMax( left, right ), qMin( top, bottom ), bottomRight ); m_formData->box = QRectF(topLeft, QSizeF(bottomRight.x() - topLeft.x(), bottomRight.y() - topLeft.y())); - - Dict *dict = m_formData->fm->getObj()->getDict(); - Object tmp; - - // reading the flags - if (dict->lookup("Ff", &tmp)->isInt()) - { - m_formData->flags = tmp.getInt(); - } - tmp.free(); - // reading the widget annotation flags - if (dict->lookup("F", &tmp)->isInt()) - { - m_formData->annoflags = tmp.getInt(); - } - tmp.free(); } FormField::~FormField() diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h index b4383d8..c0f62f2 100644 --- a/qt4/src/poppler-private.h +++ b/qt4/src/poppler-private.h @@ -275,7 +275,7 @@ namespace Poppler { { public: FormFieldData(DocumentData *_doc, ::Page *p, ::FormWidget *w) : - doc(_doc), page(p), fm(w), flags(0), annoflags(0) + doc(_doc), page(p), fm(w) { } @@ -283,8 +283,6 @@ namespace Poppler { ::Page *page; ::FormWidget *fm; QRectF box; - int flags; - int annoflags; }; } commit 43347b43eeb66b5c8dc9637c36436baacc626bc4 Author: Pino Toscano <[email protected]> Date: Thu Nov 3 16:10:57 2011 +0100 qt4: use the flags of the associated Annot object diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc index e3c30d4..5b9711a 100644 --- a/qt4/src/poppler-form.cc +++ b/qt4/src/poppler-form.cc @@ -153,7 +153,7 @@ bool FormField::isReadOnly() const bool FormField::isVisible() const { - return !(m_formData->annoflags & (1 << 1)); + return !(m_formData->fm->getWidgetAnnotation()->getFlags() & Annot::flagHidden); } Link* FormField::activationAction() const commit 6c9492202de9b3b43da9eac3e40dc7fe218f21da Author: Pino Toscano <[email protected]> Date: Thu Nov 3 16:03:11 2011 +0100 qt4: remove old commented code diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc index 3dfddb5..e3c30d4 100644 --- a/qt4/src/poppler-form.cc +++ b/qt4/src/poppler-form.cc @@ -365,7 +365,6 @@ bool FormFieldChoice::isEditable() const bool FormFieldChoice::multiSelect() const { -// return m_formData->flags & (1 << 21); FormWidgetChoice* fwc = static_cast<FormWidgetChoice*>(m_formData->fm); return !fwc->isCombo() ? fwc->isMultiSelect() : false; } commit f0eca54131f7cdf6c1e0e78a18be0bf642567af4 Author: Pino Toscano <[email protected]> Date: Thu Nov 3 15:46:33 2011 +0100 qt4: use the quadding read already in FormField ... instead of reading it again diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc index 01716f4..3dfddb5 100644 --- a/qt4/src/poppler-form.cc +++ b/qt4/src/poppler-form.cc @@ -35,26 +35,18 @@ namespace { -Qt::Alignment formTextAlignment(Object *obj) +Qt::Alignment formTextAlignment(::FormWidget *fm) { - Object tmp; - int align = 0; - if (obj->dictLookup("Q", &tmp)->isInt()) - { - align = tmp.getInt(); - } - tmp.free(); - Qt::Alignment qtalign; - switch (align) + Qt::Alignment qtalign = Qt::AlignLeft; + switch (fm->getField()->getTextQuadding()) { - case 1: + case quaddingCentered: qtalign = Qt::AlignHCenter; break; - case 2: + case quaddingRightJustified: qtalign = Qt::AlignRight; break; - case 0: - default: + case quaddingLeftJustified: qtalign = Qt::AlignLeft; } return qtalign; @@ -321,7 +313,7 @@ int FormFieldText::maximumLength() const Qt::Alignment FormFieldText::textAlignment() const { - return formTextAlignment(m_formData->fm->getObj()); + return formTextAlignment(m_formData->fm); } bool FormFieldText::canBeSpellChecked() const @@ -399,7 +391,7 @@ void FormFieldChoice::setCurrentChoices( const QList<int> &choice ) Qt::Alignment FormFieldChoice::textAlignment() const { - return formTextAlignment(m_formData->fm->getObj()); + return formTextAlignment(m_formData->fm); } bool FormFieldChoice::canBeSpellChecked() const _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
