sc/qa/uitest/calc_tests9/pivotTable.py | 6 ++-- sc/source/ui/attrdlg/scdlgfact.cxx | 14 ++++++++-- sc/source/ui/attrdlg/scdlgfact.hxx | 10 ++++--- sc/source/ui/dbgui/PivotLayoutTreeList.cxx | 26 +++++++++++-------- sc/source/ui/dbgui/PivotLayoutTreeListData.cxx | 34 ++++++++++++++----------- sc/source/ui/dbgui/pvfundlg.cxx | 9 ++++-- sc/source/ui/inc/PivotLayoutTreeList.hxx | 1 sc/source/ui/inc/pvfundlg.hxx | 4 ++ sfx2/source/appl/sfxhelp.cxx | 7 +++++ 9 files changed, 74 insertions(+), 37 deletions(-)
New commits: commit 6b51f618e3ddfc7350a25a1f2bde689fed735f36 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Feb 8 19:01:00 2021 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon Mar 8 11:51:02 2021 +0100 lok: send help even when document not ready Change-Id: I44855ef00a6c54a774965b3c951a4476ed5c8b01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110593 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Henry Castro <hcas...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112159 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 03afafcd4fa4..2e3e80680feb 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -719,6 +719,13 @@ static bool impl_showOnlineHelp( const OUString& rURL ) aHelpLink.toUtf8().getStr()); return true; } + else if (GetpApp()) + { + GetpApp()->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, + aHelpLink.toUtf8().getStr()); + return true; + } + return false; } commit c883303400158573cfd3dc2bc0ad59fa8f64ce48 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Dec 15 15:31:49 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon Mar 8 11:50:51 2021 +0100 pivot table: make subdialogs of pivot table dialog async Change-Id: I2c1b26ebe661a2f66bc7bf94e4f3ede2fc5e18b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107775 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112095 Tested-by: Jenkins diff --git a/sc/qa/uitest/calc_tests9/pivotTable.py b/sc/qa/uitest/calc_tests9/pivotTable.py index d85894bf9af6..2da282bb19d3 100644 --- a/sc/qa/uitest/calc_tests9/pivotTable.py +++ b/sc/qa/uitest/calc_tests9/pivotTable.py @@ -53,7 +53,7 @@ class pivotTable(UITestCase): self.assertEqual('true', get_state_as_dict(xEmptyLine)['Selected']) xOKBtn = dialog2.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) + xOKBtn.executeAction("CLICK", tuple()) def handle_options_dialog_second_time(dialog2): xEmptyLine = dialog2.getChild("emptyline") @@ -62,7 +62,7 @@ class pivotTable(UITestCase): self.assertEqual('false', get_state_as_dict(xEmptyLine)['Selected']) xCancelBtn = dialog2.getChild("cancel") - self.ui_test.close_dialog_through_button(xCancelBtn) + xCancelBtn.executeAction("CLICK", tuple()) def handle_options_dialog_third_time(dialog2): xEmptyLine = dialog2.getChild("emptyline") @@ -70,7 +70,7 @@ class pivotTable(UITestCase): self.assertEqual('true', get_state_as_dict(xEmptyLine)['Selected']) xOKBtn = dialog2.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) + xOKBtn.executeAction("CLICK", tuple()) self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ()), dialog_handler=handle_options_dialog_first_time) diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index b77f603540de..bc22a3fb443a 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -230,11 +230,21 @@ short AbstractScDPFunctionDlg_Impl::Execute() return m_xDlg->run(); } +bool AbstractScDPFunctionDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) +{ + return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); +} + short AbstractScDPSubtotalDlg_Impl::Execute() { return m_xDlg->run(); } +bool AbstractScDPSubtotalDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) +{ + return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); +} + short AbstractScDPNumGroupDlg_Impl::Execute() { return m_xDlg->run(); @@ -1123,7 +1133,7 @@ VclPtr<AbstractScDPFunctionDlg> ScAbstractDialogFactory_Impl::CreateScDPFunction const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData) { - return VclPtr<AbstractScDPFunctionDlg_Impl>::Create(std::make_unique<ScDPFunctionDlg>(pParent, rLabelVec, rLabelData, rFuncData)); + return VclPtr<AbstractScDPFunctionDlg_Impl>::Create(std::make_shared<ScDPFunctionDlg>(pParent, rLabelVec, rLabelData, rFuncData)); } VclPtr<AbstractScDPSubtotalDlg> ScAbstractDialogFactory_Impl::CreateScDPSubtotalDlg(weld::Widget* pParent, @@ -1132,7 +1142,7 @@ VclPtr<AbstractScDPSubtotalDlg> ScAbstractDialogFactory_Impl::CreateScDPSubtotal const ScPivotFuncData& rFuncData, const ScDPNameVec& rDataFields) { - return VclPtr<AbstractScDPSubtotalDlg_Impl>::Create(std::make_unique<ScDPSubtotalDlg>(pParent, rDPObj, rLabelData, rFuncData, rDataFields, true/*bEnableLayout*/)); + return VclPtr<AbstractScDPSubtotalDlg_Impl>::Create(std::make_shared<ScDPSubtotalDlg>(pParent, rDPObj, rLabelData, rFuncData, rDataFields, true/*bEnableLayout*/)); } VclPtr<AbstractScDPNumGroupDlg> ScAbstractDialogFactory_Impl::CreateScDPNumGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo& rInfo) diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index be01347f495f..f48e2b4f2cfd 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -465,26 +465,28 @@ public: class AbstractScDPFunctionDlg_Impl : public AbstractScDPFunctionDlg { - std::unique_ptr<ScDPFunctionDlg> m_xDlg; + std::shared_ptr<ScDPFunctionDlg> m_xDlg; public: - explicit AbstractScDPFunctionDlg_Impl(std::unique_ptr<ScDPFunctionDlg> p) + explicit AbstractScDPFunctionDlg_Impl(std::shared_ptr<ScDPFunctionDlg> p) : m_xDlg(std::move(p)) { } virtual short Execute() override; + virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; virtual PivotFunc GetFuncMask() const override; virtual css::sheet::DataPilotFieldReference GetFieldRef() const override; }; class AbstractScDPSubtotalDlg_Impl : public AbstractScDPSubtotalDlg { - std::unique_ptr<ScDPSubtotalDlg> m_xDlg; + std::shared_ptr<ScDPSubtotalDlg> m_xDlg; public: - explicit AbstractScDPSubtotalDlg_Impl(std::unique_ptr<ScDPSubtotalDlg> p) + explicit AbstractScDPSubtotalDlg_Impl(std::shared_ptr<ScDPSubtotalDlg> p) : m_xDlg(std::move(p)) { } virtual short Execute() override; + virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; virtual PivotFunc GetFuncMask() const override; virtual void FillLabelData( ScDPLabelData& rLabelData ) const override; }; diff --git a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx index b193acf9a251..65e055477276 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx @@ -41,27 +41,31 @@ IMPL_LINK_NOARG(ScPivotLayoutTreeList, DoubleClickHdl, weld::TreeView&, bool) ScItemValue* pCurrentItemValue = reinterpret_cast<ScItemValue*>(mxControl->get_id(nEntry).toInt64()); ScPivotFuncData& rCurrentFunctionData = pCurrentItemValue->maFunctionData; + SCCOL nCurrentColumn = rCurrentFunctionData.mnCol; - if (mpParent->IsDataElement(rCurrentFunctionData.mnCol)) + if (mpParent->IsDataElement(nCurrentColumn)) return true; - SCCOL nCurrentColumn = rCurrentFunctionData.mnCol; ScDPLabelData& rCurrentLabelData = mpParent->GetLabelData(nCurrentColumn); ScAbstractDialogFactory* pFactory = ScAbstractDialogFactory::Create(); - std::vector<ScDPName> aDataFieldNames; - mpParent->PushDataFieldNames(aDataFieldNames); + maDataFieldNames.clear(); + mpParent->PushDataFieldNames(maDataFieldNames); - ScopedVclPtr<AbstractScDPSubtotalDlg> pDialog( + VclPtr<AbstractScDPSubtotalDlg> pDialog( pFactory->CreateScDPSubtotalDlg(mxControl.get(), mpParent->maPivotTableObject, - rCurrentLabelData, rCurrentFunctionData, aDataFieldNames)); + rCurrentLabelData, rCurrentFunctionData, maDataFieldNames)); - if (pDialog->Execute() == RET_OK) - { - pDialog->FillLabelData(rCurrentLabelData); - rCurrentFunctionData.mnFuncMask = pDialog->GetFuncMask(); - } + pDialog->StartExecuteAsync([this, pDialog, pCurrentItemValue, nCurrentColumn](int nResult) { + if (nResult == RET_OK) + { + pDialog->FillLabelData(mpParent->GetLabelData(nCurrentColumn)); + pCurrentItemValue->maFunctionData.mnFuncMask = pDialog->GetFuncMask(); + } + + pDialog->disposeOnce(); + }); return true; } diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx index 0dad394bda80..6924a72a6773 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx @@ -87,27 +87,33 @@ IMPL_LINK_NOARG(ScPivotLayoutTreeListData, DoubleClickHdl, weld::TreeView&, bool ScAbstractDialogFactory* pFactory = ScAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractScDPFunctionDlg> pDialog( + VclPtr<AbstractScDPFunctionDlg> pDialog( pFactory->CreateScDPFunctionDlg(mxControl.get(), mpParent->GetLabelDataVector(), rCurrentLabelData, rCurrentFunctionData)); - if (pDialog->Execute() == RET_OK) - { - rCurrentFunctionData.mnFuncMask = pDialog->GetFuncMask(); - rCurrentLabelData.mnFuncMask = pDialog->GetFuncMask(); + pDialog->StartExecuteAsync([this, pDialog, pCurrentItemValue, + rCurrentLabelData, nEntry](int nResult) mutable { + if (nResult == RET_OK) + { + ScPivotFuncData& rFunctionData = pCurrentItemValue->maFunctionData; + rFunctionData.mnFuncMask = pDialog->GetFuncMask(); + rCurrentLabelData.mnFuncMask = pDialog->GetFuncMask(); - rCurrentFunctionData.maFieldRef = pDialog->GetFieldRef(); + rFunctionData.maFieldRef = pDialog->GetFieldRef(); - ScDPLabelData& rDFData = mpParent->GetLabelData(rCurrentFunctionData.mnCol); + ScDPLabelData& rDFData = mpParent->GetLabelData(rFunctionData.mnCol); - AdjustDuplicateCount(pCurrentItemValue); + AdjustDuplicateCount(pCurrentItemValue); - OUString sDataItemName = lclCreateDataItemName( - rCurrentFunctionData.mnFuncMask, - rDFData.maName, - rCurrentFunctionData.mnDupCount); + OUString sDataItemName = lclCreateDataItemName( + rFunctionData.mnFuncMask, + rDFData.maName, + rFunctionData.mnDupCount); - mxControl->set_text(nEntry, sDataItemName); - } + mxControl->set_text(nEntry, sDataItemName); + } + + pDialog->disposeOnce(); + }); return true; } diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 431ef89407de..481c1b738f92 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -565,9 +565,12 @@ IMPL_LINK(ScDPSubtotalDlg, ClickHdl, weld::Button&, rBtn, void) { if (&rBtn == mxBtnOptions.get()) { - ScDPSubtotalOptDlg aDlg(m_xDialog.get(), mrDPObj, maLabelData, mrDataFields, mbEnableLayout); - if (aDlg.run() == RET_OK) - aDlg.FillLabelData(maLabelData); + mxOptionsDlg = std::make_shared<ScDPSubtotalOptDlg>(m_xDialog.get(), mrDPObj, maLabelData, mrDataFields, mbEnableLayout); + + weld::DialogController::runAsync(mxOptionsDlg, [this](int nResult) { + if (nResult == RET_OK) + mxOptionsDlg->FillLabelData(maLabelData); + }); } } diff --git a/sc/source/ui/inc/PivotLayoutTreeList.hxx b/sc/source/ui/inc/PivotLayoutTreeList.hxx index 4d15053c0e31..1682b929eb4c 100644 --- a/sc/source/ui/inc/PivotLayoutTreeList.hxx +++ b/sc/source/ui/inc/PivotLayoutTreeList.hxx @@ -18,6 +18,7 @@ class ScPivotLayoutTreeList : public ScPivotLayoutTreeListBase { private: std::vector<std::unique_ptr<ScItemValue>> maItemValues; + std::vector<ScDPName> maDataFieldNames; DECL_LINK(KeyInputHdl, const KeyEvent&, bool); DECL_LINK(DoubleClickHdl, weld::TreeView&, bool); diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx index 4a60ec93e18a..6f093809660c 100644 --- a/sc/source/ui/inc/pvfundlg.hxx +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -92,6 +92,8 @@ private: bool mbEmptyItem; /// true = Empty base item in listbox. }; +class ScDPSubtotalOptDlg; + class ScDPSubtotalDlg : public weld::GenericDialogController { public: @@ -127,6 +129,8 @@ private: std::unique_ptr<weld::Button> mxBtnOk; std::unique_ptr<weld::Button> mxBtnCancel; std::unique_ptr<weld::Button> mxBtnOptions; + + std::shared_ptr<ScDPSubtotalOptDlg> mxOptionsDlg; }; class ScDPSubtotalOptDlg : public weld::GenericDialogController _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits