[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 25 commits - desktop/source include/tools include/vcl sc/source sc/uiconfig tools/source vcl/inc vcl/jsdialog vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 7 18:56:55 UTC 2021


 desktop/source/lib/init.cxx                                    |    1 
 include/tools/json_writer.hxx                                  |    2 
 include/vcl/jsdialog/executor.hxx                              |    5 
 include/vcl/layout.hxx                                         |    2 
 include/vcl/toolkit/fixed.hxx                                  |    1 
 include/vcl/toolkit/svtabbx.hxx                                |    2 
 include/vcl/weld.hxx                                           |    2 
 sc/source/ui/StatisticsDialogs/SamplingDialog.cxx              |   15 
 sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx |   15 
 sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx |   15 
 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/dapitype.cxx                                |   17 
 sc/source/ui/dbgui/pvfundlg.cxx                                |    9 
 sc/source/ui/inc/PivotLayoutTreeList.hxx                       |    1 
 sc/source/ui/inc/SamplingDialog.hxx                            |    3 
 sc/source/ui/inc/StatisticsInputOutputDialog.hxx               |    3 
 sc/source/ui/inc/StatisticsTwoVariableDialog.hxx               |    3 
 sc/source/ui/inc/dapitype.hxx                                  |    3 
 sc/source/ui/inc/pvfundlg.hxx                                  |    4 
 sc/source/ui/view/gridwin.cxx                                  |   27 -
 sc/source/ui/view/tabvwshc.cxx                                 |    4 
 sc/uiconfig/scalc/ui/notebookbar.ui                            |  215 ++++++++--
 sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui                 |   28 +
 tools/source/misc/json_writer.cxx                              |    2 
 vcl/inc/jsdialog/jsdialogbuilder.hxx                           |    9 
 vcl/jsdialog/executor.cxx                                      |   12 
 vcl/jsdialog/jsdialogbuilder.cxx                               |   84 ++-
 vcl/source/control/fixed.cxx                                   |    8 
 vcl/source/treelist/svtabbx.cxx                                |   34 +
 vcl/source/window/builder.cxx                                  |   23 +
 vcl/source/window/dialog.cxx                                   |   10 
 vcl/source/window/dockmgr.cxx                                  |    4 
 vcl/source/window/layout.cxx                                   |   39 +
 vcl/source/window/window.cxx                                   |    4 
 37 files changed, 568 insertions(+), 122 deletions(-)

New commits:
commit c66ec87fed8ec5b5a321c71251165974c0a77dca
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 15 15:31:49 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:32:32 2021 +0200

    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 <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112095
    Tested-by: Jenkins

diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 00b62493743f..77bf6c4e9e07 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -228,11 +228,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();
@@ -1116,7 +1126,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,
@@ -1125,7 +1135,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 088dae2b5547..d93b6ddcf89f 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -466,26 +466,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 141458507a94..d6b3f6d980a9 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
@@ -85,27 +85,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 5af5a68befc7..1b780164241c 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -540,9 +540,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 ab1ce9c93ae7..3dfcc0551f19 100644
--- a/sc/source/ui/inc/PivotLayoutTreeList.hxx
+++ b/sc/source/ui/inc/PivotLayoutTreeList.hxx
@@ -19,6 +19,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 4c74ceb4e04e..237b6c3f3cf9 100644
--- a/sc/source/ui/inc/pvfundlg.hxx
+++ b/sc/source/ui/inc/pvfundlg.hxx
@@ -89,6 +89,8 @@ private:
     bool                 mbEmptyItem;        /// true = Empty base item in listbox.
 };
 
+class ScDPSubtotalOptDlg;
+
 class ScDPSubtotalDlg : public weld::GenericDialogController
 {
 public:
@@ -122,6 +124,8 @@ private:
     std::unique_ptr<weld::CheckButton>   mxCbShowAll;
     std::unique_ptr<weld::Button>        mxBtnOk;
     std::unique_ptr<weld::Button>        mxBtnOptions;
+
+    std::shared_ptr<ScDPSubtotalOptDlg> mxOptionsDlg;
 };
 
 class ScDPSubtotalOptDlg : public weld::GenericDialogController
commit c2681dfc109efded199a235c05f63b6a9e188d96
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 15 15:32:18 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:31:28 2021 +0200

    jsdialog: enable Data field dialogs
    
    Change-Id: I87a1446737f7d73b4d8b5b03590a0fcd3236c97c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107776
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109097
    Tested-by: Jenkins

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 90b66ccb6e19..3ff956be4395 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -199,7 +199,11 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString
             || rUIFile == "modules/scalc/ui/ttestdialog.ui"
             || rUIFile == "modules/scalc/ui/ztestdialog.ui"
             || rUIFile == "modules/scalc/ui/chisquaretestdialog.ui"
-            || rUIFile == "modules/scalc/ui/fourieranalysisdialog.ui")
+            || rUIFile == "modules/scalc/ui/fourieranalysisdialog.ui"
+            || rUIFile == "uui/ui/macrowarnmedium.ui"
+            || rUIFile == "modules/scalc/ui/datafielddialog.ui"
+            || rUIFile == "modules/scalc/ui/pivotfielddialog.ui"
+            || rUIFile == "modules/scalc/ui/datafieldoptionsdialog.ui")
         {
             bUseJSBuilder = true;
         }
commit 894fe1780f6b0b91ce35e6d073aca161fea86406
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 15 11:02:35 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:30:35 2021 +0200

    online: Don't lock new views if ref dialog is opened
    
    When one of ref dialogs was opened in one view
    and then new user opened new view - the new one
    was locked. Don't do that for all dialogs, not only
    function wizard.
    
    Was partially fixed for one dialog in:
    48a216cd16b306f4d2d7edc374ceb4670d177db8
    
    Change-Id: I3b37aa182fd2096a5c989dfbdeb6c245985706d7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107743
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108967
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 6cafc717b992..208623b1c4cb 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -124,7 +124,9 @@ std::shared_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
         //  the dialog has been opened in a different view
         //  -> lock the dispatcher for this view (modal mode)
 
-        GetViewData().GetDispatcher().Lock( true );    // lock is reset when closing dialog
+        if (!comphelper::LibreOfficeKit::isActive())
+            GetViewData().GetDispatcher().Lock( true );    // lock is reset when closing dialog
+
         return nullptr;
     }
 
commit 3709ecb16cae9c589bca440d2aac7151ea399ead
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 15 13:56:35 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:30:23 2021 +0200

    online: make buttons work in statistics dialogs
    
    Change-Id: Ie4810b87ea5ce4fc7b3e98afdd37bcd903e2907c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107755
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108978
    Tested-by: Jenkins

diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
index 1dc4a3a00fd1..8a5e66753cf6 100644
--- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
@@ -46,6 +46,7 @@ ScSamplingDialog::ScSamplingDialog(SfxBindings* pSfxBindings, SfxChildWindow* pC
     , mxKeepOrder(m_xBuilder->weld_check_button("keep-order"))
     , mxPeriodicMethodRadio(m_xBuilder->weld_radio_button("periodic-method-radio"))
     , mxButtonOk(m_xBuilder->weld_button("ok"))
+    , mxButtonCancel(m_xBuilder->weld_button("cancel"))
 {
     mxInputRangeEdit->SetReferences(this, mxInputRangeLabel.get());
     mxInputRangeButton->SetReferences(this, mxInputRangeEdit.get());
@@ -63,7 +64,8 @@ ScSamplingDialog::~ScSamplingDialog()
 
 void ScSamplingDialog::Init()
 {
-    mxButtonOk->connect_clicked( LINK( this, ScSamplingDialog, OkClicked ) );
+    mxButtonCancel->connect_clicked( LINK( this, ScSamplingDialog, ButtonClicked ) );
+    mxButtonOk->connect_clicked( LINK( this, ScSamplingDialog, ButtonClicked ) );
     mxButtonOk->set_sensitive(false);
 
     Link<formula::RefEdit&,void> aEditLink = LINK( this, ScSamplingDialog, GetEditFocusHandler );
@@ -417,10 +419,15 @@ IMPL_LINK(ScSamplingDialog, GetButtonFocusHandler, formula::RefButton&, rCtrl, v
 }
 
 
-IMPL_LINK_NOARG(ScSamplingDialog, OkClicked, weld::Button&, void)
+IMPL_LINK(ScSamplingDialog, ButtonClicked, weld::Button&, rButton, void)
 {
-    PerformSampling();
-    response(RET_OK);
+    if (&rButton == mxButtonOk.get())
+    {
+        PerformSampling();
+        response(RET_OK);
+    }
+    else
+        response(RET_CANCEL);
 }
 
 IMPL_LINK_NOARG(ScSamplingDialog, LoseEditFocusHandler, formula::RefEdit&, void)
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
index d2d53b23244f..d275d79c6524 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
@@ -65,6 +65,7 @@ ScStatisticsInputOutputDialog::ScStatisticsInputOutputDialog(
     , mOutputAddress(ScAddress::INITIALIZE_INVALID)
     , mGroupedBy(BY_COLUMN)
     , mxButtonOk(m_xBuilder->weld_button("ok"))
+    , mxButtonCancel(m_xBuilder->weld_button("cancel"))
     , mpActiveEdit(nullptr)
     , mCurrentAddress(rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo())
     , mDialogLostFocus(false)
@@ -85,7 +86,8 @@ ScStatisticsInputOutputDialog::~ScStatisticsInputOutputDialog()
 
 void ScStatisticsInputOutputDialog::Init()
 {
-    mxButtonOk->connect_clicked( LINK( this, ScStatisticsInputOutputDialog, OkClicked ) );
+    mxButtonCancel->connect_clicked( LINK( this, ScStatisticsInputOutputDialog, ButtonClicked ) );
+    mxButtonOk->connect_clicked( LINK( this, ScStatisticsInputOutputDialog, ButtonClicked ) );
     mxButtonOk->set_sensitive(false);
 
     Link<formula::RefEdit&,void> aEditLink = LINK( this, ScStatisticsInputOutputDialog, GetEditFocusHandler );
@@ -167,10 +169,15 @@ void ScStatisticsInputOutputDialog::SetReference( const ScRange& rReferenceRange
     ValidateDialogInput();
 }
 
-IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, OkClicked, weld::Button&, void )
+IMPL_LINK( ScStatisticsInputOutputDialog, ButtonClicked, weld::Button&, rButton, void )
 {
-    CalculateInputAndWriteToOutput();
-    response(RET_OK);
+    if (&rButton == mxButtonOk.get())
+    {
+        CalculateInputAndWriteToOutput();
+        response(RET_OK);
+    }
+    else
+        response(RET_CANCEL);
 }
 
 IMPL_LINK(ScStatisticsInputOutputDialog, GetEditFocusHandler, formula::RefEdit&, rCtrl, void)
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
index 22f802fc7863..df93a0533b1d 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
@@ -39,6 +39,7 @@ ScStatisticsTwoVariableDialog::ScStatisticsTwoVariableDialog(
     , mOutputAddress(ScAddress::INITIALIZE_INVALID)
     , mGroupedBy(BY_COLUMN)
     , mxButtonOk(m_xBuilder->weld_button("ok"))
+    , mxButtonCancel(m_xBuilder->weld_button("cancel"))
     , mxGroupByColumnsRadio(m_xBuilder->weld_radio_button("groupedby-columns-radio"))
     , mxGroupByRowsRadio(m_xBuilder->weld_radio_button("groupedby-rows-radio"))
     , mpActiveEdit(nullptr)
@@ -64,7 +65,8 @@ ScStatisticsTwoVariableDialog::~ScStatisticsTwoVariableDialog()
 
 void ScStatisticsTwoVariableDialog::Init()
 {
-    mxButtonOk->connect_clicked( LINK( this, ScStatisticsTwoVariableDialog, OkClicked ) );
+    mxButtonCancel->connect_clicked( LINK( this, ScStatisticsTwoVariableDialog, ButtonClicked ) );
+    mxButtonOk->connect_clicked( LINK( this, ScStatisticsTwoVariableDialog, ButtonClicked ) );
     mxButtonOk->set_sensitive(false);
 
     Link<formula::RefEdit&,void> aEditLink = LINK( this, ScStatisticsTwoVariableDialog, GetEditFocusHandler );
@@ -179,10 +181,15 @@ void ScStatisticsTwoVariableDialog::SetReference( const ScRange& rReferenceRange
     ValidateDialogInput();
 }
 
-IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, OkClicked, weld::Button&, void )
+IMPL_LINK( ScStatisticsTwoVariableDialog, ButtonClicked, weld::Button&, rButton, void )
 {
-    CalculateInputAndWriteToOutput();
-    response(RET_OK);
+    if (&rButton == mxButtonOk.get())
+    {
+        CalculateInputAndWriteToOutput();
+        response(RET_OK);
+    }
+    else
+        response(RET_CANCEL);
 }
 
 IMPL_LINK(ScStatisticsTwoVariableDialog, GetEditFocusHandler, formula::RefEdit&, rCtrl, void)
diff --git a/sc/source/ui/inc/SamplingDialog.hxx b/sc/source/ui/inc/SamplingDialog.hxx
index ec2e63a67be1..a735336d7994 100644
--- a/sc/source/ui/inc/SamplingDialog.hxx
+++ b/sc/source/ui/inc/SamplingDialog.hxx
@@ -64,6 +64,7 @@ private:
     std::unique_ptr<weld::RadioButton> mxPeriodicMethodRadio;
 
     std::unique_ptr<weld::Button> mxButtonOk;
+    std::unique_ptr<weld::Button> mxButtonCancel;
 
     void Init();
     void GetRangeFromSelection();
@@ -75,7 +76,7 @@ private:
     ScRange PerformRandomSamplingKeepOrder(ScDocShell* pDocShell);
     ScRange PerformPeriodicSampling(ScDocShell* pDocShell);
 
-    DECL_LINK( OkClicked, weld::Button&, void );
+    DECL_LINK( ButtonClicked, weld::Button&, void );
     DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void );
     DECL_LINK( GetButtonFocusHandler, formula::RefButton&, void );
     DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void );
diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
index a1685127d550..b3a03415eadd 100644
--- a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
+++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
@@ -69,6 +69,7 @@ protected:
 private:
     // Widgets
     std::unique_ptr<weld::Button>       mxButtonOk;
+    std::unique_ptr<weld::Button>       mxButtonCancel;
 
     formula::RefEdit*      mpActiveEdit;
     ScAddress              mCurrentAddress;
@@ -78,7 +79,7 @@ private:
     void GetRangeFromSelection();
 
     DECL_LINK( GroupByChanged, weld::ToggleButton&, void );
-    DECL_LINK( OkClicked, weld::Button&, void );
+    DECL_LINK( ButtonClicked, weld::Button&, void );
     DECL_LINK( GetEditFocusHandler,  formula::RefEdit&, void );
     DECL_LINK( GetButtonFocusHandler,  formula::RefButton&, void );
     DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void );
diff --git a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
index 4b34284a1621..173a0a9c14ce 100644
--- a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
+++ b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
@@ -68,6 +68,7 @@ protected:
 private:
     // Widgets
     std::unique_ptr<weld::Button> mxButtonOk;
+    std::unique_ptr<weld::Button> mxButtonCancel;
 
     std::unique_ptr<weld::RadioButton> mxGroupByColumnsRadio;
     std::unique_ptr<weld::RadioButton> mxGroupByRowsRadio;
@@ -80,7 +81,7 @@ private:
     void GetRangeFromSelection();
 
     DECL_LINK( GroupByChanged, weld::ToggleButton&, void );
-    DECL_LINK( OkClicked, weld::Button&, void );
+    DECL_LINK( ButtonClicked, weld::Button&, void );
     DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void );
     DECL_LINK( GetButtonFocusHandler, formula::RefButton&, void );
     DECL_LINK( LoseEditFocusHandler, formula::RefEdit&, void );
commit 91707e7192ba856565e77d8a433f4bbdb3e52654
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Dec 11 11:37:49 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:30:08 2021 +0200

    jsdialog: export alignment type
    
    Change-Id: I846f51d522fb0639b22148c73563b177d091178c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107589
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108412
    Tested-by: Jenkins

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index cbcb6d2373f0..5c4a60c4f5e8 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -461,6 +461,7 @@ public:
     {
     }
     virtual bool set_property(const OString &rKey, const OUString &rValue) override;
+    virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
 private:
     virtual Size calculateRequisition() const override;
     virtual void setAllocation(const Size &rAllocation) override;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 31134e72e126..63d5d1536772 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1580,6 +1580,12 @@ bool VclAlignment::set_property(const OString &rKey, const OUString &rValue)
     return true;
 }
 
