summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qpdf
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/qpdf') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/qpdf/QOutputDev.cpp17
-rw-r--r--noncore/unsupported/qpdf/opie-qpdf.control2
-rw-r--r--noncore/unsupported/qpdf/qpdf.cpp0
3 files changed, 16 insertions, 3 deletions
diff --git a/noncore/unsupported/qpdf/QOutputDev.cpp b/noncore/unsupported/qpdf/QOutputDev.cpp
index 52237f5..022d938 100644
--- a/noncore/unsupported/qpdf/QOutputDev.cpp
+++ b/noncore/unsupported/qpdf/QOutputDev.cpp
@@ -110,25 +110,25 @@ QFont QOutputDev::matchFont ( GfxFont *gfxFont, fp_t m11, fp_t m12, fp_t m21, fp
// compute size and normalized transform matrix
int size = lrint ( sqrt ( m21 * m21 + m22 * m22 ));
QPDFDBG( printf ( "SET FONT: Name=%s, Size=%d, Bold=%d, Italic=%d, Mono=%d, Serif=%d, Symbol=%d, CID=%d, EmbFN=%s, M=(%f,%f,%f,%f)\n",
(( gfxFont-> getName ( )) ? gfxFont-> getName ( )-> getCString ( ) : "<n/a>" ),
size,
gfxFont-> isBold ( ),
gfxFont-> isItalic ( ),
gfxFont-> isFixedWidth ( ),
gfxFont-> isSerif ( ),
gfxFont-> isSymbolic ( ),
gfxFont-> isCIDFont ( ),
- ( gfxFont-> getEmbeddedFontName ( ) ? gfxFont-> getEmbeddedFontName ( ) : "<n/a>" ),
+ ( gfxFont-> getEmbeddedFontName ( ) ? gfxFont-> getEmbeddedFontName()-> getCString ( ) : "<n/a>" ),
(double) m11, (double) m12, (double) m21, (double) m22 ));
QString fname (( gfxFont-> getName ( )) ? gfxFont-> getName ( )-> getCString ( ) : "<n/a>" );
QFont f;
f. setPixelSize ( size > 0 ? size : 8 ); // type3 fonts misbehave sometimes
// fast lookup for std. fonts
QOutFontSubst *subst = stdfonts [fname];
if ( subst ) {
@@ -206,28 +206,35 @@ void QOutputDev::startPage ( int /*pageNum*/, GfxState *state )
QPDFDBG( printf ( "NEW PIXMAP (%ld x %ld)\n", lrint ( state-> getPageWidth ( )), lrint ( state-> getPageHeight ( ))));
resizeContents ( m_pixmap-> width ( ), m_pixmap-> height ( ));
setContentsPos ( 0, 0 );
m_pixmap-> fill ( white ); // clear window
m_text-> clear ( ); // cleat text object
viewport ( )-> repaint ( );
}
void QOutputDev::endPage ( )
{
+ QPDFDBG( printf("End page\n") );
m_text-> coalesce ( );
+ /*
+ * I get stupid crashes after endPage is called and then we do clipping
+ * and other stuff.....
+ */
+#if 0
delete m_painter;
m_painter = 0;
+#endif
updateContents ( 0, 0, contentsWidth ( ), contentsHeight ( ));
}
void QOutputDev::drawLink ( Link *link, Catalog */*catalog*/ )
{
fp_t x1, y1, x2, y2, w;
link-> getBorder ( &x1, &y1, &x2, &y2, &w );
if ( w > 0 ) {
int x, y, dx, dy;
@@ -235,31 +242,37 @@ void QOutputDev::drawLink ( Link *link, Catalog */*catalog*/ )
cvtUserToDev ( x1, y1, &x, &y );
cvtUserToDev ( x2, y2, &dx, &dy );
QPen oldpen = m_painter-> pen ( );
m_painter-> setPen ( blue );
m_painter-> drawRect ( x, y, dx, dy );
m_painter-> setPen ( oldpen );
}
}
void QOutputDev::saveState ( GfxState */*state*/ )
{
+ if ( ! m_painter )
+ return;
+
QPDFDBG( printf ( "SAVE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( )));
m_painter-> save ( );
}
void QOutputDev::restoreState ( GfxState */*state*/ )
{
+ if( ! m_painter )
+ return;
+
m_painter-> restore ( );
// m_painter-> setClipRegion ( QRect ( 0, 0, m_pixmap-> width ( ), m_pixmap-> height ( )));
// m_painter-> setClipping ( false );
QPDFDBG ( printf ( "RESTORE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( )));
}
void QOutputDev::updateAll ( GfxState *state )
{
updateLineAttrs ( state, gTrue );
// updateFlatness ( state );
// updateMiterLimit ( state );
@@ -512,25 +525,25 @@ void QOutputDev::doClip ( GfxState *state, bool winding )
QPDFDBG( printf ( " - POLY %d: ", i ));
QPDFDBG( for ( int ii = 0; ii < len; ii++ ) printf ( "(%d/%d) ", points [j+ii]. x ( ), points [j+ii]. y ( )));
QPDFDBG( printf ( "\n" ));
region |= QRegion ( dummy, winding );
dummy. resetRawData ( points. data ( ) + j, len );
}
j += len;
}
- if ( m_painter-> hasClipping ( ))
+ if ( m_painter && m_painter-> hasClipping ( ))
region &= m_painter-> clipRegion ( );
// m_painter-> setClipRegion ( region );
// m_painter-> setClipping ( true );
// m_painter-> fillRect ( 0, 0, m_pixmap-> width ( ), m_pixmap-> height ( ), red );
// m_painter-> drawText ( points [0]. x ( ) + 10, points [0]. y ( ) + 10, "Bla bla" );
qApp-> processEvents ( );
}
//
// Transform points in the path and convert curves to line segments.
diff --git a/noncore/unsupported/qpdf/opie-qpdf.control b/noncore/unsupported/qpdf/opie-qpdf.control
index 33df3e1..208dcb1 100644
--- a/noncore/unsupported/qpdf/opie-qpdf.control
+++ b/noncore/unsupported/qpdf/opie-qpdf.control
@@ -1,9 +1,9 @@
Package: opie-qpdf
Files: bin/qpdf apps/Applications/qpdf.desktop pics/qpdf/qpdf_icon.png
Priority: optional
Section: opie/applications
Maintainer: Robert Griebl <sandman@handhelds.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal, gzip
Description: A PDF viewer for OPIE.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/unsupported/qpdf/qpdf.cpp b/noncore/unsupported/qpdf/qpdf.cpp
index 61f097b..de1dcf3 100644
--- a/noncore/unsupported/qpdf/qpdf.cpp
+++ b/noncore/unsupported/qpdf/qpdf.cpp