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>
This commit is contained in:
Noel Grandin 2018-07-03 09:36:24 +02:00
parent 2ddddc46fd
commit 38733c7daa
3 changed files with 14 additions and 11 deletions

View File

@ -68,6 +68,9 @@ public:
// SwRedlineData::pNext and pExtraData have complex handling
if (fn == SRCDIR "/sw/source/core/doc/docredln.cxx")
return;
// ScTempDocSource::pTempDoc
if (fn == SRCDIR "/sc/source/ui/unoobj/funcuno.cxx")
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}

View File

@ -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

View File

@ -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() :