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 /svx/source/svdraw | |
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 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index eefee015e866..32541331fca0 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -571,7 +571,7 @@ void SdrTextObj::AdaptTextMinSize() void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle const & rAnchorRect, bool bLineWidth ) const { basegfx::B2DPolyPolygon aXorPolyPolygon(TakeXorPoly()); - std::unique_ptr<basegfx::B2DPolyPolygon> pContourPolyPolygon; + std::optional<basegfx::B2DPolyPolygon> pContourPolyPolygon; basegfx::B2DHomMatrix aMatrix(basegfx::utils::createTranslateB2DHomMatrix( -rAnchorRect.Left(), -rAnchorRect.Top())); @@ -587,7 +587,7 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle { // Take line width into account. // When doing the hit test, avoid this. (Performance!) - pContourPolyPolygon.reset(new basegfx::B2DPolyPolygon()); + pContourPolyPolygon.emplace(); // test if shadow needs to be avoided for TakeContour() const SfxItemSet& rSet = GetObjectItemSet(); @@ -622,7 +622,7 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle pContourPolyPolygon->transform(aMatrix); } - rOutliner.SetPolygon(aXorPolyPolygon, pContourPolyPolygon.get()); + rOutliner.SetPolygon(aXorPolyPolygon, pContourPolyPolygon ? &*pContourPolyPolygon : nullptr); } void SdrTextObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const |