diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-08 09:26:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-08 10:29:25 +0200 |
commit | 70cd6cac6c1fe2f13702d8ab539d56ebae93683b (patch) | |
tree | de72ec8757c7882d80e71b0546bb58829680978d /basegfx/source | |
parent | d70622afd96b5d1f530082c8d5dd332188937f17 (diff) |
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.grandin@collabora.co.uk>
Diffstat (limited to 'basegfx/source')
-rw-r--r-- | basegfx/source/polygon/b2dpolygon.cxx | 8 |
1 files 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; } }; |