diff options
author | Adrien Ollier <adr.ollier@hotmail.fr> | 2019-05-14 19:51:24 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-07-01 02:03:55 +0200 |
commit | 3a99d7f6210363cef47641481b82bae6fb1e997c (patch) | |
tree | 4211886e37105d8900b97df4eccb2138d6d2c0e0 /vcl | |
parent | 19057bca87abf09ec6701c1d28084faa24ba9c3f (diff) |
tdf#74702: cleans OutputDevice::InitClipRegion up
Change-Id: I2d6e35c68d1ab99a19b5b2256b1f8fae4d614720
Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr>
Reviewed-on: https://gerrit.libreoffice.org/72327
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.hxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/clipping.cxx | 24 |
4 files changed, 17 insertions, 12 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index b5a0f5ff87e1..b615ac24feb9 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -595,6 +595,7 @@ public: protected: void ImplClearFontData(bool bNewFontLists) override; + void ClipRegionIntersectRectangle(vcl::Region&) override; private: MapMode m_aMapMode; // PDFWriterImpl scaled units diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 5db8a6b1677c..a1bc6472fbfd 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -2025,4 +2025,6 @@ void PDFWriterImpl::ImplClearFontData(bool bNewFontLists) } } +void PDFWriterImpl::ClipRegionIntersectRectangle(vcl::Region&) {} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index ed6be53ecd87..8678dc1986b2 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1669,6 +1669,8 @@ void Printer::SetFontOrientation( LogicalFontInstance* const pFontEntry ) const pFontEntry->mnOrientation = pFontEntry->mxFontMetric->GetOrientation(); } +void Printer::ClipRegionIntersectRectangle(vcl::Region&) {} + Bitmap Printer::GetBitmap( const Point& rSrcPt, const Size& rSize ) const { SAL_WARN("vcl.gdi", "GetBitmap(): This should never be called on by a Printer instance"); diff --git a/vcl/source/outdev/clipping.cxx b/vcl/source/outdev/clipping.cxx index 3503b9555970..6e3fa877bc4b 100644 --- a/vcl/source/outdev/clipping.cxx +++ b/vcl/source/outdev/clipping.cxx @@ -154,18 +154,7 @@ void OutputDevice::InitClipRegion() // #102532# Respect output offset also for clip region vcl::Region aRegion( ImplPixelToDevicePixel( maRegion ) ); - const bool bClipDeviceBounds((OUTDEV_PDF != GetOutDevType()) - && (OUTDEV_PRINTER != GetOutDevType())); - if( bClipDeviceBounds ) - { - // Perform actual rect clip against outdev - // dimensions, to generate empty clips whenever one of the - // values is completely off the device. - tools::Rectangle aDeviceBounds( mnOutOffX, mnOutOffY, - mnOutOffX+GetOutputWidthPixel()-1, - mnOutOffY+GetOutputHeightPixel()-1 ); - aRegion.Intersect( aDeviceBounds ); - } + ClipRegionIntersectRectangle(aRegion); if ( aRegion.IsEmpty() ) { @@ -194,6 +183,17 @@ void OutputDevice::InitClipRegion() mbInitClipRegion = false; } +void OutputDevice::ClipRegionIntersectRectangle(vcl::Region& rRegion) +{ + // Perform actual rect clip against outdev dimensions, + // to generate empty clips whenever one of the values is completely off the device. + rRegion.Intersect(tools::Rectangle{mnOutOffX, + mnOutOffY, + mnOutOffX + GetOutputWidthPixel() - 1, + mnOutOffY + GetOutputHeightPixel() - 1 + }); +} + vcl::Region OutputDevice::GetActiveClipRegion() const { return GetClipRegion(); |