include/vcl/outdev.hxx | 3 +++ vcl/source/gdi/pdfwriter_impl.hxx | 1 + vcl/source/gdi/pdfwriter_impl2.cxx | 5 +++++ vcl/source/outdev/hatch.cxx | 17 +++++++---------- 4 files changed, 16 insertions(+), 10 deletions(-)
New commits: commit c5e7cba6fe712aecc7131be550de37b93db27b18 Author: Adrien Ollier <adr.oll...@hotmail.fr> AuthorDate: Thu Jun 20 18:58:39 2019 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Tue Jul 2 09:18:09 2019 +0200 tdf#74702: cleans OutputDevice::DrawHatchLine up Change-Id: Ie90e0f75018edee178f1f02056e59b35956c4142 Signed-off-by: Adrien Ollier <adr.oll...@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/74464 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index e23e3552fe0c..959a8ccdc036 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -729,6 +729,9 @@ public: void DrawLine( const Point& rStartPt, const Point& rEndPt, const LineInfo& rLineInfo ); +protected: + virtual void DrawHatchLine_DrawLine(const Point& rStartPoint, const Point& rEndPoint); + private: /** Helper for line geometry paint with support for graphic expansion (pattern and fat_to_area) diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index b615ac24feb9..c728b16c21f4 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -596,6 +596,7 @@ public: protected: void ImplClearFontData(bool bNewFontLists) override; void ClipRegionIntersectRectangle(vcl::Region&) override; + void DrawHatchLine_DrawLine(const Point& rStartPoint, const Point& rEndPoint) 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 a1bc6472fbfd..bf24fd2978dc 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -2001,6 +2001,11 @@ void PDFWriterImpl::writeG4Stream( BitmapReadAccess const * i_pBitmap ) } } +void PDFWriterImpl::DrawHatchLine_DrawLine(const Point& rStartPoint, const Point& rEndPoint) +{ + drawLine(rStartPoint, rEndPoint); +} + static bool lcl_canUsePDFAxialShading(const Gradient& rGradient) { switch (rGradient.GetStyle()) { diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx index 89319393c8b7..5fba38ad5c25 100644 --- a/vcl/source/outdev/hatch.cxx +++ b/vcl/source/outdev/hatch.cxx @@ -394,18 +394,15 @@ void OutputDevice::DrawHatchLine( const tools::Line& rLine, const tools::PolyPol else { for( long i = 0; i < nPCounter; i += 2 ) - { - if (GetOutDevType() == OUTDEV_PDF) - static_cast<vcl::PDFWriterImpl*>(this)->drawLine(pPtBuffer[ i ], pPtBuffer[ i+1 ]); - else - { - const Point aPt1( ImplLogicToDevicePixel( pPtBuffer[ i ] ) ); - const Point aPt2( ImplLogicToDevicePixel( pPtBuffer[ i + 1 ] ) ); - mpGraphics->DrawLine( aPt1.X(), aPt1.Y(), aPt2.X(), aPt2.Y(), this ); - } - } + DrawHatchLine_DrawLine(pPtBuffer[i], pPtBuffer[i+1]); } } } +void OutputDevice::DrawHatchLine_DrawLine(const Point& rStartPoint, const Point& rEndPoint) +{ + Point aPt1{ImplLogicToDevicePixel(rStartPoint)}, aPt2{ImplLogicToDevicePixel(rEndPoint)}; + mpGraphics->DrawLine(aPt1.X(), aPt1.Y(), aPt2.X(), aPt2.Y(), this); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits