summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/tabsh.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/shells/tabsh.cxx')
-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 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 )