[poppler] Branch 'poppler-0.8' - 2 commits - poppler/Annot.cc qt4/src
Albert Astals Cid
aacid at kemper.freedesktop.org
Tue Aug 19 15:28:22 PDT 2008
poppler/Annot.cc | 1 +
qt4/src/poppler-form.cc | 12 +++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
New commits:
commit 103a670be7cc7c4c92ee55681827e9deade97af7
Author: Pino Toscano <pino at kde.org>
Date: Wed Aug 13 13:55:57 2008 +0200
[Qt4] make sure to use the correct page width/height for form widgets coordinates
diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc
index 752c608..e6f1e83 100644
--- a/qt4/src/poppler-form.cc
+++ b/qt4/src/poppler-form.cc
@@ -34,17 +34,23 @@ namespace Poppler {
FormField::FormField(FormFieldData &dd)
: m_formData(&dd)
{
+ const int rotation = m_formData->page->getRotate();
// reading the coords
double left, top, right, bottom;
m_formData->fm->getRect(&left, &bottom, &right, &top);
// build a normalized transform matrix for this page at 100% scale
- GfxState gfxState( 72.0, 72.0, m_formData->page->getMediaBox(), m_formData->page->getRotate(), gTrue );
+ GfxState gfxState( 72.0, 72.0, m_formData->page->getMediaBox(), rotation, gTrue );
double * gfxCTM = gfxState.getCTM();
double MTX[6];
+ double pageWidth = m_formData->page->getCropWidth();
+ double pageHeight = m_formData->page->getCropHeight();
+ // landscape and seascape page rotation: be sure to use the correct (== rotated) page size
+ if (((rotation / 90) % 2) == 1)
+ qSwap(pageWidth, pageHeight);
for ( int i = 0; i < 6; i+=2 )
{
- MTX[i] = gfxCTM[i] / m_formData->page->getCropWidth();
- MTX[i+1] = gfxCTM[i+1] / m_formData->page->getCropHeight();
+ MTX[i] = gfxCTM[i] / pageWidth;
+ MTX[i+1] = gfxCTM[i+1] / pageHeight;
}
QPointF topLeft;
XPDFReader::transform( MTX, qMin( left, right ), qMax( top, bottom ), topLeft );
commit 87a9bb83e102e297b0de19a4b0df5ff75a983814
Author: Albert Astals Cid <tsdgeos at samsung.localdomain>
Date: Tue Aug 12 01:23:21 2008 +0200
initialize widget, fixes crash on EC2006.pdf
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 044c39c..2948621 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -1711,6 +1711,7 @@ AnnotWidget::AnnotWidget(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj)
Annot(xrefA, dict, catalog, obj) {
type = typeWidget;
initialize(xrefA, catalog, dict);
+ widget = NULL;
}
AnnotWidget::~AnnotWidget() {
More information about the poppler
mailing list