summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-28 09:30:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-29 08:26:48 +0200
commita440837ee2be3759559325e3e31d90d358587727 (patch)
tree4671d1525c4633dfe5a1703f4e5f4f807119a62d
parent0e375686e2f2c6c626f50c06c5323c0982d7f602 (diff)
loplugin:useuniqueptr in ScEditWindow
Change-Id: I0398045030b8c2dcc8cd8e47112271c80d194616 Reviewed-on: https://gerrit.libreoffice.org/56617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/inc/tphfedit.hxx6
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx12
2 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/ui/inc/tphfedit.hxx b/sc/source/ui/inc/tphfedit.hxx
index 741f432d95bc..606053ef4920 100644
--- a/sc/source/ui/inc/tphfedit.hxx
+++ b/sc/source/ui/inc/tphfedit.hxx
@@ -68,7 +68,7 @@ public:
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
- ScHeaderEditEngine* GetEditEngine() const { return pEdEngine; }
+ ScHeaderEditEngine* GetEditEngine() const { return pEdEngine.get(); }
void SetObjectSelectHdl( const Link<ScEditWindow&,void>& aLink) { aObjectSelectLink = aLink; }
void SetGetFocusHdl(const std::function<void (ScEditWindow&)>& rLink) { m_GetFocusLink = rLink; }
@@ -85,8 +85,8 @@ protected:
virtual void Resize() override;
private:
- ScHeaderEditEngine* pEdEngine;
- EditView* pEdView;
+ std::unique_ptr<ScHeaderEditEngine> pEdEngine;
+ std::unique_ptr<EditView> pEdView;
ScEditWindowLocation eLocation;
bool mbRTL;
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 7ddb851ff18f..ba8582e5db87 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -80,7 +80,7 @@ ScEditWindow::ScEditWindow( vcl::Window* pParent, WinBits nBits, ScEditWindowLoc
Size aSize( GetOutputSize() );
aSize.setHeight( aSize.Height() * 4 );
- pEdEngine = new ScHeaderEditEngine( EditEngine::CreatePool() );
+ pEdEngine.reset( new ScHeaderEditEngine( EditEngine::CreatePool() ) );
pEdEngine->SetPaperSize( aSize );
pEdEngine->SetRefDevice( this );
@@ -94,11 +94,11 @@ ScEditWindow::ScEditWindow( vcl::Window* pParent, WinBits nBits, ScEditWindowLoc
if (mbRTL)
pEdEngine->SetDefaultHorizontalTextDirection(EEHorizontalTextDirection::R2L);
- pEdView = new EditView( pEdEngine, this );
+ pEdView.reset( new EditView( pEdEngine.get(), this ) );
pEdView->SetOutputArea( tools::Rectangle( Point(0,0), GetOutputSize() ) );
pEdView->SetBackgroundColor( aBgColor );
- pEdEngine->InsertView( pEdView );
+ pEdEngine->InsertView( pEdView.get() );
}
void ScEditWindow::Resize()
@@ -125,8 +125,8 @@ void ScEditWindow::dispose()
if (xTemp.is())
pAcc->dispose();
}
- delete pEdEngine;
- delete pEdView;
+ pEdEngine.reset();
+ pEdView.reset();
Control::dispose();
}
@@ -326,7 +326,7 @@ css::uno::Reference< css::accessibility::XAccessible > ScEditWindow::CreateAcces
}
break;
}
- pAcc = new ScAccessibleEditObject(GetAccessibleParentWindow()->GetAccessible(), pEdView, this,
+ pAcc = new ScAccessibleEditObject(GetAccessibleParentWindow()->GetAccessible(), pEdView.get(), this,
sName, sDescription, ScAccessibleEditObject::EditControl);
css::uno::Reference< css::accessibility::XAccessible > xAccessible = pAcc;
xAcc = xAccessible;