From 70cd6cac6c1fe2f13702d8ab539d56ebae93683b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 8 Sep 2021 09:26:30 +0200 Subject: no need to allocate this separately Change-Id: Ib92bd39d1c5057731d670a79bf788909856247be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121799 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basegfx/source/polygon/b2dpolygon.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/basegfx/source/polygon/b2dpolygon.cxx b/basegfx/source/polygon/b2dpolygon.cxx index 2baa16225227..e8f6d947c7d2 100644 --- a/basegfx/source/polygon/b2dpolygon.cxx +++ b/basegfx/source/polygon/b2dpolygon.cxx @@ -463,7 +463,7 @@ private: std::optional< basegfx::B2DPolygon > mpDefaultSubdivision; // Possibility to hold the last B2DRange calculation - std::unique_ptr< basegfx::B2DRange > mpB2DRange; + mutable std::optional< basegfx::B2DRange > moB2DRange; public: ImplBufferedData() @@ -482,7 +482,7 @@ public: const basegfx::B2DRange& getB2DRange(const basegfx::B2DPolygon& rSource) const { - if(!mpB2DRange) + if(!moB2DRange) { basegfx::B2DRange aNewRange; const sal_uInt32 nPointCount(rSource.count()); @@ -542,10 +542,10 @@ public: } } - const_cast< ImplBufferedData* >(this)->mpB2DRange.reset(new basegfx::B2DRange(aNewRange)); + moB2DRange = aNewRange; } - return *mpB2DRange; + return *moB2DRange; } }; -- cgit