summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-22 13:34:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-23 07:25:29 +0100
commit98e991c0be88858004e535599fbb6a7bd2a23445 (patch)
tree70cd9c3f69aa50ee9f9aec1af0e566362bfce8eb /forms
parent75bea88a78071ac4336d2593512e1dbf3a865876 (diff)
loplugin:useuniqueptr in RichTextControlImpl
Change-Id: I3fcf9a4edf6dbed496bcc9160847e627777f04f1 Reviewed-on: https://gerrit.libreoffice.org/51740 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/richtext/richtextimplcontrol.cxx8
-rw-r--r--forms/source/richtext/richtextimplcontrol.hxx4
2 files changed, 6 insertions, 6 deletions
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx
index ed3cce56bc2c..9059870ebdd5 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -65,8 +65,8 @@ namespace frm
m_pAntiImpl->SetMapMode( aRefDeviceMapMode );
m_pViewport->SetMapMode( aRefDeviceMapMode );
- m_pView = new EditView( m_pEngine, m_pViewport );
- m_pEngine->InsertView( m_pView );
+ m_pView.reset(new EditView( m_pEngine, m_pViewport ));
+ m_pEngine->InsertView( m_pView.get() );
m_pViewport->setView( *m_pView );
m_pEngine->registerEngineStatusListener( this );
@@ -88,9 +88,9 @@ namespace frm
RichTextControlImpl::~RichTextControlImpl( )
{
- m_pEngine->RemoveView( m_pView );
+ m_pEngine->RemoveView( m_pView.get() );
m_pEngine->revokeEngineStatusListener( this );
- delete m_pView;
+ m_pView.reset();
m_pViewport.disposeAndClear();
m_pHScroll.disposeAndClear();
m_pVScroll.disposeAndClear();
diff --git a/forms/source/richtext/richtextimplcontrol.hxx b/forms/source/richtext/richtextimplcontrol.hxx
index 89ea51463286..cac441a1ed83 100644
--- a/forms/source/richtext/richtextimplcontrol.hxx
+++ b/forms/source/richtext/richtextimplcontrol.hxx
@@ -58,14 +58,14 @@ namespace frm
VclPtr<ScrollBar> m_pVScroll;
VclPtr<ScrollBarBox> m_pScrollCorner;
RichTextEngine* m_pEngine;
- EditView* m_pView;
+ std::unique_ptr<EditView> m_pView;
ITextAttributeListener* m_pTextAttrListener;
ITextSelectionListener* m_pSelectionListener;
bool m_bHasEverBeenShown;
public:
struct GrantAccess { friend class RichTextControl; private: GrantAccess() { } };
- EditView* getView( const GrantAccess& ) const { return m_pView; }
+ EditView* getView( const GrantAccess& ) const { return m_pView.get(); }
RichTextEngine* getEngine( const GrantAccess& ) const { return m_pEngine; }
vcl::Window* getViewport( const GrantAccess& ) const { return m_pViewport; }