summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qpdf/QOutputDev.cpp
authorkergoth <kergoth>2003-08-09 16:24:58 (UTC)
committer kergoth <kergoth>2003-08-09 16:24:58 (UTC)
commite16d333ec2e8509fc665921ca106c25325bae9e0 (patch) (side-by-side diff)
tree9e9068190a15bc9b2a52ab33b40881128f732c0e /noncore/unsupported/qpdf/QOutputDev.cpp
parent1c58d1407f9584fedcdae390a04e2b37e5853361 (diff)
downloadopie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip
opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz
opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/unsupported/qpdf/QOutputDev.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/qpdf/QOutputDev.cpp17
1 files changed, 15 insertions, 2 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
@@ -116,13 +116,13 @@ QFont QOutputDev::matchFont ( GfxFont *gfxFont, fp_t m11, fp_t m12, fp_t m21, fp
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;
@@ -212,16 +212,23 @@ void QOutputDev::startPage ( int /*pageNum*/, GfxState *state )
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*/ )
{
@@ -241,19 +248,25 @@ void QOutputDev::drawLink ( Link *link, Catalog */*catalog*/ )
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 ( )));
}
@@ -518,13 +531,13 @@ void QOutputDev::doClip ( GfxState *state, bool 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 );