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:
@@ -61,7 +61,7 @@ private:
|
|||||||
css::uno::Reference<css::text::XTextRange> mxContent;
|
css::uno::Reference<css::text::XTextRange> mxContent;
|
||||||
ScDocShell* pDocShell;
|
ScDocShell* pDocShell;
|
||||||
ScAddress aCellPos;
|
ScAddress aCellPos;
|
||||||
ScEditSource* mpEditSource;
|
std::unique_ptr<ScEditSource> mpEditSource;
|
||||||
/// List of refresh listeners.
|
/// List of refresh listeners.
|
||||||
comphelper::OInterfaceContainerHelper2* mpRefreshListeners;
|
comphelper::OInterfaceContainerHelper2* mpRefreshListeners;
|
||||||
/// mutex to lock the InterfaceContainerHelper
|
/// mutex to lock the InterfaceContainerHelper
|
||||||
|
@@ -278,7 +278,7 @@ ScCellFieldsObj::ScCellFieldsObj(
|
|||||||
{
|
{
|
||||||
pDocShell->GetDocument().AddUnoObject(*this);
|
pDocShell->GetDocument().AddUnoObject(*this);
|
||||||
|
|
||||||
mpEditSource = new ScCellEditSource( pDocShell, aCellPos );
|
mpEditSource.reset( new ScCellEditSource( pDocShell, aCellPos ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
ScCellFieldsObj::~ScCellFieldsObj()
|
ScCellFieldsObj::~ScCellFieldsObj()
|
||||||
@@ -288,7 +288,7 @@ ScCellFieldsObj::~ScCellFieldsObj()
|
|||||||
if (pDocShell)
|
if (pDocShell)
|
||||||
pDocShell->GetDocument().RemoveUnoObject(*this);
|
pDocShell->GetDocument().RemoveUnoObject(*this);
|
||||||
|
|
||||||
delete mpEditSource;
|
mpEditSource.reset();
|
||||||
|
|
||||||
// increment refcount to prevent double call off dtor
|
// increment refcount to prevent double call off dtor
|
||||||
osl_atomic_increment( &m_refCount );
|
osl_atomic_increment( &m_refCount );
|
||||||
|
Reference in New Issue
Block a user