diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-10-18 00:51:11 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-10-18 08:45:23 +0200 |
commit | 954f061b93c9b8bc441af498dc19aaa1afcba791 (patch) | |
tree | 4fbaa7ab11134c969b060a3722b90871b53a213f /sc | |
parent | 47781b6733ed05c0f4ec1e0b6ab0b5d26f8415d9 (diff) |
tdf#163486: PVS: redundant nullptr check
V668 There is no sense in testing the 'pInfo' 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: Ie6a701c8fd8d6a0386e83012d59389edaccea93e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175109
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/oox/extlstcontext.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 5bdfd1943b4e..80e0b8ef53d2 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -170,12 +170,9 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl if (aExt == getExtLst().end()) { pInfo = new ScDataBarFormatData(); - if (pInfo) - { - auto pFormat = std::make_unique<ScDataBarFormat>(&getScDocument()); - pFormat->SetDataBarData(pInfo); - getCondFormats().importExtFormatEntries().push_back(std::move(pFormat)); - } + auto pFormat = std::make_unique<ScDataBarFormat>(&getScDocument()); + pFormat->SetDataBarData(pInfo); + getCondFormats().importExtFormatEntries().push_back(std::move(pFormat)); } else { |