diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-09-30 10:49:12 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-11-13 09:38:36 +0100 |
commit | 817a06d857bff5be35f8eb7bf830b75871556bc5 (patch) | |
tree | c6999a58916183489cb1652af74b48e9098134b0 /sw | |
parent | 0d3fb848a2995a0869c4c5fa8916214a513865ac (diff) |
Make Split Table Cell dialog async
Change-Id: I4efbb24f721aa50cc4dbbe78ae1e7e6087f8c876
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103670
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105594
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index ce54bdd02e31..247d5b4955d6 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -982,23 +982,28 @@ void SwTableShell::Execute(SfxRequest &rReq) else { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + SwWrtShell* pSh = &rSh; const tools::Long nMaxVert = rSh.GetAnyCurRect( CurRectType::Frame ).Width() / MINLAY; - ScopedVclPtr<SvxAbstractSplitTableDialog> pDlg(pFact->CreateSvxSplitTableDialog(GetView().GetFrameWeld(), rSh.IsTableVertical(), nMaxVert)); + VclPtr<SvxAbstractSplitTableDialog> pDlg(pFact->CreateSvxSplitTableDialog(GetView().GetFrameWeld(), rSh.IsTableVertical(), nMaxVert)); if(rSh.IsSplitVerticalByDefault()) pDlg->SetSplitVerticalByDefault(); - if( pDlg->Execute() == RET_OK ) - { - nCount = pDlg->GetCount(); - bHorizontal = pDlg->IsHorizontal(); - bProportional = pDlg->IsProportional(); - rReq.AppendItem( SfxInt32Item( FN_TABLE_SPLIT_CELLS, nCount ) ); - rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bHorizontal ) ); - rReq.AppendItem( SfxBoolItem( FN_PARAM_2, bProportional ) ); - - // tdf#60242: remember choice for next time - bool bVerticalWasChecked = !pDlg->IsHorizontal(); - rSh.SetSplitVerticalByDefault(bVerticalWasChecked); - } + pDlg->StartExecuteAsync([pDlg, pSh](int nResult) { + if (nResult == RET_OK) + { + tools::Long nCount2 = pDlg->GetCount(); + bool bHorizontal2 = pDlg->IsHorizontal(); + bool bProportional2 = pDlg->IsProportional(); + + // tdf#60242: remember choice for next time + bool bVerticalWasChecked = !pDlg->IsHorizontal(); + pSh->SetSplitVerticalByDefault(bVerticalWasChecked); + + if ( nCount2 > 1 ) + pSh->SplitTab(!bHorizontal2, static_cast< sal_uInt16 >( nCount2-1 ), bProportional2 ); + } + + pDlg->disposeOnce(); + }); } if ( nCount>1 ) |