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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue May 25 12:23:49 UTC 2021


 vcl/inc/jsdialog/jsdialogbuilder.hxx |   11 +++++++++--
 vcl/jsdialog/jsdialogbuilder.cxx     |    4 ++--
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit b05d8419af76cc97e5b3f2a938c76cb5e99bef12
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri May 21 17:24:17 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue May 25 14:23:16 2021 +0200

    jsdialog: send action event on show/hide
    
    This fixes non working comboboxes in the sidebar in online.
    Where we simulate picking from the list.
    
    Change-Id: Ie78e461b2bce7fa0ccd68731e76d0c721242b98e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116097
    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 949499256d5a..aee7121b7271 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -27,6 +27,8 @@
 #include <deque>
 #include <unordered_map>
 
+#define ACTION_TYPE "action_type"
+
 class ToolBox;
 class ComboBox;
 class VclMultiLineEdit;
@@ -304,13 +306,17 @@ public:
     virtual void show() override
     {
         BaseInstanceClass::show();
-        sendFullUpdate();
+        std::unique_ptr<ActionDataMap> pMap = std::make_unique<ActionDataMap>();
+        (*pMap)[ACTION_TYPE] = "show";
+        sendAction(std::move(pMap));
     }
 
     virtual void hide() override
     {
         BaseInstanceClass::hide();
-        sendFullUpdate();
+        std::unique_ptr<ActionDataMap> pMap = std::make_unique<ActionDataMap>();
+        (*pMap)[ACTION_TYPE] = "hide";
+        sendAction(std::move(pMap));
     }
 
     using BaseInstanceClass::set_sensitive;
@@ -431,6 +437,7 @@ public:
     virtual void remove(int pos) override;
     virtual void set_entry_text(const OUString& rText) override;
     virtual void set_active(int pos) override;
+    virtual bool changed_by_direct_pick() const override;
 };
 
 class JSNotebook : public JSWidget<SalInstanceNotebook, ::TabControl>
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 065cb066eca4..c74a6577515d 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -27,8 +27,6 @@
 #include <cppuhelper/supportsservice.hxx>
 #include <utility>
 
-#define ACTION_TYPE "action_type"
-
 namespace
 {
 void response_help(vcl::Window* pWindow)
@@ -969,6 +967,8 @@ void JSComboBox::set_active(int pos)
     sendUpdate();
 }
 
+bool JSComboBox::changed_by_direct_pick() const { return true; }
+
 JSNotebook::JSNotebook(JSDialogSender* pSender, ::TabControl* pControl,
                        SalInstanceBuilder* pBuilder, bool bTakeOwnership)
     : JSWidget<SalInstanceNotebook, ::TabControl>(pSender, pControl, pBuilder, bTakeOwnership)


More information about the Libreoffice-commits mailing list