From 47c417c553c7ffcb85cba5b5943316ea9e93f025 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 7 Oct 2019 21:20:49 +0200 Subject: Simplify if/else and remove useless assert in undoobj.cxx (sw) 791 else if( pEndNdIdx || !pTextNd ) corresponds to the negation of the if condition: 767 if (!pEndNdIdx && pTextNd) So remove existing "else" block and replace "else if" by "else" Change-Id: I9681f97fdbaece7495d4765617a2634b0cc8f2e3 Reviewed-on: https://gerrit.libreoffice.org/80399 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Julien Nabet --- sw/source/core/undo/undobj.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sw') diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 441e1744791a..5a3dd9a3e66c 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -788,7 +788,7 @@ void SwUndoSaveContent::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, aRedlRest.Restore(); } - else if( pEndNdIdx || !pTextNd ) + else { SwNodeRange aRg( rNds, nNodeIdx, rNds, (pEndNdIdx ? ((*pEndNdIdx) + 1) @@ -796,9 +796,6 @@ void SwUndoSaveContent::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, rNds.MoveNodes(aRg, rDoc.GetNodes(), rInsPos.nNode, nullptr == pEndNdIdx || bForceCreateFrames); } - else { - assert(false); // wtf? - } } // These two methods move the Point of Pam backwards/forwards. With that, one -- cgit