+void VclAlignment::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
+{
+    VclContainer::DumpAsPropertyTree(rJsonWriter);
+    rJsonWriter.put("type", "alignment");
+}
+
 class DisclosureButton final : public CheckBox
 {
     virtual void ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) override
commit 12ec237cc64cb4cdec28f172461446dd67a2a0e0
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 8 16:59:12 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:29:52 2021 +0200

    jsdialog: enable statistics dialogs
    
    Change-Id: Ie139192755baf925a864e26e579503b68f6ac65b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107587
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108409
    Tested-by: Jenkins

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 695cdb811bbb..90b66ccb6e19 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -185,7 +185,21 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString
         if (rUIFile == "modules/scalc/ui/pivottablelayoutdialog.ui"
             || rUIFile == "modules/scalc/ui/selectsource.ui"
             || rUIFile == "modules/scalc/ui/managenamesdialog.ui"
-            || rUIFile == "modules/scalc/ui/definename.ui")
+            || rUIFile == "modules/scalc/ui/definename.ui"
+            || rUIFile == "cui/ui/macroselectordialog.ui"
+            || rUIFile == "modules/scalc/ui/correlationdialog.ui"
+            || rUIFile == "modules/scalc/ui/samplingdialog.ui"
+            || rUIFile == "modules/scalc/ui/descriptivestatisticsdialog.ui"
+            || rUIFile == "modules/scalc/ui/analysisofvariancedialog.ui"
+            || rUIFile == "modules/scalc/ui/covariancedialog.ui"
+            || rUIFile == "modules/scalc/ui/exponentialsmoothingdialog.ui"
+            || rUIFile == "modules/scalc/ui/movingaveragedialog.ui"
+            || rUIFile == "modules/scalc/ui/regressiondialog.ui"
+            || rUIFile == "modules/scalc/ui/ttestdialog.ui"
+            || rUIFile == "modules/scalc/ui/ttestdialog.ui"
+            || rUIFile == "modules/scalc/ui/ztestdialog.ui"
+            || rUIFile == "modules/scalc/ui/chisquaretestdialog.ui"
+            || rUIFile == "modules/scalc/ui/fourieranalysisdialog.ui")
         {
             bUseJSBuilder = true;
         }
commit 28fbf3148e9b1ee471f48e15c8f1edd099e7d761
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 10 14:39:58 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:28:41 2021 +0200

    notebookbar: add named ranges management
    
    Change-Id: I63c2589cd9ab7bfa3a10ea7f2d4729e1f715c92f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107531
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108657
    Tested-by: Jenkins

diff --git a/sc/uiconfig/scalc/ui/notebookbar.ui b/sc/uiconfig/scalc/ui/notebookbar.ui
index 0ec448fbd7e3..3c2d2d1efaff 100644
--- a/sc/uiconfig/scalc/ui/notebookbar.ui
+++ b/sc/uiconfig/scalc/ui/notebookbar.ui
@@ -8388,6 +8388,88 @@
                         <property name="position">14</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="VclOptionalBox" id="Data-Section-NamedRanges">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="valign">center</property>
+                        <property name="vexpand">True</property>
+                        <child>
+                          <object class="GtkBox" id="GroupB561">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="valign">center</property>
+                            <property name="vexpand">True</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="sfxlo-NotebookbarToolBox" id="LeftParaMargin161">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="valign">center</property>
+                                <property name="vexpand">True</property>
+                                <property name="toolbar_style">both-horiz</property>
+                                <property name="show_arrow">False</property>
+                                <child>
+                                  <object class="GtkToolButton" id="Data-AddName">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="action_name">.uno:AddName</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="homogeneous">True</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="sfxlo-NotebookbarToolBox" id="belowspacing181">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="valign">center</property>
+                                <property name="vexpand">True</property>
+                                <property name="toolbar_style">both-horiz</property>
+                                <property name="show_arrow">False</property>
+                                <child>
+                                  <object class="GtkToolButton" id="Data-DefineName">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="action_name">.uno:DefineName</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="homogeneous">True</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <style>
+                          <class name="priority-4"/>
+                        </style>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">14</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="VclOptionalBox" id="Data-Section-TextToColumn">
                         <property name="visible">True</property>
commit 788488a2a02204a5fd70620384eb00e2ac0aa9f3
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 10 15:35:53 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:28:31 2021 +0200

    jsdialog: export dialog id
    
    Change-Id: I406d64ec8e19661ab258908e29245bc7da245b7b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107558
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108408
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 8d84e4631ed9..e502c33caeb1 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1640,6 +1640,11 @@ void Dialog::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
         if (!pActionArea->IsVisible())
             rJsonWriter.put("collapsed", "true");
     }
