diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-17 15:39:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-29 14:03:09 +0200 |
commit | 0611e0643101c9282934de872249b438bd1a7f53 (patch) | |
tree | 702306ada0846298e874213c3484949f90e16da3 | |
parent | fb32f28a2b7f0c33533592b855ead127b858040c (diff) |
loplugin:useuniqueptr in DbTextField
Change-Id: Ia6ad047859d52ef32e007c428763006673602482
Reviewed-on: https://gerrit.libreoffice.org/54847
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 14 | ||||
-rw-r--r-- | svx/source/inc/gridcell.hxx | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 8767b3efb0b5..deff8c93ffd8 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1060,8 +1060,8 @@ DbTextField::DbTextField(DbGridColumn& _rColumn) DbTextField::~DbTextField( ) { - DELETEZ( m_pPainterImplementation ); - DELETEZ( m_pEdit ); + m_pPainterImplementation.reset(); + m_pEdit.reset(); } @@ -1102,18 +1102,18 @@ void DbTextField::Init( vcl::Window& rParent, const Reference< XRowSet >& xCurso if ( bIsMultiLine ) { m_pWindow = VclPtr<MultiLineTextCell>::Create( &rParent, nStyle ); - m_pEdit = new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pWindow.get() ) ); + m_pEdit.reset(new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pWindow.get() ) )); m_pPainter = VclPtr<MultiLineTextCell>::Create( &rParent, nStyle ); - m_pPainterImplementation = new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pPainter.get() ) ); + m_pPainterImplementation.reset(new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pPainter.get() ) )); } else { m_pWindow = VclPtr<Edit>::Create( &rParent, nStyle ); - m_pEdit = new EditImplementation( *static_cast< Edit* >( m_pWindow.get() ) ); + m_pEdit.reset(new EditImplementation( *static_cast< Edit* >( m_pWindow.get() ) )); m_pPainter = VclPtr<Edit>::Create( &rParent, nStyle ); - m_pPainterImplementation = new EditImplementation( *static_cast< Edit* >( m_pPainter.get() ) ); + m_pPainterImplementation.reset(new EditImplementation( *static_cast< Edit* >( m_pPainter.get() ) )); } if ( WB_LEFT == nStyle ) @@ -1135,7 +1135,7 @@ void DbTextField::Init( vcl::Window& rParent, const Reference< XRowSet >& xCurso CellControllerRef DbTextField::CreateController() const { - return new EditCellController( m_pEdit ); + return new EditCellController( m_pEdit.get() ); } diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index 7574d90dbac2..1368e9a19a66 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -377,8 +377,8 @@ protected: class DbTextField : public DbLimitedLengthField { - ::svt::IEditImplementation* m_pEdit; - ::svt::IEditImplementation* m_pPainterImplementation; + std::unique_ptr<::svt::IEditImplementation> m_pEdit; + std::unique_ptr<::svt::IEditImplementation> m_pPainterImplementation; bool m_bIsSimpleEdit; protected: @@ -387,7 +387,7 @@ protected: public: DbTextField(DbGridColumn& _rColumn); - ::svt::IEditImplementation* GetEditImplementation() { return m_pEdit; } + ::svt::IEditImplementation* GetEditImplementation() { return m_pEdit.get(); } bool IsSimpleEdit() const { return m_bIsSimpleEdit; } virtual void Init( vcl::Window& rParent, const css::uno::Reference< css::sdbc::XRowSet >& xCursor ) override; |