loplugin:useuniqueptr in ScCellFieldsObj

Change-Id: I894abfcfd9b2710a1aa81cca94158dbe4a7d9eeb
Reviewed-on: https://gerrit.libreoffice.org/56620
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-06-28 10:44:34 +02:00
parent f5772b154d
commit f7355a9e7c
2 changed files with 3 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ private:
css::uno::Reference<css::text::XTextRange> mxContent;
ScDocShell* pDocShell;
ScAddress aCellPos;
ScEditSource* mpEditSource;
std::unique_ptr<ScEditSource> mpEditSource;
/// List of refresh listeners.
comphelper::OInterfaceContainerHelper2* mpRefreshListeners;
/// mutex to lock the InterfaceContainerHelper

View File

@@ -278,7 +278,7 @@ ScCellFieldsObj::ScCellFieldsObj(
{
pDocShell->GetDocument().AddUnoObject(*this);
mpEditSource = new ScCellEditSource( pDocShell, aCellPos );
mpEditSource.reset( new ScCellEditSource( pDocShell, aCellPos ) );
}
ScCellFieldsObj::~ScCellFieldsObj()
@@ -288,7 +288,7 @@ ScCellFieldsObj::~ScCellFieldsObj()
if (pDocShell)
pDocShell->GetDocument().RemoveUnoObject(*this);
delete mpEditSource;
mpEditSource.reset();
// increment refcount to prevent double call off dtor
osl_atomic_increment( &m_refCount );