diff options
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 7 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/inc/splittbl.hxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 18 | ||||
-rw-r--r-- | vcl/jsdialog/enabled.cxx | 3 |
5 files changed, 36 insertions, 9 deletions
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 6e9ebc873ab7..68135716fcb9 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -120,6 +120,11 @@ short AbstractSplitTableDialog_Impl::Execute() return m_xDlg->run(); } +bool AbstractSplitTableDialog_Impl::StartExecuteAsync(AsyncContext &rCtx) +{ + return weld::GenericDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); +} + short AbstractSwTableWidthDlg_Impl::Execute() { return m_xDlg->run(); @@ -978,7 +983,7 @@ VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwSortingDialog(we VclPtr<AbstractSplitTableDialog> SwAbstractDialogFactory_Impl::CreateSplitTableDialog(weld::Window *pParent, SwWrtShell &rSh) { - return VclPtr<AbstractSplitTableDialog_Impl>::Create(std::make_unique<SwSplitTableDlg>(pParent, rSh)); + return VclPtr<AbstractSplitTableDialog_Impl>::Create(std::make_shared<SwSplitTableDlg>(pParent, rSh)); } VclPtr<AbstractSwSelGlossaryDlg> SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg(weld::Window *pParent, const OUString &rShortName) diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index f97ff430c294..c0326249a15b 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -236,13 +236,14 @@ public: class AbstractSplitTableDialog_Impl : public AbstractSplitTableDialog // add for { - std::unique_ptr<SwSplitTableDlg> m_xDlg; + std::shared_ptr<SwSplitTableDlg> m_xDlg; public: - explicit AbstractSplitTableDialog_Impl(std::unique_ptr<SwSplitTableDlg> p) + explicit AbstractSplitTableDialog_Impl(std::shared_ptr<SwSplitTableDlg> p) : m_xDlg(std::move(p)) { } virtual short Execute() override; + virtual bool StartExecuteAsync(AsyncContext &rCtx) override; virtual SplitTable_HeadlineOption GetSplitMode() override; }; diff --git a/sw/source/uibase/inc/splittbl.hxx b/sw/source/uibase/inc/splittbl.hxx index 8c8891c1df1b..0311f08d4043 100644 --- a/sw/source/uibase/inc/splittbl.hxx +++ b/sw/source/uibase/inc/splittbl.hxx @@ -49,7 +49,17 @@ public: return nRet; } - SplitTable_HeadlineOption GetSplitMode() const { return m_nSplit; } + SplitTable_HeadlineOption GetSplitMode() const + { + auto nSplit = SplitTable_HeadlineOption::ContentCopy; + if (m_xBoxAttrCopyWithParaRB->get_active()) + nSplit = SplitTable_HeadlineOption::BoxAttrAllCopy; + else if (m_xBoxAttrCopyNoParaRB->get_active()) + nSplit = SplitTable_HeadlineOption::BoxAttrCopy; + else if (m_xBorderCopyRB->get_active()) + nSplit = SplitTable_HeadlineOption::BorderCopy; + return nSplit; + } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 01bd9389c152..ab93b027e69f 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -1082,10 +1082,20 @@ void SwTableShell::Execute(SfxRequest &rReq) else { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSplitTableDialog> pDlg(pFact->CreateSplitTableDialog(GetView().GetFrameWeld(), rSh)); - pDlg->Execute(); - rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, static_cast<sal_uInt16>(pDlg->GetSplitMode()) ) ); - bCallDone = true; + VclPtr<AbstractSplitTableDialog> pDlg(pFact->CreateSplitTableDialog(GetView().GetFrameWeld(), rSh)); + + SwWrtShell* pSh = &rSh; + + pDlg->StartExecuteAsync([pDlg, pSh](int nResult) { + if (nResult == RET_OK) + { + const auto aSplitMode = pDlg->GetSplitMode(); + pSh->SplitTable( aSplitMode ); + } + + pDlg->disposeOnce(); + }); + rReq.Ignore(); // We're already handling the request in our async bit } break; } diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index efb87ac0b9fe..3d830d07cf56 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -63,7 +63,8 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) || rUIFile == u"svx/ui/accessibilitycheckentry.ui" || rUIFile == u"cui/ui/widgettestdialog.ui" || rUIFile == u"modules/swriter/ui/contentcontroldlg.ui" - || rUIFile == u"modules/swriter/ui/contentcontrollistitemdlg.ui") + || rUIFile == u"modules/swriter/ui/contentcontrollistitemdlg.ui" + || rUIFile == u"modules/swriter/ui/splittable.ui") { return true; } |