Kaydet (Commit) 171710c6 authored tarafından Noel Grandin's avatar Noel Grandin

make Format->Conditional Formatting->Manage dialog async

Reviewed-on: https://gerrit.libreoffice.org/66097
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit f548dfa2)

Change-Id: I13a40c13340ea34cbcbde11289d3420855a7264f
Reviewed-on: https://gerrit.libreoffice.org/66206Reviewed-by: 's avatarMert Tümer <mert.tumer@collabora.com>
Tested-by: 's avatarMert Tümer <mert.tumer@collabora.com>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst f5499236
...@@ -2651,44 +2651,45 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ...@@ -2651,44 +2651,45 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if (!pList) if (!pList)
pList = pDoc->GetCondFormList( aPos.Tab() ); pList = pDoc->GetCondFormList( aPos.Tab() );
ScopedVclPtr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg( VclPtr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg(
pTabViewShell->GetDialogParent(), pDoc, pList)); pTabViewShell->GetDialogParent(), pDoc, pList));
if (pDlgItem) if (pDlgItem)
pDlg->SetModified(); pDlg->SetModified();
short nRet = pDlg->Execute(); pDlg->StartExecuteAsync([this, pDlg, pData, pTabViewShell, pDlgItem, aPos](sal_Int32 nRet){
ScConditionalFormatList* pCondFormatList = pDlg->GetConditionalFormatList(); std::unique_ptr<ScConditionalFormatList> pCondFormatList(pDlg->GetConditionalFormatList());
if(nRet == RET_OK && pDlg->CondFormatsChanged()) if(nRet == RET_OK && pDlg->CondFormatsChanged())
{ {
pData->GetDocShell()->GetDocFunc().SetConditionalFormatList(pCondFormatList, aPos.Tab()); pData->GetDocShell()->GetDocFunc().SetConditionalFormatList(pCondFormatList.release(), aPos.Tab());
} }
else if(nRet == DLG_RET_ADD) else if(nRet == DLG_RET_ADD)
{ {
// Put the xml string parameter to initialize the // Put the xml string parameter to initialize the
// Conditional Format Dialog. ( add new ) // Conditional Format Dialog. ( add new )
pTabViewShell->GetPool().Put(ScCondFormatDlgItem( pTabViewShell->GetPool().Put(ScCondFormatDlgItem(
std::shared_ptr<ScConditionalFormatList>(pCondFormatList), -1, true)); std::shared_ptr<ScConditionalFormatList>(pCondFormatList.release()), -1, true));
// Queue message to open Conditional Format Dialog // Queue message to open Conditional Format Dialog
GetViewData()->GetDispatcher().Execute( SID_OPENDLG_CONDFRMT, SfxCallMode::ASYNCHRON ); GetViewData()->GetDispatcher().Execute( SID_OPENDLG_CONDFRMT, SfxCallMode::ASYNCHRON );
} }
else if (nRet == DLG_RET_EDIT) else if (nRet == DLG_RET_EDIT)
{ {
ScConditionalFormat* pFormat = pDlg->GetCondFormatSelected(); ScConditionalFormat* pFormat = pDlg->GetCondFormatSelected();
sal_Int32 nIndex = pFormat ? pFormat->GetKey() : -1; sal_Int32 nIndex = pFormat ? pFormat->GetKey() : -1;
// Put the xml string parameter to initialize the // Put the xml string parameter to initialize the
// Conditional Format Dialog. ( edit selected conditional format ) // Conditional Format Dialog. ( edit selected conditional format )
pTabViewShell->GetPool().Put(ScCondFormatDlgItem( pTabViewShell->GetPool().Put(ScCondFormatDlgItem(
std::shared_ptr<ScConditionalFormatList>(pCondFormatList), nIndex, true)); std::shared_ptr<ScConditionalFormatList>(pCondFormatList.release()), nIndex, true));
// Queue message to open Conditional Format Dialog // Queue message to open Conditional Format Dialog
GetViewData()->GetDispatcher().Execute( SID_OPENDLG_CONDFRMT, SfxCallMode::ASYNCHRON ); GetViewData()->GetDispatcher().Execute( SID_OPENDLG_CONDFRMT, SfxCallMode::ASYNCHRON );
} }
else else
delete pCondFormatList; pCondFormatList.reset();
if (pDlgItem) if (pDlgItem)
pTabViewShell->GetPool().Remove(*pDlgItem); pTabViewShell->GetPool().Remove(*pDlgItem);
});
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment