From dbf963f8995f3213b9c21b3893aa20c1cc5f0c27 Mon Sep 17 00:00:00 2001 From: Pranam Lashkari Date: Tue, 29 Oct 2024 07:05:55 +0530 Subject: sc: fixed incorrect conditional format list usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara (cherry picked from commit 5690f62d3226d6a91dfdc79489b74c726870f683) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175911 Reviewed-by: Pranam Lashkari Tested-by: Jenkins --- sc/source/ui/condformat/condformateasydlg.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sc/source/ui') 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) { -- cgit