sd/source/ui/view/drawview.cxx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
New commits: commit cf6adeaf1c7f765c83481cff0311b9817ac4cbc1 Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Wed Jun 26 02:04:59 2013 -0500 coverity#1027646 Dereference after null check Change-Id: Id1028f87a6dded7d2c27fe8d793342574d06e3f9 Reviewed-on: https://gerrit.libreoffice.org/4528 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 27c5ece..0a273fe 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -587,13 +587,20 @@ void DrawView::DeleteMarked() Rectangle aRect( pObj->GetLogicRect() ); SdrObject* pNewObj = pPage->InsertAutoLayoutShape( 0, ePresObjKind, bVertical, aRect, true ); - // Move the new PresObj to the position before the - // object it will replace. - pUndoManager->AddUndoAction( - mrDoc.GetSdrUndoFactory().CreateUndoObjectOrdNum( - *pNewObj, - pNewObj->GetOrdNum(), - pObj->GetOrdNum())); + // pUndoManager should not be NULL (see assert above) + // but since we have defensive code + // for it earlier and later in the function + // we might as well be consistant + if(pUndoManager) + { + // Move the new PresObj to the position before the + // object it will replace. + pUndoManager->AddUndoAction( + mrDoc.GetSdrUndoFactory().CreateUndoObjectOrdNum( + *pNewObj, + pNewObj->GetOrdNum(), + pObj->GetOrdNum())); + } pPage->SetObjectOrdNum( pNewObj->GetOrdNum(), pObj->GetOrdNum() ); bResetLayout = true; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits