summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-02 10:33:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-03 08:22:35 +0200
commitc35f95b3ec48e6057d4ddafe688daff1cede59c0 (patch)
treef275feb3c8ce6095f3ab2e17584bfe660cfe4695 /svx
parentfef6c6cf67eab1b02a7761cedf6355e33804f6e2 (diff)
loplugin:useuniqueptr in SdrTableObjImpl
Change-Id: Ic59384aef628ff2d34a735ce9b10d38a5e2a8b11 Reviewed-on: https://gerrit.libreoffice.org/53756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/table/svdotable.cxx24
1 files changed, 6 insertions, 18 deletions
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 889dbccff77a..e90b0e8fbab0 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -191,7 +191,7 @@ public:
CellRef mxActiveCell;
TableModelRef mxTable;
SdrTableObj* mpTableObj;
- TableLayouter* mpLayouter;
+ std::unique_ptr<TableLayouter> mpLayouter;
CellPos maEditPos;
TableStyleSettings maTableStyle;
Reference< XIndexAccess > mxTableStyle;
@@ -277,7 +277,7 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n
mxTable->init( nColumns, nRows );
Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(this) );
mxTable->addModifyListener( xListener );
- mpLayouter = new TableLayouter( mxTable );
+ mpLayouter.reset(new TableLayouter( mxTable ));
LayoutTable( mpTableObj->maRect, true, true );
mpTableObj->maLogicRect = mpTableObj->maRect;
}
@@ -289,11 +289,7 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
{
disconnectTableStyle();
- if( mpLayouter )
- {
- delete mpLayouter;
- mpLayouter = nullptr;
- }
+ mpLayouter.reset();
if( mxTable.is() )
{
@@ -306,7 +302,7 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
maTableStyle = rSource.maTableStyle;
mxTable = new TableModel( mpTableObj, rSource.mxTable );
- mpLayouter = new TableLayouter( mxTable );
+ mpLayouter.reset(new TableLayouter( mxTable ));
Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(this) );
mxTable->addModifyListener( xListener );
mxTableStyle = rSource.mxTableStyle;
@@ -456,11 +452,7 @@ void SdrTableObjImpl::dispose()
disconnectTableStyle();
mxTableStyle.clear();
- if( mpLayouter )
- {
- delete mpLayouter;
- mpLayouter = nullptr;
- }
+ mpLayouter.reset();
if( mxTable.is() )
{
@@ -638,11 +630,7 @@ void SAL_CALL SdrTableObjImpl::disposing( const css::lang::EventObject& /*Source
{
mxActiveCell.clear();
mxTable.clear();
- if( mpLayouter )
- {
- delete mpLayouter;
- mpLayouter = nullptr;
- }
+ mpLayouter.reset();
mpTableObj = nullptr;
}