diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-08-21 19:54:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-22 10:31:12 +0200 |
commit | 523bba89cd5ad6372fb0431cecabdca02ea2b9e3 (patch) | |
tree | 5eb36b43d72584c2bc11ac7ef08bb7dc2420d881 /sw | |
parent | a1759769804a7f3b9895b481229d497a9eb4c70a (diff) |
no need to use unique_ptr for B2DPolyPolygon
it is already a COW type
Change-Id: Iaf8bf1671781923555df3e43b0db78e87c2c5a87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120826
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/txtfly.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 2daaf4ac6d6c..b2799b08acf8 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -216,7 +216,7 @@ SwRect SwContourCache::ContourRect( const SwFormat* pFormat, mvItems.pop_back(); } ::basegfx::B2DPolyPolygon aPolyPolygon; - std::unique_ptr<::basegfx::B2DPolyPolygon> pPolyPolygon; + std::optional<::basegfx::B2DPolyPolygon> pPolyPolygon; if ( auto pVirtFlyDrawObj = dynamic_cast< const SwVirtFlyDrawObj *>( pObj ) ) { @@ -236,14 +236,13 @@ SwRect SwContourCache::ContourRect( const SwFormat* pFormat, aPolyPolygon = pObj->TakeXorPoly(); } - ::basegfx::B2DPolyPolygon aContourPoly(pObj->TakeContour()); - pPolyPolygon.reset(new ::basegfx::B2DPolyPolygon(aContourPoly)); + pPolyPolygon = pObj->TakeContour(); } const SvxLRSpaceItem &rLRSpace = pFormat->GetLRSpace(); const SvxULSpaceItem &rULSpace = pFormat->GetULSpace(); CacheItem item { pObj, // due to #37347 the Object must be entered only after GetContour() - std::make_unique<TextRanger>( aPolyPolygon, pPolyPolygon.get(), 20, + std::make_unique<TextRanger>( aPolyPolygon, pPolyPolygon ? &*pPolyPolygon : nullptr, 20, o3tl::narrowing<sal_uInt16>(rLRSpace.GetLeft()), o3tl::narrowing<sal_uInt16>(rLRSpace.GetRight()), pFormat->GetSurround().IsOutside(), false, pFrame->IsVertical() ) }; |