sw/source/core/doc/DocumentContentOperationsManager.cxx | 5 +---- sw/source/core/edit/edfcol.cxx | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-)
New commits: commit 7f4a7af94cb747dd112d766f2d7f95a33b840b51 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Oct 18 13:54:31 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Oct 18 15:48:23 2024 +0200 tdf#163486: PVS: redundant nullptr check V668 There is no sense in testing the 'xExtra' 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: I1e0d02621808b7eda104d06afe8882f72da6d87f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175131 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index cf0fa505c47b..91e2fb05bc91 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1320,10 +1320,7 @@ namespace //local functions originally from docfmt.cxx xExtra.reset(new SwRedlineExtraData_FormatColl(u""_ustr, USHRT_MAX, &aSet)); } - if (xExtra) - { - pRedline->SetExtraData(xExtra.get() ); - } + pRedline->SetExtraData(xExtra.get() ); } // create format redline(s) for the given range: commit 33f254b48a8209ac0b6fd1a232f04e8fcb33fbc6 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Oct 18 13:52:27 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Oct 18 15:48:11 2024 +0200 tdf#163486: PVS: redundant nullptr check V668 There is no sense in testing the 'xExtra' 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: Ie851b98f15eac9e7d8118fb919438fbd389cfbf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175130 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index a998f5a51884..43b08d1086f5 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -2255,8 +2255,7 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat, { std::unique_ptr<SwRedlineExtraData_FormatColl> xExtra; xExtra.reset(new SwRedlineExtraData_FormatColl(sParaStyleName, nPoolId, nullptr)); - if (xExtra) - pRedline->SetExtraData( xExtra.get() ); + pRedline->SetExtraData( xExtra.get() ); } } }