summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/transfrm.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-08 11:22:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-09 12:09:55 +0200
commitf7ce839c7844f029c0a1ac83a5638e83356b4c4b (patch)
treec93a342a577133b384a3ccc088d7d0675d4fb9e3 /cui/source/tabpages/transfrm.cxx
parent4ba06560e33f17ca1ed72ad722c80eae5ffd4277 (diff)
use unique_ptr in SfxUndoManager::AddUndoAction
Change-Id: I11483e3cece12a7373f4276972b4c899edf1ce15 Reviewed-on: https://gerrit.libreoffice.org/61566 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/tabpages/transfrm.cxx')
-rw-r--r--cui/source/tabpages/transfrm.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 46c3d2570762..eac242eda649 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -526,10 +526,9 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs)
static_cast< SdrObjCustomShape& >(
*pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()));
SdrModel& rModel(rSdrObjCustomShape.getSdrModelFromSdrObject());
- SdrUndoAction* pUndo(
- rModel.IsUndoEnabled()
- ? rModel.GetSdrUndoFactory().CreateUndoAttrObject(rSdrObjCustomShape)
- : nullptr);
+ std::unique_ptr<SdrUndoAction> pUndo;
+ if (rModel.IsUndoEnabled())
+ pUndo = rModel.GetSdrUndoFactory().CreateUndoAttrObject(rSdrObjCustomShape);
if(pUndo)
{
@@ -561,7 +560,7 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs)
if (pUndo)
{
- rModel.AddUndo(pUndo);
+ rModel.AddUndo(std::move(pUndo));
rModel.EndUndo();
}
}