Diffstat (limited to 'noncore/unsupported/qpdf/QOutputDev.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/QOutputDev.cpp | 17 |
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 @@ -120,5 +120,5 @@ QFont QOutputDev::matchFont ( GfxFont *gfxFont, fp_t m11, fp_t m12, fp_t m21, fp 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 )); @@ -216,8 +216,15 @@ void QOutputDev::startPage ( int /*pageNum*/, GfxState *state ) 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 ( )); @@ -245,4 +252,7 @@ void QOutputDev::drawLink ( Link *link, Catalog */*catalog*/ ) void QOutputDev::saveState ( GfxState */*state*/ ) { + if ( ! m_painter ) + return; + QPDFDBG( printf ( "SAVE (CLIP=%d/%d)\n", m_painter-> hasClipping ( ), !m_painter-> clipRegion ( ). isEmpty ( ))); @@ -252,4 +262,7 @@ void QOutputDev::saveState ( GfxState */*state*/ ) void QOutputDev::restoreState ( GfxState */*state*/ ) { + if( ! m_painter ) + return; + m_painter-> restore ( ); @@ -522,5 +535,5 @@ void QOutputDev::doClip ( GfxState *state, bool winding ) } - if ( m_painter-> hasClipping ( )) + if ( m_painter && m_painter-> hasClipping ( )) region &= m_painter-> clipRegion ( ); |