From e843db51c74519acf41e377237914f603e0f6bab Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 15 May 2022 16:50:06 +0100 Subject: ofz#46070 handle unknown line styles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8cc8f6d832e72483d27b09cc57afbde04df770ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134351 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- vcl/source/outdev/polyline.cxx | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx index 499651c78879..f699147c2edf 100644 --- a/vcl/source/outdev/polyline.cxx +++ b/vcl/source/outdev/polyline.cxx @@ -116,17 +116,28 @@ void OutputDevice::DrawPolyLine( const tools::Polygon& rPoly, const LineInfo& rL return; } - // #i101491# - // Try direct Fallback to B2D-Version of DrawPolyLine - if (LineStyle::Solid == rLineInfo.GetStyle() && IsDeviceOutputNecessary()) + if (IsDeviceOutputNecessary()) { - DrawPolyLine( - rPoly.getB2DPolygon(), - rLineInfo.GetWidth(), - rLineInfo.GetLineJoin(), - rLineInfo.GetLineCap(), - basegfx::deg2rad(15.0) /* default fMiterMinimumAngle, value not available in LineInfo */); - return; + auto eLineStyle = rLineInfo.GetStyle(); + switch (eLineStyle) + { + case LineStyle::NONE: + case LineStyle::Dash: + // use drawPolyLine for these + break; + case LineStyle::Solid: + // #i101491# Try direct Fallback to B2D-Version of DrawPolyLine + DrawPolyLine( + rPoly.getB2DPolygon(), + rLineInfo.GetWidth(), + rLineInfo.GetLineJoin(), + rLineInfo.GetLineCap(), + basegfx::deg2rad(15.0) /* default fMiterMinimumAngle, value not available in LineInfo */); + return; + default: + SAL_WARN("vcl.gdi", "Unknown LineStyle: " << static_cast(eLineStyle)); + return; + } } if ( mpMetaFile ) -- cgit