[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - vcl/inc vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 24 12:33:10 UTC 2021


 vcl/inc/jsdialog/jsdialogbuilder.hxx |    8 ++++++++
 vcl/jsdialog/jsdialogbuilder.cxx     |   31 +++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

New commits:
commit 21d1d67f9957c02389fd7fd48f60ea8e06aab65a
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Sep 24 10:08:41 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Sep 24 14:32:48 2021 +0200

    jsdialog: weld plain widget
    
    Change-Id: I85a23a7ea14ab580d4dc222d80edfaa8423cf952
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122562
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.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 ff5286239a43..dfd692e0a026 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -273,6 +273,7 @@ public:
     virtual std::unique_ptr<weld::MenuButton> weld_menu_button(const OString& id) override;
     virtual std::unique_ptr<weld::Popover> weld_popover(const OString& id) override;
     virtual std::unique_ptr<weld::Box> weld_box(const OString& id) override;
+    virtual std::unique_ptr<weld::Widget> weld_widget(const OString& id) override;
 
     static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent,
                                                     VclMessageType eMessageType,
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 1d32a16d808d..0a8c39c9cecb 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1053,6 +1053,19 @@ std::unique_ptr<weld::Box> JSInstanceBuilder::weld_box(const OString& id)
     return pWeldWidget;
 }
 
+std::unique_ptr<weld::Widget> JSInstanceBuilder::weld_widget(const OString& id)
+{
+    vcl::Window* pWidget = m_xBuilder->get(id);
+    auto pWeldWidget = pWidget ? std::make_unique<JSWidget<SalInstanceWidget, vcl::Window>>(
+                                     this, pWidget, this, false)
+                               : nullptr;
+
+    if (pWeldWidget)
+        RememberWidget(id, pWeldWidget.get());
+
+    return pWeldWidget;
+}
+
 weld::MessageDialog* JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParent,
                                                             VclMessageType eMessageType,
                                                             VclButtonsType eButtonType,
commit 0c507ece3a617d222a0c14a7954972cf57ac64ab
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Aug 20 18:47:52 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Sep 24 14:32:33 2021 +0200

    jsdialog: weld Box
    
    Change-Id: Ideb7b7ce8d7bf2e8494f053b13d662e19060b256
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120792
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122561
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 2bcee8777ea0..ff5286239a43 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -272,6 +272,7 @@ public:
     virtual std::unique_ptr<weld::Frame> weld_frame(const OString& id) override;
     virtual std::unique_ptr<weld::MenuButton> weld_menu_button(const OString& id) override;
     virtual std::unique_ptr<weld::Popover> weld_popover(const OString& id) override;
+    virtual std::unique_ptr<weld::Box> weld_box(const OString& id) override;
 
     static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent,
                                                     VclMessageType eMessageType,
@@ -676,4 +677,10 @@ public:
               bool bTakeOwnership);
 };
 
+class JSBox : public JSWidget<SalInstanceBox, VclBox>
+{
+public:
+    JSBox(JSDialogSender* pSender, VclBox* pBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+};
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 831d2f7018fa..1d32a16d808d 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1041,6 +1041,18 @@ std::unique_ptr<weld::Popover> JSInstanceBuilder::weld_popover(const OString& id
     return pWeldWidget;
 }
 
+std::unique_ptr<weld::Box> JSInstanceBuilder::weld_box(const OString& id)
+{
+    VclBox* pContainer = m_xBuilder->get<VclBox>(id);
+    auto pWeldWidget
+        = pContainer ? std::make_unique<JSBox>(this, pContainer, this, false) : nullptr;
+
+    if (pWeldWidget)
+        RememberWidget(id, pWeldWidget.get());
+
+    return pWeldWidget;
+}
+
 weld::MessageDialog* JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParent,
                                                             VclMessageType eMessageType,
                                                             VclButtonsType eButtonType,
@@ -1660,4 +1672,10 @@ JSPopover::JSPopover(JSDialogSender* pSender, DockingWindow* pDockingWindow,
 {
 }
 
+JSBox::JSBox(JSDialogSender* pSender, VclBox* pBox, SalInstanceBuilder* pBuilder,
+             bool bTakeOwnership)
+    : JSWidget<SalInstanceBox, VclBox>(pSender, pBox, pBuilder, bTakeOwnership)
+{
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */


More information about the Libreoffice-commits mailing list