From f6fc9dd338751f8d14ce66024238976fa7259fcc Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 23 Oct 2024 01:01:03 +0200 Subject: [PATCH] tdf#163486: PVS: Expression is always true V560 A part of conditional expression is always true: pItem. Change-Id: I4ae18820dc7ec3232bccb099e56dd0da2b4f59eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175456 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- svx/source/fmcomp/fmgridcl.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 8e91cbb56a35..4ed389f68ac7 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -800,10 +800,9 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, weld::Menu& rM std::unique_ptr pItem; SfxItemState eState = pCurrentFrame->GetBindings().QueryState(SID_FM_CTL_PROPERTIES, pItem); - if (eState >= SfxItemState::DEFAULT && pItem != nullptr) + if (eState >= SfxItemState::DEFAULT && pItem) { - bool bChecked = pItem && pItem->GetValue(); - rMenu.set_active(u"column"_ustr, bChecked); + rMenu.set_active(u"column"_ustr, pItem->GetValue()); } } }