+
+    OUString sDialogId = OStringToOUString(GetHelpId(), RTL_TEXTENCODING_ASCII_US);
+    sal_Int32 nStartPos = sDialogId.lastIndexOf('/');
+    nStartPos = nStartPos >= 0 ? nStartPos + 1 : 0;
+    rJsonWriter.put("dialogid", sDialogId.copy(nStartPos));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7f5db2b6097b965efc2dc2ae8ef19e2b4b9beac6
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 10 10:47:35 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:28:21 2021 +0200

    pivot table: add separator between list views
    
    Change-Id: If4cb3735014bfde6124fb1173fb03aa950c3b77a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107519
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108968
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui
index 030d4061e367..482f70f63d0d 100644
--- a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui
+++ b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui
@@ -481,6 +481,32 @@
                     <property name="position">0</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkBox" id="boxline">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="vexpand">True</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkSeparator" id="separator1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="orientation">vertical</property>
+                      </object>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
                 <child>
                   <object class="GtkBox" id="box3">
                     <property name="visible">True</property>
@@ -559,7 +585,7 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">1</property>
+                    <property name="position">2</property>
                   </packing>
                 </child>
               </object>
commit 48b8233900ece078058a2ba37fe5b80bfecde994
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 10 11:38:57 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:28:09 2021 +0200

    jsdialog: dump separator line
    
    Change-Id: I2c9954a7f0ec3df3652733af54ea4b0f84af25e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107520
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108407
    Tested-by: Jenkins

diff --git a/include/vcl/toolkit/fixed.hxx b/include/vcl/toolkit/fixed.hxx
index f3ce68b71444..90d19afe43bc 100644
--- a/include/vcl/toolkit/fixed.hxx
+++ b/include/vcl/toolkit/fixed.hxx
@@ -62,6 +62,7 @@ public:
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
 
     virtual Size    GetOptimalSize() const override;
+    virtual void    DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override;
 };
 
 class VCL_DLLPUBLIC FixedBitmap final : public Control
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index bb9831dcf425..952a0dfd0574 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -25,6 +25,7 @@
 #include <comphelper/string.hxx>
 #include <sal/log.hxx>
 #include <controldata.hxx>
+#include <tools/json_writer.hxx>
 
 #define FIXEDLINE_TEXT_BORDER    4
 
@@ -656,6 +657,13 @@ Size FixedLine::GetOptimalSize() const
     return CalcWindowSize( FixedText::CalcMinimumTextSize ( this ) );
 }
 
+void FixedLine::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
+{
+    Control::DumpAsPropertyTree(rJsonWriter);
+    rJsonWriter.put("type", "separator");
+    rJsonWriter.put("orientation", (GetStyle() & WB_VERT) ? "vertical" : "horizontal");
+}
+
 void FixedBitmap::ImplInit( vcl::Window* pParent, WinBits nStyle )
 {
     nStyle = ImplInitStyle( nStyle );
commit 0d3dd55a51063d90e55a09815fca3f7d0b8aaa2c
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 9 06:28:34 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:27:58 2021 +0200

    jsdialog: handle value change for spinfields
    
    Change-Id: Ie9ef1017b959f5ef42abe6de4ac18e077d1ceb1e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107446
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108397
    Tested-by: Jenkins

diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx
index 038b86b30f64..1e2a0806e3e9 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -40,6 +40,11 @@ public:
     {
         rDrawingArea.click(rPos);
     }
+
+    static void trigger_value_changed(weld::SpinButton& rSpinButton)
+    {
+        rSpinButton.signal_value_changed();
+    }
 };
 
 namespace jsdialog
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 28b851801a12..59f404dab8d2 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1570,6 +1570,8 @@ public:
 
 class VCL_DLLPUBLIC SpinButton : virtual public Entry
 {
+    friend class ::LOKTrigger;
+
 protected:
     Link<SpinButton&, void> m_aValueChangedHdl;
     Link<SpinButton&, void> m_aOutputHdl;
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 743eed2d565d..6cd65feb1d6a 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -128,14 +128,24 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
             auto pSpinField = dynamic_cast<weld::SpinButton*>(pWidget);
             if (pSpinField)
             {
+                if (sAction == "change")
+                {
+                    OString sValue = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
+                    int nValue = std::atoi(sValue.getStr());
+                    pSpinField->set_value(nValue);
+                    LOKTrigger::trigger_value_changed(*pSpinField);
+                    return true;
+                }
                 if (sAction == "plus")
                 {
                     pSpinField->set_value(pSpinField->get_value() + 1);
+                    LOKTrigger::trigger_value_changed(*pSpinField);
                     return true;
                 }
                 else if (sAction == "minus")
                 {
                     pSpinField->set_value(pSpinField->get_value() - 1);
+                    LOKTrigger::trigger_value_changed(*pSpinField);
                     return true;
                 }
             }
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 08e66eedb6f5..9e77a939ce2f 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -792,7 +792,7 @@ JSSpinButton::JSSpinButton(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Wind
 void JSSpinButton::set_value(int value)
 {
     SalInstanceSpinButton::set_value(value);
-    notifyDialogState();
+    notifyDialogState(true); // if input is limited we can receive the same JSON
 }
 
 JSMessageDialog::JSMessageDialog(::MessageDialog* pDialog, VclPtr<vcl::Window> aContentWindow,
commit b4cf2800232c3a94ae0af7e2c137d537e880d832
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 9 06:51:51 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:27:46 2021 +0200

    jsdialog: export column merging property in grid
    
    Change-Id: I660e7ae6b2cce41212aee37d23b37a0cb167a14c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107447
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108396
    Tested-by: Jenkins

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 5e079161e492..9b8ae89b7433 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3346,6 +3346,10 @@ void Window::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
                     rJsonWriter.put("left", nLeft);
                     rJsonWriter.put("top", nTop);
                 }
+
+                sal_Int32 nWidth = pChild->get_grid_width();
+                if (nWidth > 1)
+                    rJsonWriter.put("width", nWidth);
             }
             pChild = pChild->mpWindowImpl->mpNext;
         }
commit b98a8ce847db246e8533a0a09e22f371b898d037
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 9 07:58:53 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:27:33 2021 +0200

    jsdialog: dump buttonbox properties
    
    Change-Id: I638169db902961cff58a415b009f7412cd8b274a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107449
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108395
    Tested-by: Jenkins

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 34d7e9a023c9..cbcb6d2373f0 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -214,6 +214,7 @@ public:
     {
     }
     virtual bool set_property(const OString &rKey, const OUString &rValue) override;
+    virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
 protected:
     virtual Size calculateRequisition() const override;
     virtual void setAllocation(const Size &rAllocation) override;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index e7c37c55a6e3..31134e72e126 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -692,6 +692,39 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
     }
 }
 
