vcl/inc/jsdialog/jsdialogbuilder.hxx |    3 +++
 vcl/jsdialog/enabled.cxx             |    5 ++---
 vcl/jsdialog/jsdialogbuilder.cxx     |   15 ++++++++++++++-
 3 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit acaad9f08a9dc24b28eb634b1da9f3f4599635e8
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Mon Nov 22 10:50:03 2021 +0100
Commit:     Jan Holesovsky <ke...@collabora.com>
CommitDate: Tue Nov 23 15:53:29 2021 +0100

    jsdialog: send popup when launched using Popover widget
    
    - enable validity listbox in online
    - flush when sending close popup to be sure it is sent
    
    Signed-off-by: Szymon Kłos <szymon.k...@collabora.com>
    Change-Id: Icf33e26c48b78ab60030a7395e8c7ee5462fbf7c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125647
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index ccd2489d797b..12305d05d424 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -680,6 +680,9 @@ class JSPopover : public JSWidget<SalInstancePopover, 
DockingWindow>
 public:
     JSPopover(JSDialogSender* pSender, DockingWindow* pPopover, 
SalInstanceBuilder* pBuilder,
               bool bTakeOwnership);
+
+    virtual void popup_at_rect(weld::Widget* pParent, const tools::Rectangle& 
rRect) override;
+    virtual void popdown() override;
 };
 
 class JSBox : public JSWidget<SalInstanceBox, VclBox>
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 0004e673a5a6..e06e59a6c68b 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -50,8 +50,7 @@ bool isBuilderEnabled(const OUString& rUIFile, bool bMobile)
         || rUIFile == "modules/scalc/ui/datafielddialog.ui"
         || rUIFile == "modules/scalc/ui/pivotfielddialog.ui"
         || rUIFile == "modules/scalc/ui/datafieldoptionsdialog.ui"
-        || rUIFile == "svx/ui/fontworkgallerydialog.ui"
-        || rUIFile == "svx/ui/findreplacedialog.ui"
+        || rUIFile == "svx/ui/fontworkgallerydialog.ui" || rUIFile == 
"svx/ui/findreplacedialog.ui"
         || rUIFile == "cui/ui/macroselectordialog.ui" || rUIFile == 
"uui/ui/macrowarnmedium.ui"
         || rUIFile == "modules/scalc/ui/textimportcsv.ui"
         || rUIFile == "xmlsec/ui/digitalsignaturesdialog.ui"
@@ -75,7 +74,7 @@ bool isBuilderEnabledForPopup(const OUString& rUIFile)
         || rUIFile == "svx/ui/floatinglineproperty.ui" || rUIFile == 
"svx/ui/floatinglinestyle.ui"
         || rUIFile == "svx/ui/floatinglineend.ui" || rUIFile == 
"svx/ui/fontworkalignmentcontrol.ui"
         || rUIFile == "svx/ui/fontworkcharacterspacingcontrol.ui"
-        || rUIFile == "svx/ui/floatingareastyle.ui")
+        || rUIFile == "svx/ui/floatingareastyle.ui" || rUIFile == 
"modules/scalc/ui/filterlist.ui")
         return true;
 
     return false;
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 6bee71f4d71a..8268b3a6b524 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -380,7 +380,7 @@ void JSDialogSender::sendClosePopup(vcl::LOKWindowId 
nWindowId)
     std::unique_ptr<ActionDataMap> pData = std::make_unique<ActionDataMap>();
     (*pData)[WINDOW_ID] = OUString::number(nWindowId);
     mpIdleNotify->sendMessage(jsdialog::MessageType::PopupClose, nullptr, 
std::move(pData));
-    mpIdleNotify->Start();
+    flush();
 }
 
 namespace
@@ -1709,6 +1709,19 @@ JSPopover::JSPopover(JSDialogSender* pSender, 
DockingWindow* pDockingWindow,
 {
 }
 
+void JSPopover::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& 
rRect)
+{
+    SalInstancePopover::popup_at_rect(pParent, rRect);
+    sendPopup(getWidget()->GetChild(0), "_POPOVER_", "_POPOVER_");
+}
+
+void JSPopover::popdown()
+{
+    if (getWidget() && getWidget()->GetChild(0))
+        sendClosePopup(getWidget()->GetChild(0)->GetLOKWindowId());
+    SalInstancePopover::popdown();
+}
+
 JSBox::JSBox(JSDialogSender* pSender, VclBox* pBox, SalInstanceBuilder* 
pBuilder,
              bool bTakeOwnership)
     : JSWidget<SalInstanceBox, VclBox>(pSender, pBox, pBuilder, bTakeOwnership)

Reply via email to