diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-03 09:36:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-04 08:35:22 +0200 |
commit | 38733c7daab85793a8d88c58808f8e35d3d25887 (patch) | |
tree | 7dbd9e7642275709ff2e4223c9faab1cefa63cb0 /sc | |
parent | 2ddddc46fdc3cf18cefcca29934eaab0544d2198 (diff) |
loplugin:useuniqueptr in ScSimpleEditSourceHelper
Change-Id: Iebe62753d9e6f83f985e4c55fb938d5861613898
Reviewed-on: https://gerrit.libreoffice.org/56903
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/textuno.hxx | 10 | ||||
-rw-r--r-- | sc/source/ui/unoobj/textuno.cxx | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx index bb90c82f85f4..f8ae5f60bff8 100644 --- a/sc/inc/textuno.hxx +++ b/sc/inc/textuno.hxx @@ -293,16 +293,16 @@ public: class ScSimpleEditSourceHelper { - ScEditEngineDefaulter* pEditEngine; - SvxEditEngineForwarder* pForwarder; - ScSimpleEditSource* pOriginalSource; + std::unique_ptr<ScEditEngineDefaulter> pEditEngine; + std::unique_ptr<SvxEditEngineForwarder> pForwarder; + std::unique_ptr<ScSimpleEditSource> pOriginalSource; public: ScSimpleEditSourceHelper(); ~ScSimpleEditSourceHelper(); - ScSimpleEditSource* GetOriginalSource() const { return pOriginalSource; } - ScEditEngineDefaulter* GetEditEngine() const { return pEditEngine; } + ScSimpleEditSource* GetOriginalSource() const { return pOriginalSource.get(); } + ScEditEngineDefaulter* GetEditEngine() const { return pEditEngine.get(); } }; class ScEditEngineTextObj : public ScSimpleEditSourceHelper, public SvxUnoText diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 7d92fd868a67..6642e3af57a8 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -822,18 +822,18 @@ ScSimpleEditSourceHelper::ScSimpleEditSourceHelper() pEnginePool->SetDefaultMetric( MapUnit::Map100thMM ); pEnginePool->FreezeIdRanges(); - pEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); // TRUE: become owner of pool - pForwarder = new SvxEditEngineForwarder( *pEditEngine ); - pOriginalSource = new ScSimpleEditSource( pForwarder ); + pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true) ); // TRUE: become owner of pool + pForwarder.reset( new SvxEditEngineForwarder( *pEditEngine ) ); + pOriginalSource.reset( new ScSimpleEditSource( pForwarder.get() ) ); } ScSimpleEditSourceHelper::~ScSimpleEditSourceHelper() { SolarMutexGuard aGuard; // needed for EditEngine dtor - delete pOriginalSource; - delete pForwarder; - delete pEditEngine; + pOriginalSource.reset(); + pForwarder.reset(); + pEditEngine.reset(); } ScEditEngineTextObj::ScEditEngineTextObj() : |