diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-23 14:01:24 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-24 14:42:26 +0200 |
commit | 6217cfd414ee86b160313c0a71b7d62e1eb3db14 (patch) | |
tree | 1471e49de2c68a0cc4d0f42bfb37dc8bffb883bf /sw | |
parent | a27d9845935149005342c74736a961068e6bf242 (diff) |
Introduce OutputDevice type OUTDEV_PDF
Originally I thought mpPDFWriter can be used to create PDF from
any OutputDevice, but it's actually just set for the internal
VirtualDevice of the PDF writer.
So this gets rid of all the special mpPDFWriter and GetPDFWriter()
handling and replaces it with checks for OUTDEV_PDF. But since
ImplPDFWriter used to be a OUTDEV_VIRDEV, this also introduces
OutputDevice::IsVirtual(), which now replaces most of the direct
OUTDEV_VIRDEV checks.
Change-Id: I11824143b6b8833ecc81119762448cbdf1145dbc
Reviewed-on: https://gerrit.libreoffice.org/62257
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/view/vnew.cxx | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 9b84ca53b1e1..308f8714ca3b 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -1108,8 +1108,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr pVout = pOut; pOut = pShell->GetOut(); } - else if( pShell->GetWin() && - OUTDEV_VIRDEV == pOut->GetOutDevType() ) + else if( pShell->GetWin() && pOut->IsVirtual() ) { pVout = pOut; pOut = pShell->GetWin(); @@ -1117,7 +1116,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr else pVout = nullptr; - OSL_ENSURE( OUTDEV_VIRDEV != pOut->GetOutDevType() || + OSL_ENSURE( !pOut->IsVirtual() || pShell->GetViewOptions()->IsPDFExport() || pShell->isOutputToWindow(), "pOut should not be a virtual device" ); diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 9166965dfb7e..855af057bcec 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -870,7 +870,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) { OSL_ENSURE( bNoAdjust && !bUseScrFont, "Outdev Check failed" ); } - else if ( OUTDEV_VIRDEV == rRefDev.GetOutDevType() ) + else if ( rRefDev.IsVirtual() ) { OSL_ENSURE( !bNoAdjust && bUseScrFont, "Outdev Check failed" ); } @@ -879,14 +879,14 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) OSL_FAIL( "Outdev Check failed" ); } } - else if ( OUTDEV_VIRDEV == rInf.GetOut().GetOutDevType() && ! pWin ) + else if ( OUTDEV_PDF == rInf.GetOut().GetOutDevType() && ! pWin ) { // PDF export if ( OUTDEV_PRINTER == rRefDev.GetOutDevType() ) { OSL_ENSURE( !bNoAdjust && bUseScrFont, "Outdev Check failed" ); } - else if ( OUTDEV_VIRDEV == rRefDev.GetOutDevType() ) + else if ( rRefDev.IsVirtual() ) { OSL_ENSURE( !bNoAdjust && bUseScrFont, "Outdev Check failed" ); } @@ -903,7 +903,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) { OSL_ENSURE( !bNoAdjust && bUseScrFont, "Outdev Check failed" ); } - else if ( OUTDEV_VIRDEV == rRefDev.GetOutDevType() ) + else if ( rRefDev.IsVirtual() ) { OSL_ENSURE( !bNoAdjust && bUseScrFont, "Outdev Check failed" ); } diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index ba029c6c9f77..bef6f80521eb 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -85,7 +85,7 @@ void SwViewShell::Init( const SwViewOption *pNewOpt ) SAL_INFO( "sw.core", "View::Init - before InitPrt" ); OutputDevice* pPDFOut = nullptr; - if ( mpOut && mpOut->GetPDFWriter() ) + if (mpOut && (OUTDEV_PDF == mpOut->GetOutDevType())) pPDFOut = mpOut; // Only setup the printer if we need one: |