summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-09-30 10:49:12 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-10-06 13:33:45 +0200
commitca189b78bc9bfb0e6fad72e3374bf8e8408093f0 (patch)
tree5ec69ad21271b59559ea14ffaa2e2c050570ca9e /sw
parente1486b3d6658596e9dd27e712f5161553df08b1d (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>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/tabsh.cxx33
1 files changed, 19 insertions, 14 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 073fe280c924..10ad72aff6a0 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -987,23 +987,28 @@ void SwTableShell::Execute(SfxRequest &rReq)
else
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ SwWrtShell* pSh = &rSh;
const 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)
+ {
+ 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 )