[Libreoffice-commits] core.git: 2 commits - sfx2/source vcl/inc vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 26 13:56:14 UTC 2021


 sfx2/source/sidebar/Deck.cxx         |    4 +---
 vcl/inc/jsdialog/jsdialogbuilder.hxx |    8 ++++++++
 vcl/jsdialog/jsdialogbuilder.cxx     |   17 +++++++++++++++++
 3 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit 9cf1c5c8468d0e4974fe809455713a3e8f162822
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri May 21 16:45:29 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Jul 26 15:55:51 2021 +0200

    jsdialog: sidebar: dump all panels
    
    Change-Id: Ifa547014f6857b0c1fbdce50cba745f1bee4e975
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119500
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 700fb19251bf..422eb3bb6b9b 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -144,9 +144,6 @@ void Deck::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
     auto childrenNode = rJsonWriter.startArray("children");
     for (auto &it : maPanels)
     {
-        if (it->IsLurking())
-            continue;
-
         // collapse the panel itself out
         auto xContent = it->GetContents();
         if (!xContent)
@@ -157,6 +154,7 @@ void Deck::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
         rJsonWriter.put("type", "panel");
         rJsonWriter.put("text", it->GetTitle());
         rJsonWriter.put("enabled", true);
+        rJsonWriter.put("hidden", it->IsLurking());
 
         {
             auto children2Node = rJsonWriter.startArray("children");
commit bd96480dab1313d62d8b58f2f6cb09ea03022cf7
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue May 18 17:07:30 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Jul 26 15:55:34 2021 +0200

    jsdialog: weld Container
    
    Change-Id: I9516538cac8d2e42e0d029feaf84c3bc3a80151a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119499
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index cb2a95d9d368..450a11529507 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -229,6 +229,7 @@ public:
     virtual ~JSInstanceBuilder() override;
     virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OString& id) override;
     virtual std::unique_ptr<weld::Dialog> weld_dialog(const OString& id) override;
+    virtual std::unique_ptr<weld::Container> weld_container(const OString& id) override;
     virtual std::unique_ptr<weld::Label> weld_label(const OString& id) override;
     virtual std::unique_ptr<weld::Button> weld_button(const OString& id) override;
     virtual std::unique_ptr<weld::Entry> weld_entry(const OString& id) override;
@@ -393,6 +394,13 @@ public:
     virtual void response(int response) override;
 };
 
+class JSContainer final : public JSWidget<SalInstanceContainer, vcl::Window>
+{
+public:
+    JSContainer(JSDialogSender* pSender, vcl::Window* pContainer, SalInstanceBuilder* pBuilder,
+                bool bTakeOwnership);
+};
+
 class JSLabel final : public JSWidget<SalInstanceLabel, FixedText>
 {
 public:
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index fd9d152ae6ed..5a57e63dfbce 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -626,6 +626,17 @@ std::unique_ptr<weld::MessageDialog> JSInstanceBuilder::weld_message_dialog(cons
     return pRet;
 }
 
+std::unique_ptr<weld::Container> JSInstanceBuilder::weld_container(const OString& id)
+{
+    vcl::Window* pContainer = m_xBuilder->get<vcl::Window>(id);
+    auto pWeldWidget = std::make_unique<JSContainer>(this, pContainer, this, false);
+
+    if (pWeldWidget)
+        RememberWidget(id, pWeldWidget.get());
+
+    return pWeldWidget;
+}
+
 std::unique_ptr<weld::Label> JSInstanceBuilder::weld_label(const OString& id)
 {
     ::FixedText* pLabel = m_xBuilder->get<FixedText>(id);
@@ -860,6 +871,12 @@ void JSDialog::response(int response)
     SalInstanceDialog::response(response);
 }
 
+JSContainer::JSContainer(JSDialogSender* pSender, vcl::Window* pContainer,
+                         SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+    : JSWidget<SalInstanceContainer, vcl::Window>(pSender, pContainer, pBuilder, bTakeOwnership)
+{
+}
+
 JSLabel::JSLabel(JSDialogSender* pSender, FixedText* pLabel, SalInstanceBuilder* pBuilder,
                  bool bTakeOwnership)
     : JSWidget<SalInstanceLabel, FixedText>(pSender, pLabel, pBuilder, bTakeOwnership)


More information about the Libreoffice-commits mailing list