sc/source/ui/inc/SparklineRenderer.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit 538166da779e13197411cade8bd7dedb94778525 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Mon Apr 11 20:18:18 2022 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Mon Apr 11 16:43:04 2022 +0200 sc: fix rendering when sparkline doesn't have a data range Change-Id: I945594d93c893043cea1758b3ad9c4e7692ef27e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132815 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/sc/source/ui/inc/SparklineRenderer.hxx b/sc/source/ui/inc/SparklineRenderer.hxx index e69ba51e8afa..616d667ecb48 100644 --- a/sc/source/ui/inc/SparklineRenderer.hxx +++ b/sc/source/ui/inc/SparklineRenderer.hxx @@ -15,6 +15,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <comphelper/scopeguard.hxx> #include <Sparkline.hxx> #include <SparklineGroup.hxx> @@ -494,6 +495,8 @@ public: tools::Long nOneX, tools::Long nOneY, double fScaleX, double fScaleY) { rRenderContext.Push(); + comphelper::ScopeGuard aPushPopGuard([&rRenderContext]() { rRenderContext.Pop(); }); + rRenderContext.SetAntialiasing(AntialiasingFlags::Enable); rRenderContext.SetClipRegion(vcl::Region(rRectangle)); @@ -508,7 +511,9 @@ public: auto const& rRangeList = pSparkline->getInputRange(); if (rRangeList.empty()) + { return; + } auto pSparklineGroup = pSparkline->getSparklineGroup(); auto const& rAttributes = pSparklineGroup->getAttributes(); @@ -564,7 +569,6 @@ public: drawLine(rRenderContext, aOutputRectangle, aSparklineValues, pSparklineGroup->getAttributes()); } - rRenderContext.Pop(); } }; }