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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 6 09:09:36 UTC 2021


 vcl/inc/jsdialog/jsdialogbuilder.hxx |   11 +++++++++++
 vcl/jsdialog/jsdialogbuilder.cxx     |   12 ++++++++++++
 2 files changed, 23 insertions(+)

New commits:
commit b8e9e1bc7713ac159c3f23f9e4be4ddb656a9d79
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Oct 5 17:02:56 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Oct 6 11:09:14 2021 +0200

    jsdialog: avoid compiler warning for plain vcl window
    
    Change-Id: Icfe5a07e74801d59d6bb0988948bdf20f22bc3e5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123110
    Tested-by: Jenkins
    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 dc30508dba51..282857341cdf 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -686,4 +686,14 @@ public:
     JSBox(JSDialogSender* pSender, VclBox* pBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
 };
 
+class JSWidgetInstance : public JSWidget<SalInstanceWidget, vcl::Window>
+{
+public:
+    JSWidgetInstance(JSDialogSender* pSender, vcl::Window* pObject, SalInstanceBuilder* pBuilder,
+                     bool bTakeOwnership)
+        : JSWidget<SalInstanceWidget, vcl::Window>(pSender, pObject, pBuilder, 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 64f2b3029212..b38753fb1815 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1048,9 +1048,8 @@ std::unique_ptr<weld::Box> JSInstanceBuilder::weld_box(const OString& id)
 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;
+    auto pWeldWidget
+        = pWidget ? std::make_unique<JSWidgetInstance>(this, pWidget, this, false) : nullptr;
 
     if (pWeldWidget)
         RememberWidget(id, pWeldWidget.get());
commit dfff37d1d92074abbd8ad0dc5c79a4e269d09f61
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: Wed Oct 6 11:09:02 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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123106
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 55aa57d71888..dc30508dba51 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -275,6 +275,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 6b6c12831d73..64f2b3029212 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1045,6 +1045,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,


More information about the Libreoffice-commits mailing list