+void VclButtonBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
+{
+    VclBox::DumpAsPropertyTree(rJsonWriter);
+    rJsonWriter.put("type", "buttonbox");
+
+    switch(m_eLayoutStyle)
+    {
+        case VclButtonBoxStyle::Default:
+            rJsonWriter.put("layoutstyle", "default");
+            break;
+
+        case VclButtonBoxStyle::Spread:
+            rJsonWriter.put("layoutstyle", "spread");
+            break;
+
+        case VclButtonBoxStyle::Edge:
+            rJsonWriter.put("layoutstyle", "edge");
+            break;
+
+        case VclButtonBoxStyle::Center:
+            rJsonWriter.put("layoutstyle", "center");
+            break;
+
+        case VclButtonBoxStyle::Start:
+            rJsonWriter.put("layoutstyle", "start");
+            break;
+
+        case VclButtonBoxStyle::End:
+            rJsonWriter.put("layoutstyle", "end");
+            break;
+    }
+}
+
 namespace {
 
 struct ButtonOrder
commit af69fea722d12db5c14facd01b8385e6747ea3a3
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 8 10:37:05 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:27:17 2021 +0200

    jsdialog: enable define/manage named ranges dialogs
    
    Change-Id: I6783ec5be11255608e694e43a32ec3c6d4de468e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107394
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107464
    Tested-by: Jenkins

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 626776a91b18..695cdb811bbb 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -183,7 +183,9 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString
         }
 
         if (rUIFile == "modules/scalc/ui/pivottablelayoutdialog.ui"
-            || rUIFile == "modules/scalc/ui/selectsource.ui")
+            || rUIFile == "modules/scalc/ui/selectsource.ui"
+            || rUIFile == "modules/scalc/ui/managenamesdialog.ui"
+            || rUIFile == "modules/scalc/ui/definename.ui")
         {
             bUseJSBuilder = true;
         }
commit 353cc3d50d1541474f960057985e7f589ca414e5
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 8 11:21:34 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:26:06 2021 +0200

    jsdialog: dump collapsed state for dialog
    
    Change-Id: I69b154b3fd2819c68194eaee9ed785e00dc386f5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107401
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108393
    Tested-by: Jenkins

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 9a237ba5df9f..8d84e4631ed9 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1635,6 +1635,11 @@ void Dialog::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
 {
     SystemWindow::DumpAsPropertyTree(rJsonWriter);
     rJsonWriter.put("title", GetText());
+    if (vcl::Window* pActionArea = get_action_area())
+    {
+        if (!pActionArea->IsVisible())
+            rJsonWriter.put("collapsed", "true");
+    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit f49bb5344c0d04e7d654dc2f057cd72898612c82
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Dec 7 09:49:01 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:25:56 2021 +0200

    jsdialog: change selection not merge
    
    Change-Id: Ie76320aef21ca2c94be608ec06726ac0af6a66f4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107335
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108392
    Tested-by: Jenkins

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index b2103fbe865f..743eed2d565d 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -204,7 +204,9 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
                         = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
                     int nRow = std::atoi(nRowString.getStr());
 
+                    pTreeView->unselect(pTreeView->get_selected_index());
                     pTreeView->select(nRow);
+                    pTreeView->set_cursor(nRow);
                     LOKTrigger::trigger_changed(*pTreeView);
                     LOKTrigger::trigger_row_activated(*pTreeView);
                     return true;
commit 1cb72b68f28a92e625d6c698d73fe61e314635ff
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Dec 7 08:39:54 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:25:44 2021 +0200

    jsdialog: dump all columns in treeview
    
    Change-Id: Ia3fbf1c87b49e367c2ff077eee7734540e96b50b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107333
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107463
    Tested-by: Jenkins

diff --git a/include/vcl/toolkit/svtabbx.hxx b/include/vcl/toolkit/svtabbx.hxx
index 971ef5eb4047..38c1b18d50d1 100644
--- a/include/vcl/toolkit/svtabbx.hxx
+++ b/include/vcl/toolkit/svtabbx.hxx
@@ -213,6 +213,8 @@ public:
 
     virtual tools::Rectangle        GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) override;
     virtual sal_Int32               GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) override;
