From 19e1cf2d1c83586c0444d7eb0a23128706262f28 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 14 Nov 2024 13:25:32 +0100 Subject: tdf#163486: PVS: redundant nullptr check V668 There is no sense in testing the 'pUndo' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. Change-Id: I3eeff673f5c0862e0b3c7f0a5338ddb0882ab31d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176594 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sw/source/uibase/shells/basesh.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sw/source') diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 25a4465f30b0..d5c0a4eac9f3 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -3066,8 +3066,7 @@ static void InsertTableImpl(SwWrtShell& rSh, { pTableNode->GetTable().SetTableStyleName( aAutoName ); SwUndoTableAutoFormat* pUndo = new SwUndoTableAutoFormat( *pTableNode, *pTAFormat ); - if ( pUndo ) - rSh.GetIDocumentUndoRedo().AppendUndo( std::unique_ptr(pUndo) ); + rSh.GetIDocumentUndoRedo().AppendUndo( std::unique_ptr(pUndo) ); } } -- cgit