diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-06-26 21:52:33 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2019-06-29 16:15:26 +0200 |
commit | 368727a8a27b41820488684548e73f1fe973a67e (patch) | |
tree | 9d6c174df60efd38174c76c931ab4ba0fd71c58a | |
parent | efa8749743dbd0d08f3d317b82f765364cd1d994 (diff) |
lokdialog: Convert the Format -> ... -> Line... to async exec
For sw and sc
Change-Id: If89bff982d16ba8d4e4524445e56ee2fe23d7876
Reviewed-on: https://gerrit.libreoffice.org/74880
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Tested-by: Muhammet Kara <muhammet.kara@collabora.com>
-rw-r--r-- | sc/source/ui/drawfunc/drawsh.cxx | 25 | ||||
-rw-r--r-- | sw/source/uibase/shells/drawdlg.cxx | 58 |
2 files changed, 48 insertions, 35 deletions
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 379d9cf35602..07216e1747b4 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -383,6 +383,9 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq ) const SdrObject* pObj = nullptr; const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); + std::shared_ptr<SfxRequest> pRequest; + pRequest.reset(new SfxRequest(rReq)); + if( rMarkList.GetMarkCount() == 1 ) pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); @@ -392,23 +395,25 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(), + VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(), &aNewAttr, pViewData->GetDocument()->GetDrawLayer(), pObj, bHasMarked)); OSL_ENSURE(pDlg, "Dialog creation failed!"); - if ( pDlg->Execute() == RET_OK ) - { - if( bHasMarked ) - pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), false ); - else - pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false ); + pDlg->StartExecuteAsync([=](sal_Int32 nResult){ + if ( nResult == RET_OK ) + { + if( bHasMarked ) + pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), false ); + else + pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false ); - pView->InvalidateAttribs(); - rReq.Done(); - } + pView->InvalidateAttribs(); + pRequest->Done(); + } + }); } void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq ) diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index 8527944f62aa..dbf314c08fd9 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -127,37 +127,45 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( nullptr, + VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( &GetView().GetFrame()->GetWindow(), &aNewAttr, pDoc, pObj, bHasMarked)); OSL_ENSURE(pDlg, "Dialog creation failed!"); - if (pDlg->Execute() == RET_OK) - { - pSh->StartAction(); - if(bHasMarked) - pView->SetAttrToMarked(*pDlg->GetOutputItemSet(), false); - else - pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), false); - pSh->EndAction(); - - static sal_uInt16 aInval[] = + + pDlg->StartExecuteAsync([=](sal_Int32 nResult){ + if (nResult == RET_OK) { - SID_ATTR_LINE_STYLE, // ( SID_SVX_START + 169 ) - SID_ATTR_LINE_DASH, // ( SID_SVX_START + 170 ) - SID_ATTR_LINE_WIDTH, // ( SID_SVX_START + 171 ) - SID_ATTR_LINE_COLOR, // ( SID_SVX_START + 172 ) - SID_ATTR_LINE_START, // ( SID_SVX_START + 173 ) - SID_ATTR_LINE_END, // ( SID_SVX_START + 174 ) - SID_ATTR_LINE_TRANSPARENCE, // (SID_SVX_START+1107) - SID_ATTR_LINE_JOINT, // (SID_SVX_START+1110) - SID_ATTR_LINE_CAP, // (SID_SVX_START+1111) - 0 - }; - - GetView().GetViewFrame()->GetBindings().Invalidate(aInval); - } + pSh->StartAction(); + if(bHasMarked) + pView->SetAttrToMarked(*pDlg->GetOutputItemSet(), false); + else + pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), false); + pSh->EndAction(); + + static sal_uInt16 aInval[] = + { + SID_ATTR_LINE_STYLE, // ( SID_SVX_START + 169 ) + SID_ATTR_LINE_DASH, // ( SID_SVX_START + 170 ) + SID_ATTR_LINE_WIDTH, // ( SID_SVX_START + 171 ) + SID_ATTR_LINE_COLOR, // ( SID_SVX_START + 172 ) + SID_ATTR_LINE_START, // ( SID_SVX_START + 173 ) + SID_ATTR_LINE_END, // ( SID_SVX_START + 174 ) + SID_ATTR_LINE_TRANSPARENCE, // (SID_SVX_START+1107) + SID_ATTR_LINE_JOINT, // (SID_SVX_START+1110) + SID_ATTR_LINE_CAP, // (SID_SVX_START+1111) + 0 + }; + + GetView().GetViewFrame()->GetBindings().Invalidate(aInval); + } + + if (pDoc->IsChanged()) + GetShell().SetModified(); + else if (bChanged) + pDoc->SetChanged(); + }); } break; |