+
+    virtual void DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index fdae20554120..816acb66a46c 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -49,10 +49,30 @@ static void lcl_DumpEntryAndSiblings(tools::JsonWriter& rJsonWriter,
     {
         auto aNode = rJsonWriter.startStruct();
 
+        // simple listbox value
         const SvLBoxItem* pIt = pEntry->GetFirstItem(SvLBoxItemType::String);
         if (pIt)
             rJsonWriter.put("text", static_cast<const SvLBoxString*>(pIt)->GetText());
 
+        // column based data
+        {
+            auto aColumns = rJsonWriter.startArray("columns");
+
+            for (size_t i = 0; i < pEntry->ItemCount(); i++)
+            {
+                SvLBoxItem& rItem = pEntry->GetItem(i);
+                if (rItem.GetType() == SvLBoxItemType::String)
+                {
+                    const SvLBoxString* pStringItem = dynamic_cast<const SvLBoxString*>(&rItem);
+                    if (pStringItem)
+                    {
+                        auto aColumn = rJsonWriter.startStruct();
+                        rJsonWriter.put("text", pStringItem->GetText());
+                    }
+                }
+            }
+        }
+
         if (bCheckButtons)
         {
             SvButtonState eCheckState = pTabListBox->GetCheckButtonState(pEntry);
@@ -547,6 +567,20 @@ sal_uLong SvHeaderTabListBox::Insert( SvTreeListEntry* pEntry, sal_uLong nRootPo
     return nPos;
 }
 
+void SvHeaderTabListBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
+{
+    SvTabListBox::DumpAsPropertyTree(rJsonWriter);
+
+    auto aHeaders = rJsonWriter.startArray("headers");
+
+    HeaderBar* pHeaderBar = GetHeaderBar();
+    for(sal_uInt16 i = 0; i < pHeaderBar->GetItemCount(); i++)
+    {
+        auto aNode = rJsonWriter.startStruct();
+        rJsonWriter.put("text", pHeaderBar->GetItemText(pHeaderBar->GetItemId(i)));
+    }
+}
+
 IMPL_LINK_NOARG(SvHeaderTabListBox, ScrollHdl_Impl, SvTreeListBox*, void)
 {
     m_pImpl->m_pHeaderBar->SetOffset( -GetXOffset() );
commit 32e5530d47439917a87b02389c371babef7487f3
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Dec 4 15:14:03 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:25:33 2021 +0200

    pivot table: fix interactions in online
    
    Single clicks were identified as double so
    clicks in the pivot table caused to create
    new tables or other unwanted behaviour.
    
    In case cursor is over pivot table - require
    real double click.
    
    Change-Id: I6ca9af9ff9dbe5a1e00f2b57753ce4f8f298288d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107225
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107405
    Tested-by: Jenkins

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 6da788a78fc1..f075ab8c78cf 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2107,23 +2107,26 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
             pView->ResetBrushDocument();            // invalidates pBrushDoc pointer
     }
 
+    Point aPos = rMEvt.GetPosPixel();
+    SCCOL nPosX;
+    SCROW nPosY;
+    SCTAB nTab = mrViewData.GetTabNo();
+    mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
+    ScDPObject* pDPObj  = rDoc.GetDPAtCursor( nPosX, nPosY, nTab );
+
+    bool bInDataPilotTable = (pDPObj != nullptr);
+
     // double click (only left button)
     // in the tiled rendering case, single click works this way too
 
     bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
     bool bDouble = ( rMEvt.GetClicks() == 2 && rMEvt.IsLeft() );
-    if ((bDouble || bIsTiledRendering)
+    if ((bDouble || (bIsTiledRendering && !bInDataPilotTable))
             && !bRefMode
             && (nMouseStatus == SC_GM_DBLDOWN || (bIsTiledRendering && nMouseStatus != SC_GM_URLDOWN))
             && !pScMod->IsRefDialogOpen())
     {
         //  data pilot table
-        Point aPos = rMEvt.GetPosPixel();
-        SCCOL nPosX;
-        SCROW nPosY;
-        SCTAB nTab = mrViewData.GetTabNo();
-        mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
-        ScDPObject* pDPObj  = rDoc.GetDPAtCursor( nPosX, nPosY, nTab );
         if ( pDPObj && pDPObj->GetSaveData()->GetDrillDown() )
         {
             ScAddress aCellPos( nPosX, nPosY, mrViewData.GetTabNo() );
@@ -2239,9 +2242,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
                 if (isTiledRendering && pViewShell &&
                     (pViewShell->isLOKMobilePhone() || pViewShell->isLOKTablet()))
                 {
-                    Point aPos = rMEvt.GetPosPixel();
-                    SCCOL nPosX;
-                    SCROW nPosY;
+                    aPos = rMEvt.GetPosPixel();
                     mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
                     auto pForTabView = dynamic_cast<const ScTabViewShell *>(pViewShell);
                     OString aCursor = pForTabView->GetViewData().describeCellCursorAt(nPosX, nPosY);
@@ -2294,10 +2295,8 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
             uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = rDoc.GetVbaEventProcessor();
             if( xVbaEvents.is() ) try
             {
-                Point aPos = rMEvt.GetPosPixel();
-                SCCOL nPosX;
-                SCROW nPosY;
-                SCTAB nTab = mrViewData.GetTabNo();
+                aPos = rMEvt.GetPosPixel();
+                nTab = mrViewData.GetTabNo();
                 mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
                 OUString sURL;
                 ScRefCellValue aCell;
commit 3640a83d69bf3158089031d786076fa3caaff366
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Dec 4 13:42:19 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:23:56 2021 +0200

    pivot table: hide database source in online
    
    Change-Id: Ifc9fdb6010f9a998ffd2d6eeaa562528563f0666
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107219
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107404
    Tested-by: Jenkins

diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index 411ff96872c0..15acb8c65553 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -20,6 +20,7 @@
 #undef SC_DLLIMPLEMENTATION
 
 #include <dapitype.hxx>
+#include <comphelper/lok.hxx>
 
 using namespace com::sun::star;
 
@@ -52,6 +53,9 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(weld::Window* pParent, bool b
 
     // Intentionally hide this button to see if anyone complains.
     m_xBtnExternal->hide();
+
+    if (comphelper::LibreOfficeKit::isActive())
+        m_xBtnDatabase->hide();
 }
 
 IMPL_LINK(ScDataPilotSourceTypeDlg, ResponseHdl, weld::Button&, rButton, void)
commit ffa7cf6afb86cc33e4e82c1cfd28487f2b48807c
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Dec 4 12:24:27 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:23:24 2021 +0200

    Avoid crash on closing docking window
    
    Change-Id: I9f5ac4fae9e37e3eece8ad8bd2d6505514517d9f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107215
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107403
    Tested-by: Jenkins

diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 1307ffa9234d..8c2367e96736 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -388,6 +388,10 @@ void DockingManager::RemoveWindow( const vcl::Window *pWindow )
         const auto& xWrapper = *it;
         if (xWrapper && xWrapper->mpDockingWindow == pWindow)
         {
+            // deleting wrappers calls set of actions which may want to use
+            // wrapper we want to delete - avoid crash using temporary owner
+            // while erasing
+            auto pTemporaryOwner = std::move(*it);
             mvDockingWindows.erase( it );
             break;
         }
commit 311b10e73b6382c0f4fabe49b7fc2905489e2c9b
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Dec 4 11:02:11 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:23:10 2021 +0200

    notebookbar: add pivot table section to tab data
    
    Change-Id: If770155d5246c8697bb72db957b2b13e1501263f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107193
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108656
    Tested-by: Jenkins

diff --git a/sc/uiconfig/scalc/ui/notebookbar.ui b/sc/uiconfig/scalc/ui/notebookbar.ui
index 518a3c90c083..0ec448fbd7e3 100644
--- a/sc/uiconfig/scalc/ui/notebookbar.ui
+++ b/sc/uiconfig/scalc/ui/notebookbar.ui
@@ -7421,6 +7421,46 @@
                         <property name="position">1</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="VclOptionalBox" id="Data-Section-ManageXMLSource1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="valign">center</property>
+                        <property name="vexpand">True</property>
+                        <child>
+                          <object class="sfxlo-NotebookbarToolBox" id="SectionManageXMLSource95">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="valign">center</property>
+                            <property name="vexpand">True</property>
+                            <property name="toolbar_style">both</property>
+                            <property name="show_arrow">False</property>
+                            <property name="icon_size">3</property>
+                            <child>
+                              <object class="GtkToolButton" id="Data-ManageXMLSource">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="action_name">.uno:ManageXMLSource</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="VclOptionalBox" id="Data-Section-Source2">
                         <property name="visible">True</property>
@@ -7461,7 +7501,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="sfxlo-NotebookbarToolBox" id="belowspacing13">
+                              <object class="sfxlo-NotebookbarToolBox" id="belowspacing12">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="valign">center</property>
@@ -7469,10 +7509,10 @@
                                 <property name="toolbar_style">both-horiz</property>
                                 <property name="show_arrow">False</property>
                                 <child>
-                                  <object class="GtkToolButton" id="Data-ManageXMLSource">
+                                  <object class="GtkToolButton" id="Data-DataProviderRefresh">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="action_name">.uno:ManageXMLSource</property>
+                                    <property name="action_name">.uno:DataProviderRefresh</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -7500,7 +7540,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">2</property>
+                        <property name="position">3</property>
                       </packing>
                     </child>
                     <child>
@@ -7555,24 +7595,66 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">3</property>
+                        <property name="position">4</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="VclOptionalBox" id="Data-Section-Calculate1">
+                      <object class="VclOptionalBox" id="Data-Section-PivotTable">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="valign">center</property>
                         <property name="vexpand">True</property>
                         <child>
-                          <object class="GtkBox" id="GroupB49">
+                          <object class="GtkSeparator" id="separator377">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="margin_top">5</property>
+                            <property name="margin_bottom">5</property>
+                            <property name="orientation">vertical</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="padding">5</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="sfxlo-NotebookbarToolBox" id="SectionPivotTable1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="valign">center</property>
+                            <property name="vexpand">True</property>
+                            <property name="toolbar_style">both</property>
+                            <property name="show_arrow">False</property>
+                            <property name="icon_size">3</property>
+                            <child>
+                              <object class="GtkToolButton" id="Data-PivotTable">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="action_name">.uno:DataDataPilotRun</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="GroupPivotTable1">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="valign">center</property>
                             <property name="vexpand">True</property>
                             <property name="orientation">vertical</property>
                             <child>
-                              <object class="sfxlo-NotebookbarToolBox" id="LeftParaMargin11">
+                              <object class="sfxlo-NotebookbarToolBox" id="ToolBoxPivotTable1">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="valign">center</property>
@@ -7598,7 +7680,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="sfxlo-NotebookbarToolBox" id="belowspacing12">
+                              <object class="sfxlo-NotebookbarToolBox" id="ToolBoxPivotTable2">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="valign">center</property>
@@ -7606,10 +7688,10 @@
                                 <property name="toolbar_style">both-horiz</property>
                                 <property name="show_arrow">False</property>
                                 <child>
-                                  <object class="GtkToolButton" id="Data-DataProviderRefresh">
+                                  <object class="GtkToolButton" id="Data-DeletePivotTable">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="action_name">.uno:DataProviderRefresh</property>
+                                    <property name="action_name">.uno:DeletePivotTable</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -7630,14 +7712,11 @@
                             <property name="position">2</property>
                           </packing>
                         </child>
-                        <style>
-                          <class name="priority-13"/>
-                        </style>
                       </object>
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">4</property>
+                        <property name="position">5</property>
                       </packing>
                     </child>
                     <child>
@@ -7692,7 +7771,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">5</property>
+                        <property name="position">6</property>
                       </packing>
                     </child>
                     <child>
@@ -7774,7 +7853,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">6</property>
+                        <property name="position">7</property>
                       </packing>
                     </child>
                     <child>
@@ -7868,7 +7947,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">7</property>
+                        <property name="position">8</property>
                       </packing>
                     </child>
                     <child>
@@ -7950,7 +8029,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">8</property>
+                        <property name="position">9</property>
                       </packing>
                     </child>
                     <child>
@@ -8005,7 +8084,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">9</property>
+                        <property name="position">10</property>
                       </packing>
                     </child>
                     <child>
@@ -8087,7 +8166,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">10</property>
+                        <property name="position">11</property>
                       </packing>
                     </child>
                     <child>
@@ -8169,7 +8248,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">11</property>
+                        <property name="position">12</property>
                       </packing>
                     </child>
                     <child>
@@ -8224,7 +8303,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">12</property>
+                        <property name="position">13</property>
                       </packing>
                     </child>
                     <child>
@@ -8306,7 +8385,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">13</property>
+                        <property name="position">14</property>
                       </packing>
                     </child>
                     <child>
@@ -8361,7 +8440,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">14</property>
+                        <property name="position">15</property>
                       </packing>
                     </child>
                     <child>
@@ -8443,7 +8522,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">15</property>
+                        <property name="position">16</property>
                       </packing>
                     </child>
                     <child>
@@ -8492,7 +8571,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">16</property>
+                        <property name="position">17</property>
                       </packing>
                     </child>
                   </object>
commit 73aa2b05eafd71b5c3ccc5d8cbc0b8ffa8281511
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 3 14:09:43 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:22:22 2021 +0200

    jsdialog: don't skip commands
    
    api was extended and now we send no only
    the latest state of a current window (may be skipped),
    but also commands like: close window <ID>.
    Make sure commands will not be skipped when new dialog
    appears.
    
    Change-Id: I17fa0f09d7ef78cbbcbf8786182dfeb92e6021ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107165
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107350
    Tested-by: Jenkins

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ad1edb322425..b0365e89ed50 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1526,7 +1526,6 @@ void CallbackFlushHandler::queue(const int type, const char* data)
             case LOK_CALLBACK_TEXT_VIEW_SELECTION:
             case LOK_CALLBACK_VIEW_CURSOR_VISIBLE:
             case LOK_CALLBACK_CALC_FUNCTION_LIST:
-            case LOK_CALLBACK_JSDIALOG:
             case LOK_CALLBACK_FORM_FIELD_BUTTON:
             {
                 // deleting the duplicate of visible cursor message can cause hyperlink popup not to show up on second/or more click on the same place.
commit e30ef18438866309d16c72f93afef85f732892e2
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 3 14:13:19 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:10:42 2021 +0200

    jsdialog: enable Pivot Table Source Select dialog
    
    Change-Id: I4be843d9ea3f4cd76b1ac41f6be3bd212b60d3ec
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107166
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index ccca582b7dc8..626776a91b18 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -182,7 +182,8 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString
             }
         }
 
-        if (rUIFile == "modules/scalc/ui/pivottablelayoutdialog.ui")
+        if (rUIFile == "modules/scalc/ui/pivottablelayoutdialog.ui"
+            || rUIFile == "modules/scalc/ui/selectsource.ui")
         {
             bUseJSBuilder = true;
         }
commit c1bdab1e1d3e350d0d0292e8c9eca2e33ee8cd07
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 3 14:07:59 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:10:19 2021 +0200

    jsdialog: make source selector dialog buttons work
    
    Make sure buttons are welded so we will be able to
    execute actions.
    
    Change-Id: I1cb7bdcd80d1cd4d60751940e4d24ecf8e7be1ce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107164
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108881
    Tested-by: Jenkins

diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index d4e817b2404d..411ff96872c0 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -30,12 +30,17 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(weld::Window* pParent, bool b
     , m_xBtnDatabase(m_xBuilder->weld_radio_button("database"))
     , m_xBtnExternal(m_xBuilder->weld_radio_button("external"))
     , m_xLbNamedRange(m_xBuilder->weld_combo_box("rangelb"))
+    , m_xBtnOk(m_xBuilder->weld_button("ok")) // for LOK jsdialog
+    , m_xBtnCancel(m_xBuilder->weld_button("cancel")) // for LOK jsdialog
 {
     m_xBtnSelection->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
     m_xBtnNamedRange->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
     m_xBtnDatabase->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
     m_xBtnExternal->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
 
+    m_xBtnOk->connect_clicked( LINK(this, ScDataPilotSourceTypeDlg, ResponseHdl ) );
+    m_xBtnCancel->connect_clicked( LINK(this, ScDataPilotSourceTypeDlg, ResponseHdl ) );
+
     if (!bEnableExternal)
         m_xBtnExternal->set_sensitive(false);
 
@@ -49,6 +54,14 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(weld::Window* pParent, bool b
     m_xBtnExternal->hide();
 }
 
+IMPL_LINK(ScDataPilotSourceTypeDlg, ResponseHdl, weld::Button&, rButton, void)
+{
+    if (&rButton == m_xBtnOk.get())
+        m_xDialog->response(RET_OK);
+    else
+        m_xDialog->response(RET_CANCEL);
+}
+
 ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg()
 {
 }
diff --git a/sc/source/ui/inc/dapitype.hxx b/sc/source/ui/inc/dapitype.hxx
index 436d71c9d7f5..8e65db5bae60 100644
--- a/sc/source/ui/inc/dapitype.hxx
+++ b/sc/source/ui/inc/dapitype.hxx
@@ -30,6 +30,8 @@ private:
     std::unique_ptr<weld::RadioButton> m_xBtnDatabase;
     std::unique_ptr<weld::RadioButton> m_xBtnExternal;
     std::unique_ptr<weld::ComboBox> m_xLbNamedRange;
+    std::unique_ptr<weld::Button> m_xBtnOk;
+    std::unique_ptr<weld::Button> m_xBtnCancel;
 
 public:
     ScDataPilotSourceTypeDlg(weld::Window* pParent, bool bEnableExternal);
@@ -42,6 +44,7 @@ public:
 
 private:
     DECL_LINK(RadioClickHdl, weld::ToggleButton&, void);
+    DECL_LINK(ResponseHdl, weld::Button&, void);
 };
 
 class ScDataPilotServiceDlg : public weld::GenericDialogController
commit c8975ea3d0214b4c8459e8709b51ac70771334e2
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 3 11:16:08 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 20:10:08 2021 +0200

    jsdialog: send close on dialog response
    
    Change-Id: I730d99cc9aa519f07d6b1c436d749f2c0b044bfd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107151
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107349
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/tools/json_writer.hxx b/include/tools/json_writer.hxx
index 10e1a3a7aafc..c4b3004cf979 100644
--- a/include/tools/json_writer.hxx
+++ b/include/tools/json_writer.hxx
@@ -74,7 +74,7 @@ public:
     std::string extractAsStdString();
 
     /** returns true if the current JSON data matches the string */
-    bool isDataEquals(const std::string&);
+    bool isDataEquals(const std::string&) const;
 
 private:
     void endNode();
diff --git a/tools/source/misc/json_writer.cxx b/tools/source/misc/json_writer.cxx
index 0b13a63fc038..e211d317b9ad 100644
--- a/tools/source/misc/json_writer.cxx
+++ b/tools/source/misc/json_writer.cxx
@@ -413,7 +413,7 @@ std::string JsonWriter::extractAsStdString()
     return ret;
 }
 
-bool JsonWriter::isDataEquals(const std::string& s)
+bool JsonWriter::isDataEquals(const std::string& s) const
 {
     return s.length() == static_cast<size_t>(mPos - mpBuffer)
            && memcmp(s.data(), mpBuffer, s.length()) == 0;
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index ab7c038648d3..d3c6e7b26d48 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
 #include <cppuhelper/compbase.hxx>
+#include <boost/property_tree/ptree_fwd.hpp>
 
 class ToolBox;
 class ComboBox;
@@ -47,6 +48,12 @@ public:
 
     void Invoke() override;
     void ForceUpdate();
+    void sendClose();
+
+private:
+    void send(std::unique_ptr<tools::JsonWriter> aJsonWriter);
+    std::unique_ptr<tools::JsonWriter> dumpStatus() const;
+    std::unique_ptr<tools::JsonWriter> generateCloseMessage() const;
 };
 
 class JSDialogSender
@@ -61,6 +68,7 @@ public:
     }
 
     void notifyDialogState(bool bForce = false);
+    void sendClose();
 };
 
 class JSDropTarget final
@@ -216,6 +224,7 @@ public:
 
     virtual void collapse(weld::Widget* pEdit, weld::Widget* pButton) override;
     virtual void undo_collapse() override;
+    virtual void response(int response) override;
 };
 
 class JSLabel : public JSWidget<SalInstanceLabel, FixedText>
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 3c663bac10e0..08e66eedb6f5 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -40,7 +40,7 @@ JSDialogNotifyIdle::JSDialogNotifyIdle(VclPtr<vcl::Window> aNotifierWindow,
 
 void JSDialogNotifyIdle::ForceUpdate() { m_bForce = true; }
 
-void JSDialogNotifyIdle::Invoke()
+void JSDialogNotifyIdle::send(std::unique_ptr<tools::JsonWriter> aJsonWriter)
 {
     if (!m_aNotifierWindow)
         return;
@@ -48,39 +48,63 @@ void JSDialogNotifyIdle::Invoke()
     const vcl::ILibreOfficeKitNotifier* pNotifier = m_aNotifierWindow->GetLOKNotifier();
     if (pNotifier)
     {
-        tools::JsonWriter aJsonWriter;
-        m_aContentWindow->DumpAsPropertyTree(aJsonWriter);
-        aJsonWriter.put("id", m_aNotifierWindow->GetLOKWindowId());
-        aJsonWriter.put("jsontype", m_sTypeOfJSON);
+        if (m_bForce || !aJsonWriter->isDataEquals(m_LastNotificationMessage))
+        {
+            m_bForce = false;
+            m_LastNotificationMessage = aJsonWriter->extractAsStdString();
+            pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG,
+                                                  m_LastNotificationMessage.c_str());
+        }
+    }
+}
+
+std::unique_ptr<tools::JsonWriter> JSDialogNotifyIdle::dumpStatus() const
+{
+    std::unique_ptr<tools::JsonWriter> aJsonWriter(new tools::JsonWriter());
+
+    if (!m_aContentWindow || !m_aNotifierWindow)
+        return aJsonWriter;
 
-        if (m_sTypeOfJSON == "autofilter")
+    m_aContentWindow->DumpAsPropertyTree(*aJsonWriter);
+    aJsonWriter->put("id", m_aNotifierWindow->GetLOKWindowId());
+    aJsonWriter->put("jsontype", m_sTypeOfJSON);
+
+    if (m_sTypeOfJSON == "autofilter")
+    {
+        vcl::Window* pWindow = m_aContentWindow.get();
+        DockingWindow* pDockingWIndow = dynamic_cast<DockingWindow*>(pWindow);
+        while (pWindow && !pDockingWIndow)
         {
-            vcl::Window* pWindow = m_aContentWindow.get();
-            DockingWindow* pDockingWIndow = dynamic_cast<DockingWindow*>(pWindow);
-            while (pWindow && !pDockingWIndow)
-            {
-                pWindow = pWindow->GetParent();
-                pDockingWIndow = dynamic_cast<DockingWindow*>(pWindow);
-            }
-
-            if (pDockingWIndow)
-            {
-                Point aPos = pDockingWIndow->GetFloatingPos();
-                aJsonWriter.put("posx", aPos.getX());
-                aJsonWriter.put("posy", aPos.getY());
-            }
+            pWindow = pWindow->GetParent();
+            pDockingWIndow = dynamic_cast<DockingWindow*>(pWindow);
         }
 
-        if (m_bForce || !aJsonWriter.isDataEquals(m_LastNotificationMessage))
+        if (pDockingWIndow)
         {
-            m_bForce = false;
-            m_LastNotificationMessage = aJsonWriter.extractAsStdString();
-            pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG,
-                                                  m_LastNotificationMessage.c_str());
+            Point aPos = pDockingWIndow->GetFloatingPos();
+            aJsonWriter->put("posx", aPos.getX());
+            aJsonWriter->put("posy", aPos.getY());
         }
     }
+
+    return aJsonWriter;
+}
+
+std::unique_ptr<tools::JsonWriter> JSDialogNotifyIdle::generateCloseMessage() const
+{
+    std::unique_ptr<tools::JsonWriter> aJsonWriter(new tools::JsonWriter());
+    if (m_aNotifierWindow)
+        aJsonWriter->put("id", m_aNotifierWindow->GetLOKWindowId());
+    aJsonWriter->put("jsontype", m_sTypeOfJSON);
+    aJsonWriter->put("action", "close");
+
+    return aJsonWriter;
 }
 
+void JSDialogNotifyIdle::Invoke() { send(dumpStatus()); }
+
+void JSDialogNotifyIdle::sendClose() { send(generateCloseMessage()); }
+
 void JSDialogSender::notifyDialogState(bool bForce)
 {
     if (bForce)
@@ -88,6 +112,8 @@ void JSDialogSender::notifyDialogState(bool bForce)
     mpIdleNotify->Start();
 }
 
+void JSDialogSender::sendClose() { mpIdleNotify->sendClose(); }
+
 namespace
 {
 vcl::Window* extract_sal_widget(weld::Widget* pParent)
@@ -611,6 +637,12 @@ void JSDialog::undo_collapse()
     notifyDialogState();
 }
 
+void JSDialog::response(int response)
+{
+    sendClose();
+    SalInstanceDialog::response(response);
+}
+
 JSLabel::JSLabel(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
                  FixedText* pLabel, SalInstanceBuilder* pBuilder, bool bTakeOwnership,
                  std::string sTypeOfJSON)


More information about the Libreoffice-commits mailing list