sc/source/ui/view/tabvwsha.cxx | 4 ++-- sd/source/ui/docshell/docshel3.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
New commits: commit 8bafb01d0188fc383813a70436e174c9595d1e89 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Apr 8 06:42:58 2025 +0000 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Wed Apr 9 09:04:21 2025 +0200 Fix potentially uninitialized local pointer variable Change-Id: Iaa7619491c1462303f4df82c1cb12f23409c4986 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183841 Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 46cb5a6e8258..67e2fe125430 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -808,10 +808,10 @@ void ScTabViewShell::ExecuteSave( SfxRequest& rReq ) // only SID_SAVEDOC / SID_SAVEASDOC bool bCommitChanges = true; const SfxItemSet* pReqArgs = rReq.GetArgs(); - const SfxPoolItem* pItem; + const SfxPoolItem* pItem = nullptr; bool bHasDontTerminateEdit = pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem); - if (bHasDontTerminateEdit) + if (bHasDontTerminateEdit && pItem) bCommitChanges = !static_cast<const SfxBoolItem*>(pItem)->GetValue(); // Finish entering unless 'DontTerminateEdit' is specified, even if a formula is being processed diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 67948004d5fa..c3d129678bbb 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -233,11 +233,11 @@ void DrawDocShell::Execute( SfxRequest& rReq ) case SID_SAVEDOC: case SID_SAVEASDOC: { - const SfxPoolItem* pItem; + const SfxPoolItem* pItem = nullptr; bool bCommitChanges = false; const SfxItemSet* pReqArgs = rReq.GetArgs(); bool bHasDontTerminateEdit = pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem); - if (bHasDontTerminateEdit) + if (bHasDontTerminateEdit && pItem) bCommitChanges = !static_cast<const SfxBoolItem*>(pItem)->GetValue(); if (mpViewShell && bCommitChanges)