diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-21 07:51:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-01 08:26:24 +0200 |
commit | ed8152b1ed9baf859966fd21d6641dfba9c4467c (patch) | |
tree | b4f7b372433c5da3b8df41d026ff95fecece9ce6 /chart2 | |
parent | 6cb9b06432434fb3257118743780828b3b57326a (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')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/axes/VPolarAxis.cxx | 6 | ||||
-rw-r--r-- | chart2/source/view/axes/VPolarAxis.hxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index b44d712dbd50..200704e90a8d 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -351,7 +351,7 @@ xmlDocPtr Chart2ExportTest::parseExport(const OUString& rDir, const OUString& rF uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), pTempFile->GetURL()); uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName(findChartFile(rDir, xNameAccess)), uno::UNO_QUERY); CPPUNIT_ASSERT(xInputStream.is()); - std::shared_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true)); + std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true)); return parseXmlStream(pStream.get()); } 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 ); |