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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 28 07:15:35 UTC 2021


 vcl/inc/jsdialog/jsdialogbuilder.hxx |    8 ++++++++
 vcl/jsdialog/jsdialogbuilder.cxx     |   22 ++++++++++++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 2cb0ebaff2896feafc1f574ca8fb1f13a11f5401
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Jun 11 10:29:54 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Jul 28 09:15:11 2021 +0200

    jsdialog: sidebar: fix closing
    
    revert change done by mistake in:
    64bd4dd2f80b247cb5df3f3e6c54bf2d47bc41a7
    
    Change-Id: I740d5970c713053c7f8a4c880776a1056d132e12
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119553
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 954eca380bce..335b9cfc23d7 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -419,6 +419,8 @@ JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIR
 {
     vcl::Window* pRoot = m_xBuilder->get_widget_root();
 
+    m_aParentDialog = pRoot->GetParentWithLOKNotifier();
+
     if (rUIFile == "sfx/ui/panel.ui")
     {
         // builder for Panel, get SidebarDockingWindow as m_aContentWindow
@@ -434,8 +436,6 @@ JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIR
             m_aContentWindow = m_aContentWindow->GetParent();
     }
 
-    m_aParentDialog = m_aContentWindow;
-
     InsertWindowToMap(m_nWindowId);
 
     initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
commit a72b7e2f38cc8c7372f24365a8458528205b09e4
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Jun 10 15:40:33 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Jul 28 09:15:00 2021 +0200

    jsdialog: weld MenuButton
    
    Change-Id: I79b753e070183daa809b23dbb7d3052000ebecd4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116995
    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/+/119552
    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 5199dd943439..75bdf667cc58 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -254,6 +254,7 @@ public:
     virtual std::unique_ptr<weld::IconView> weld_icon_view(const OString& id) override;
     virtual std::unique_ptr<weld::RadioButton> weld_radio_button(const OString& id) override;
     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;
 
     static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent,
                                                     VclMessageType eMessageType,
@@ -617,4 +618,11 @@ public:
             bool bTakeOwnership);
 };
 
+class JSMenuButton : public JSWidget<SalInstanceMenuButton, ::MenuButton>
+{
+public:
+    JSMenuButton(JSDialogSender* pSender, ::MenuButton* pMenuButton, 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 896225aef311..954eca380bce 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -873,6 +873,18 @@ std::unique_ptr<weld::Frame> JSInstanceBuilder::weld_frame(const OString& id)
     return pWeldWidget;
 }
 
+std::unique_ptr<weld::MenuButton> JSInstanceBuilder::weld_menu_button(const OString& id)
+{
+    ::MenuButton* pMenuButton = m_xBuilder->get<::MenuButton>(id);
+    auto pWeldWidget
+        = pMenuButton ? std::make_unique<JSMenuButton>(this, pMenuButton, this, false) : nullptr;
+
+    if (pWeldWidget)
+        RememberWidget(id, pWeldWidget.get());
+
+    return pWeldWidget;
+}
+
 weld::MessageDialog* JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParent,
                                                             VclMessageType eMessageType,
                                                             VclButtonsType eButtonType,
@@ -1407,4 +1419,10 @@ JSFrame::JSFrame(JSDialogSender* pSender, ::VclFrame* pFrame, SalInstanceBuilder
 {
 }
 
+JSMenuButton::JSMenuButton(JSDialogSender* pSender, ::MenuButton* pMenuButton,
+                           SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+    : JSWidget<SalInstanceMenuButton, ::MenuButton>(pSender, pMenuButton, 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