sc/source/ui/condformat/condformateasydlg.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit dbf963f8995f3213b9c21b3893aa20c1cc5f0c27
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Tue Oct 29 07:05:55 2024 +0530
Commit:     Pranam Lashkari <lpra...@collabora.com>
CommitDate: Fri Nov 1 23:21:43 2024 +0100

    sc: fixed incorrect conditional format list usage
    
    problem:
    incorrect list was fetched caused problem when edited the condition
    
    Change-Id: Idd277074b94bed13327fd1e58f80a5ab7697c7b3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175766
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit 5690f62d3226d6a91dfdc79489b74c726870f683)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175911
    Reviewed-by: Pranam Lashkari <lpra...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/source/ui/condformat/condformateasydlg.cxx 
b/sc/source/ui/condformat/condformateasydlg.cxx
index eb16cb658d10..fe473ce80b96 100644
--- a/sc/source/ui/condformat/condformateasydlg.cxx
+++ b/sc/source/ui/condformat/condformateasydlg.cxx
@@ -263,11 +263,11 @@ 
ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings,
 
     ScRangeList aRange;
     mpViewData->GetMarkData().FillRangeListWithMarks(&aRange, false);
+    ScConditionalFormat* format
+        = 
mpDocument->GetCondFormList(mpViewData->GetTabNo())->GetFormat(mnFormatKey);
     if (aRange.empty() && mnFormatKey != -1 && mnEntryIndex != -1)
     {
-        aRange = mpDocument->GetCondFormList(mpViewData->GetTabNo())
-                     ->GetFormat(mnFormatKey)
-                     ->GetRangeList();
+        aRange = format->GetRangeList();
     }
     else if (aRange.empty())
     {
@@ -283,8 +283,6 @@ 
ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings,
     aRange.Format(sRangeString, ScRefFlags::VALID, *mpDocument, 
mpDocument->GetAddressConvention());
     mxRangeEntry->SetText(sRangeString);
 
-    ScConditionalFormat* format = mpViewData->GetDocument().GetCondFormat(
-        maPosition.Col(), maPosition.Row(), maPosition.Tab());
     OUString sStyleName;
     if (format)
     {
commit a9235b93ff7d2751a5cd96f6299a0507aba96713
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Tue Oct 29 06:16:59 2024 +0530
Commit:     Pranam Lashkari <lpra...@collabora.com>
CommitDate: Fri Nov 1 23:21:33 2024 +0100

    sc: fixed crashing on conditional format entry selection
    
    Change-Id: I40e5b77cb98803664cff0db370f3079431820129
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175765
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Pranam Lashkari <lpra...@collabora.com>
    (cherry picked from commit 69c6ce6d8c6c6a6f9e3f0ea1319dbdb2190ccaab)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175910
    Tested-by: Jenkins

diff --git a/sc/source/ui/condformat/condformateasydlg.cxx 
b/sc/source/ui/condformat/condformateasydlg.cxx
index c95a3df9df27..eb16cb658d10 100644
--- a/sc/source/ui/condformat/condformateasydlg.cxx
+++ b/sc/source/ui/condformat/condformateasydlg.cxx
@@ -289,6 +289,8 @@ 
ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings,
     if (format)
     {
         const ScFormatEntry* entry = format->GetEntry(mnEntryIndex);
+        if (!entry)
+            return;
         ScFormatEntry::Type type = entry->GetType();
         if (type == ScFormatEntry::Type::Condition)
         {

Reply via email to