summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
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; }