From ca787ba7c81c142e03126ea0c648540b3b3bdc0b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 20 Mar 2018 13:52:54 +0200 Subject: loplugin:useuniqueptr in SmDocShell Change-Id: I1183edd427da0ee31547ebdad572ec5cac3fb33f Reviewed-on: https://gerrit.libreoffice.org/51670 Tested-by: Jenkins Reviewed-by: Noel Grandin --- starmath/inc/document.hxx | 2 +- starmath/source/document.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'starmath') diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index af2ce9475fc3..00be9e454248 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -91,7 +91,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener SvtLinguOptions maLinguOptions; std::unique_ptr mpTree; SfxItemPool *mpEditEngineItemPool; - EditEngine *mpEditEngine; + std::unique_ptr mpEditEngine; VclPtr mpPrinter; //q.v. comment to SmPrinter Access! VclPtr mpTmpPrinter; //ditto sal_uInt16 mnModifyCount; diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index dc2e5fffd255..7153bcccf157 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -331,7 +331,7 @@ EditEngine& SmDocShell::GetEditEngine() SetEditEngineDefaultFonts(*mpEditEngineItemPool, maLinguOptions); - mpEditEngine = new EditEngine( mpEditEngineItemPool ); + mpEditEngine.reset( new EditEngine( mpEditEngineItemPool ) ); mpEditEngine->SetAddExtLeading(true); @@ -639,7 +639,7 @@ SmDocShell::~SmDocShell() EndListening(*pp->GetConfig()); mpCursor.reset(); - delete mpEditEngine; + mpEditEngine.reset(); SfxItemPool::Free(mpEditEngineItemPool); mpPrinter.disposeAndClear(); } -- cgit v1.2.3