diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-08 11:22:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-09 12:09:55 +0200 |
commit | f7ce839c7844f029c0a1ac83a5638e83356b4c4b (patch) | |
tree | c93a342a577133b384a3ccc088d7d0675d4fb9e3 /sd/source/ui/view/viewshe2.cxx | |
parent | 4ba06560e33f17ca1ed72ad722c80eae5ffd4277 (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 'sd/source/ui/view/viewshe2.cxx')
-rw-r--r-- | sd/source/ui/view/viewshe2.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index fafde8c53584..6d1ce78e86ec 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -479,11 +479,11 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, return; } - SdUndoGroup* pUndoGroup(nullptr); + std::unique_ptr<SdUndoGroup> pUndoGroup; SfxViewShell* pViewShell(GetViewShell()); if (pViewShell) { - pUndoGroup = new SdUndoGroup(GetDoc()); + pUndoGroup.reset(new SdUndoGroup(GetDoc())); pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT)); } Broadcast (ViewShellHint(ViewShellHint::HINT_PAGE_RESIZE_START)); @@ -492,7 +492,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, GetDoc()->AdaptPageSizeForAllPages( rNewSize, ePageKind, - pUndoGroup, + pUndoGroup.get(), nLeft, nRight, nUpper, @@ -511,7 +511,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, // handed over undo group to undo manager if (pViewShell) { - pViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager()->AddUndoAction(pUndoGroup); + pViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager()->AddUndoAction(std::move(pUndoGroup)); } // calculate View-Sizes |