diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-13 13:02:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-13 15:05:56 +0200 |
commit | 6c7c7bcdbd3e47cad5c6b94e1ed1c5314dbdbf6b (patch) | |
tree | 4ab84fa839582aa6922450429d15f3b10cec74a5 /svx | |
parent | 5979076a14098f6887b61e937cfc9059ff7f2506 (diff) |
loplugin:cow_wrapper
check the classes that use o3tl::cow_wrapper so that they
don't unnecessarity trigger copies
Change-Id: I545e627598217f3e61ba2c384adb8d4f8b404829
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122030
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/xoutdev/_xpoly.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/svx/source/xoutdev/_xpoly.cxx b/svx/source/xoutdev/_xpoly.cxx index f3bb16a1419f..c4d74b996735 100644 --- a/svx/source/xoutdev/_xpoly.cxx +++ b/svx/source/xoutdev/_xpoly.cxx @@ -322,7 +322,7 @@ XPolygon::~XPolygon() = default; void XPolygon::SetPointCount( sal_uInt16 nPoints ) { - pImpXPolygon->CheckPointDelete(); + std::as_const(*pImpXPolygon).CheckPointDelete(); if( pImpXPolygon->nSize < nPoints ) pImpXPolygon->Resize( nPoints ); @@ -425,7 +425,7 @@ const Point& XPolygon::operator[]( sal_uInt16 nPos ) const Point& XPolygon::operator[]( sal_uInt16 nPos ) { - pImpXPolygon->CheckPointDelete(); + std::as_const(*pImpXPolygon).CheckPointDelete(); if( nPos >= pImpXPolygon->nSize ) { @@ -458,7 +458,7 @@ PolyFlags XPolygon::GetFlags( sal_uInt16 nPos ) const /// set the flags for the point at the given position void XPolygon::SetFlags( sal_uInt16 nPos, PolyFlags eFlags ) { - pImpXPolygon->CheckPointDelete(); + std::as_const(*pImpXPolygon).CheckPointDelete(); pImpXPolygon->pFlagAry[nPos] = eFlags; } @@ -741,7 +741,7 @@ void XPolygon::PointsToBezier(sal_uInt16 nFirst) /// scale in X- and/or Y-direction void XPolygon::Scale(double fSx, double fSy) { - pImpXPolygon->CheckPointDelete(); + std::as_const(*pImpXPolygon).CheckPointDelete(); sal_uInt16 nPntCnt = pImpXPolygon->nPoints; @@ -766,7 +766,7 @@ void XPolygon::Scale(double fSx, double fSy) void XPolygon::Distort(const tools::Rectangle& rRefRect, const XPolygon& rDistortedRect) { - pImpXPolygon->CheckPointDelete(); + std::as_const(*pImpXPolygon).CheckPointDelete(); tools::Long Xr, Wr; tools::Long Yr, Hr; |