summaryrefslogtreecommitdiff
path: root/svx/source/table/tablemodel.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/table/tablemodel.cxx')
-rw-r--r--svx/source/table/tablemodel.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx
index 49eb7f2f9655..c35463b0c297 100644
--- a/svx/source/table/tablemodel.cxx
+++ b/svx/source/table/tablemodel.cxx
@@ -37,6 +37,7 @@
#include "tablecolumns.hxx"
#include "tableundo.hxx"
#include <o3tl/safeint.hxx>
+#include <o3tl/make_unique.hxx>
#include <svx/svdotable.hxx>
#include <svx/svdmodel.hxx>
#include <svx/strings.hrc>
@@ -638,7 +639,7 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
(*aCellIter++) = getCell( nIndex + nOffset, nRow );
}
- rModel.AddUndo( new InsertColUndo( xThis, nIndex, aNewColumns, aNewCells ) );
+ rModel.AddUndo( o3tl::make_unique<InsertColUndo>( xThis, nIndex, aNewColumns, aNewCells ) );
}
const sal_Int32 nRowCount = getRowCountImpl();
@@ -713,7 +714,7 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
(*aCellIter++) = getCell( nIndex + nOffset, nRow );
}
- rModel.AddUndo( new RemoveColUndo( xThis, nIndex, aRemovedCols, aRemovedCells ) );
+ rModel.AddUndo( o3tl::make_unique<RemoveColUndo>( xThis, nIndex, aRemovedCols, aRemovedCells ) );
}
// only rows before and inside the removed rows are considered
@@ -808,7 +809,7 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
rModel.BegUndo( SvxResId(STR_TABLE_INSROW) );
rModel.AddUndo( rModel.GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
TableModelRef xThis( this );
- rModel.AddUndo( new InsertRowUndo( xThis, nIndex, aNewRows ) );
+ rModel.AddUndo( o3tl::make_unique<InsertRowUndo>( xThis, nIndex, aNewRows ) );
}
// check if cells merge over new columns
@@ -871,7 +872,7 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
for( sal_Int32 nOffset = 0; nOffset < nCount; ++nOffset )
aRemovedRows[nOffset] = maRows[nIndex+nOffset];
- rModel.AddUndo( new RemoveRowUndo( xThis, nIndex, aRemovedRows ) );
+ rModel.AddUndo( o3tl::make_unique<RemoveRowUndo>( xThis, nIndex, aRemovedRows ) );
}
// only rows before and inside the removed rows are considered