summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-21 07:51:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-01 08:26:24 +0200
commited8152b1ed9baf859966fd21d6641dfba9c4467c (patch)
treeb4f7b372433c5da3b8df41d026ff95fecece9ce6 /chart2/source
parent6cb9b06432434fb3257118743780828b3b57326a (diff)
improve loplugin:makeshared
to find places where we are converting stuff to unique_ptr instead of using std::make_shared. As a bonus, this tends to find places where we are using shared_ptr where we can instead be using unique_ptr avoiding the locking overhead. Change-Id: I1b57bbc4a6c766b48bba8e25a55161800e149f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/view/axes/VPolarAxis.cxx6
-rw-r--r--chart2/source/view/axes/VPolarAxis.hxx2
2 files changed, 4 insertions, 4 deletions
diff --git a/chart2/source/view/axes/VPolarAxis.cxx b/chart2/source/view/axes/VPolarAxis.cxx
index 2b251ef9a081..9e41857c29d4 100644
--- a/chart2/source/view/axes/VPolarAxis.cxx
+++ b/chart2/source/view/axes/VPolarAxis.cxx
@@ -27,13 +27,13 @@ namespace chart
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-VPolarAxis* VPolarAxis::createAxis( const AxisProperties& rAxisProperties
+std::shared_ptr<VPolarAxis> VPolarAxis::createAxis( const AxisProperties& rAxisProperties
, const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
, sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount )
{
if( nDimensionIndex==0 )
- return new VPolarAngleAxis( rAxisProperties, xNumberFormatsSupplier, nDimensionCount );
- return new VPolarRadiusAxis( rAxisProperties, xNumberFormatsSupplier, nDimensionCount );
+ return std::make_shared<VPolarAngleAxis>( rAxisProperties, xNumberFormatsSupplier, nDimensionCount );
+ return std::make_shared<VPolarRadiusAxis>( rAxisProperties, xNumberFormatsSupplier, nDimensionCount );
}
VPolarAxis::VPolarAxis( const AxisProperties& rAxisProperties
diff --git a/chart2/source/view/axes/VPolarAxis.hxx b/chart2/source/view/axes/VPolarAxis.hxx
index f1626f4b9474..0a7056be72aa 100644
--- a/chart2/source/view/axes/VPolarAxis.hxx
+++ b/chart2/source/view/axes/VPolarAxis.hxx
@@ -30,7 +30,7 @@ class PolarPlottingPositionHelper;
class VPolarAxis : public VAxisBase
{
public:
- static VPolarAxis* createAxis( const AxisProperties& rAxisProperties
+ static std::shared_ptr<VPolarAxis> createAxis( const AxisProperties& rAxisProperties
, const css::uno::Reference< css::util::XNumberFormatsSupplier >& xNumberFormatsSupplier
, sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount );