Kaydet (Commit) ca11699d authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1435678 Resource leak

Change-Id: I994508d0d88fa6727c49d568956887ca1d22ce7e
Reviewed-on: https://gerrit.libreoffice.org/54588Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d4376507
......@@ -478,8 +478,13 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
return;
}
SdUndoGroup* pUndoGroup(new SdUndoGroup(GetDoc()));
pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
SdUndoGroup* pUndoGroup(nullptr);
SfxViewShell* pViewShell(GetViewShell());
if (pViewShell)
{
pUndoGroup = new SdUndoGroup(GetDoc());
pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
}
Broadcast (ViewShellHint(ViewShellHint::HINT_PAGE_RESIZE_START));
// use Model-based method at SdDrawDocument
......@@ -503,9 +508,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
}
// handed over undo group to undo manager
SfxViewShell* pViewShell(GetViewShell());
if(nullptr != pViewShell)
if (pViewShell)
{
pViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager()->AddUndoAction(pUndoGroup);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment