basegfx/source/polygon/b2dpolygon.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 70cd6cac6c1fe2f13702d8ab539d56ebae93683b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Sep 8 09:26:30 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Sep 8 10:29:25 2021 +0200 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 <noel.gran...@collabora.co.uk> 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; } };