Kaydet (Commit) 3e62ac3e authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in VCoordinateSystem

Change-Id: I369d6755d3de2dd885214115559150256298852d
Reviewed-on: https://gerrit.libreoffice.org/60051
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b603c762
...@@ -223,7 +223,7 @@ private: //member ...@@ -223,7 +223,7 @@ private: //member
std::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper; std::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper;
std::vector< VCoordinateSystem* > m_aVCooSysList; std::vector< std::unique_ptr<VCoordinateSystem> > m_aVCooSysList;
::cppu::OMultiTypeInterfaceContainerHelper ::cppu::OMultiTypeInterfaceContainerHelper
m_aListenerContainer; m_aListenerContainer;
......
...@@ -52,7 +52,7 @@ using namespace ::com::sun::star::chart2; ...@@ -52,7 +52,7 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
VCoordinateSystem* VCoordinateSystem::createCoordinateSystem( std::unique_ptr<VCoordinateSystem> VCoordinateSystem::createCoordinateSystem(
const Reference< XCoordinateSystem >& xCooSysModel ) const Reference< XCoordinateSystem >& xCooSysModel )
{ {
if( !xCooSysModel.is() ) if( !xCooSysModel.is() )
...@@ -61,13 +61,13 @@ VCoordinateSystem* VCoordinateSystem::createCoordinateSystem( ...@@ -61,13 +61,13 @@ VCoordinateSystem* VCoordinateSystem::createCoordinateSystem(
OUString aViewServiceName = xCooSysModel->getViewServiceName(); OUString aViewServiceName = xCooSysModel->getViewServiceName();
//@todo: in future the coordinatesystems should be instantiated via service factory //@todo: in future the coordinatesystems should be instantiated via service factory
VCoordinateSystem* pRet=nullptr; std::unique_ptr<VCoordinateSystem> pRet;
if( aViewServiceName == CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME ) if( aViewServiceName == CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME )
pRet = new VCartesianCoordinateSystem(xCooSysModel); pRet.reset( new VCartesianCoordinateSystem(xCooSysModel) );
else if( aViewServiceName == CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME ) else if( aViewServiceName == CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME )
pRet = new VPolarCoordinateSystem(xCooSysModel); pRet.reset( new VPolarCoordinateSystem(xCooSysModel) );
if(!pRet) if(!pRet)
pRet = new VCoordinateSystem(xCooSysModel); pRet.reset( new VCoordinateSystem(xCooSysModel) );
return pRet; return pRet;
} }
......
...@@ -51,7 +51,7 @@ class VCoordinateSystem ...@@ -51,7 +51,7 @@ class VCoordinateSystem
public: public:
virtual ~VCoordinateSystem(); virtual ~VCoordinateSystem();
static VCoordinateSystem* createCoordinateSystem( const css::uno::Reference< static std::unique_ptr<VCoordinateSystem> createCoordinateSystem( const css::uno::Reference<
css::chart2::XCoordinateSystem >& xCooSysModel ); css::chart2::XCoordinateSystem >& xCooSysModel );
/// @throws css::uno::RuntimeException /// @throws css::uno::RuntimeException
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment