summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-01-17 19:17:30 +0100
committerJan Holesovsky <kendy@collabora.com>2018-01-18 15:18:30 +0100
commitcb84fdb368ed4b09d086681fe777a0f4c0f07f76 (patch)
treeb478e4e32bba8d19d3641b5e6885d31e00101698 /sd/source/ui
parentd3dbbdce4eb71ae848e7682374e011c4a6129b15 (diff)
lokdialog: Convert the Format -> ... -> Line... to async exec.
Change-Id: Ieaf440abf819d503d388a8b060dbf7fe6548db9e Reviewed-on: https://gerrit.libreoffice.org/48073 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/func/fuline.cxx40
-rw-r--r--sd/source/ui/view/drviews2.cxx2
2 files changed, 26 insertions, 16 deletions
diff --git a/sd/source/ui/func/fuline.cxx b/sd/source/ui/func/fuline.cxx
index cb4bd715581d..67ad104ecc31 100644
--- a/sd/source/ui/func/fuline.cxx
+++ b/sd/source/ui/func/fuline.cxx
@@ -60,23 +60,34 @@ rtl::Reference<FuPoor> FuLine::Create( ViewShell* pViewSh, ::sd::Window* pWin, :
void FuLine::DoExecute( SfxRequest& rReq )
{
- bool bHasMarked = mpView->AreObjectsMarked();
+ rReq.Ignore();
const SfxItemSet* pArgs = rReq.GetArgs();
-
- if( !pArgs )
+ if (pArgs)
{
- const SdrObject* pObj = nullptr;
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ mpViewShell->Cancel();
+ return;
+ }
+
+ const SdrObject* pObj = nullptr;
+ const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ if( rMarkList.GetMarkCount() == 1 )
+ pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+
+ std::unique_ptr<SfxItemSet> pNewAttr(new SfxItemSet( mpDoc->GetPool() ));
+ mpView->GetAttributes( *pNewAttr );
- std::unique_ptr<SfxItemSet> pNewAttr(new SfxItemSet( mpDoc->GetPool() ));
- mpView->GetAttributes( *pNewAttr );
+ bool bHasMarked = mpView->AreObjectsMarked();
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ VclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSvxLineTabDialog(nullptr,pNewAttr.get(),mpDoc,pObj,bHasMarked) : nullptr);
+ if (!pDlg)
+ {
+ mpViewShell->Cancel();
+ return;
+ }
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSvxLineTabDialog(nullptr,pNewAttr.get(),mpDoc,pObj,bHasMarked) : nullptr);
- if( pDlg && (pDlg->Execute() == RET_OK) )
+ pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+ if (nResult == RET_OK)
{
mpView->SetAttributes (*(pDlg->GetOutputItemSet ()));
@@ -95,9 +106,8 @@ void FuLine::DoExecute( SfxRequest& rReq )
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
}
- }
-
- rReq.Ignore ();
+ mpViewShell->Cancel();
+ }, pDlg);
}
void FuLine::Activate()
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 547348e22a53..4cbe90ccc623 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1367,7 +1367,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_ATTRIBUTES_LINE: // BASIC
{
SetCurrentFunction( FuLine::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
- Cancel();
+ // Cancel() called directly in FuTransform::Create()
}
break;