summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/cellsh1.cxx16
-rw-r--r--sc/source/ui/view/cellsh3.cxx13
2 files changed, 16 insertions, 13 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 7593b037020c..331ba8a5efca 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2933,7 +2933,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pDlg->SetModified();
pDlg->StartExecuteAsync(
- [pDlg, &rData, pTabViewShell, rDlgItem, aPos](sal_Int32 nRet)
+ [this, pDlg, &rData, pTabViewShell, rDlgItem, aPos](sal_Int32 nRet)
{
std::unique_ptr<ScConditionalFormatList> pCondFormatList
= pDlg->GetConditionalFormatList();
@@ -2948,7 +2948,19 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
else if (nRet == DLG_RET_EDIT)
{
- pDlg->ShowEasyConditionalDialog(true);
+ ScConditionalFormat* pFormat = pDlg->GetCondFormatSelected();
+ sal_Int32 nIndex = pFormat ? pFormat->GetKey() : -1;
+ // Put the xml string parameter to initialize the
+ // Conditional Format Dialog. ( edit selected conditional format )
+ pTabViewShell->setScCondFormatDlgItem(
+ std::make_shared<ScCondFormatDlgData>(
+ std::shared_ptr<ScConditionalFormatList>(
+ pCondFormatList.release()),
+ nIndex, true));
+
+ // Queue message to open Conditional Format Dialog
+ GetViewData().GetDispatcher().Execute(SID_OPENDLG_CONDFRMT,
+ SfxCallMode::ASYNCHRON);
}
else
pCondFormatList.reset();
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 2e36d876bf33..6206ace72f65 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -470,22 +470,13 @@ void ScCellShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pFormula;
OUString formula;
- if (pReqArgs->HasItem(FN_PARAM_5, &pFormula))
+ if (pReqArgs->HasItem(FN_PARAM_3, &pFormula))
{
formula = static_cast<const SfxStringItem*>(pFormula)->GetValue();
}
- const SfxPoolItem *pFormatKey, *pEntryIndex;
- sal_Int32 nFormatKey = -1, nEntryIndex = -1;
- if (pReqArgs->HasItem(FN_PARAM_3, &pFormatKey)
- && pReqArgs->HasItem(FN_PARAM_4, &pEntryIndex))
- {
- nFormatKey = static_cast<const SfxInt32Item*>(pFormatKey)->GetValue();
- nEntryIndex = static_cast<const SfxInt32Item*>(pEntryIndex)->GetValue();
- }
GetViewData().GetDocument().SetEasyConditionalFormatDialogData(
- ScConditionEasyDialogData(&nFormat, bManaged, nFormatKey, nEntryIndex,
- formula));
+ ScConditionEasyDialogData(&nFormat, bManaged, formula));
pScMod->SetRefDialog( nId, pWindow == nullptr );
}