sc/source/ui/condformat/condformatmgr.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit b0ad3fe411de2056640f432ab87b4d4ad63fcb43 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Aug 20 18:14:05 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Aug 21 13:42:40 2024 +0200 WaE: C6011 Dereferencing NULL pointer warnings Change-Id: I007c8ee7d5b6d752346f670a7b650d35afb27d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172156 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 20b5fd732dec..fcb1b8afd3a0 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -194,7 +194,8 @@ ScConditionalFormat* ScCondFormatManagerDlg::GetCondFormatSelected() void ScCondFormatManagerDlg::ShowEasyConditionalDialog(bool isEdit) { - if (!SfxViewShell::Current()) + SfxViewShell* pViewShell = SfxViewShell::Current(); + if (!pViewShell) return; auto id = m_xConditionalType->get_active(); @@ -207,7 +208,7 @@ void ScCondFormatManagerDlg::ShowEasyConditionalDialog(bool isEdit) { SfxInt16Item FormatRule(FN_PARAM_1, m_xConditionalCellValue->get_active_id().toUInt32()); - SfxViewShell::Current()->GetDispatcher()->ExecuteList( + pViewShell->GetDispatcher()->ExecuteList( SID_EASY_CONDITIONAL_FORMAT_DIALOG, SfxCallMode::ASYNCHRON, { &FormatRule, &IsManaged, &FormatKey, &EntryIndex }); } @@ -216,7 +217,7 @@ void ScCondFormatManagerDlg::ShowEasyConditionalDialog(bool isEdit) { SfxInt16Item FormatRule(FN_PARAM_1, static_cast<sal_Int16>(ScConditionMode::Formula)); SfxStringItem Formula(FN_PARAM_5, m_xConditionalFormula->GetText()); - SfxViewShell::Current()->GetDispatcher()->ExecuteList( + pViewShell->GetDispatcher()->ExecuteList( SID_EASY_CONDITIONAL_FORMAT_DIALOG, SfxCallMode::ASYNCHRON, { &FormatRule, &IsManaged, &FormatKey, &EntryIndex, &Formula }); } @@ -224,7 +225,7 @@ void ScCondFormatManagerDlg::ShowEasyConditionalDialog(bool isEdit) case 2: // Date { SfxInt16Item FormatRule(FN_PARAM_1, m_xConditionalDate->get_active_id().toUInt32()); - SfxViewShell::Current()->GetDispatcher()->ExecuteList( + pViewShell->GetDispatcher()->ExecuteList( SID_EASY_CONDITIONAL_FORMAT_DIALOG, SfxCallMode::ASYNCHRON, { &FormatRule, &IsManaged, &FormatKey, &EntryIndex }); }