vcl/inc/jsdialog/jsdialogbuilder.hxx |    3 ++-
 vcl/jsdialog/executor.cxx            |    4 ++--
 vcl/jsdialog/jsdialogbuilder.cxx     |    4 +++-
 3 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 30afe838d35471c3d3e8f90e997ea0f4c152c6ae
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Jan 19 08:39:15 2021 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Thu Jan 21 06:51:13 2021 +0100

    jsdialog: set entry text without back notification
    
    We don't want to disturb user while editing the text
    
    Change-Id: I8a8b9a688133d27fc2aeaee6178a773641f4a79f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109612
    Tested-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index cefa5776c79b..b638ac01a417 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -246,7 +246,7 @@ public:
     virtual void set_sensitive(bool sensitive) override
     {
         BaseInstanceClass::set_sensitive(sensitive);
-        notifyDialogState();
+        sendUpdate(BaseInstanceClass::m_xWidget);
     }
 
     virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> 
get_drop_target() override
@@ -320,6 +320,7 @@ public:
     JSEntry(JSDialogSender* pSender, ::Edit* pEntry, SalInstanceBuilder* 
pBuilder,
             bool bTakeOwnership);
     virtual void set_text(const OUString& rText) override;
+    void set_text_without_notify(const OUString& rText);
 };
 
 class JSListBox : public JSWidget<SalInstanceComboBoxWithoutEdit, ::ListBox>
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 655104633410..1de6db627f96 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -166,12 +166,12 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& 
rWidget, StringMap& rDat
         }
         else if (sControlType == "edit")
         {
-            auto pEdit = dynamic_cast<weld::Entry*>(pWidget);
+            auto pEdit = dynamic_cast<JSEntry*>(pWidget);
             if (pEdit)
             {
                 if (sAction == "change")
                 {
-                    pEdit->set_text(rData["data"]);
+                    pEdit->set_text_without_notify(rData["data"]);
                     LOKTrigger::trigger_changed(*pEdit);
                     return true;
                 }
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 38ef2a44e354..0c57aaf4fa44 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -750,7 +750,7 @@ JSLabel::JSLabel(JSDialogSender* pSender, FixedText* 
pLabel, SalInstanceBuilder*
 void JSLabel::set_label(const OUString& rText)
 {
     SalInstanceLabel::set_label(rText);
-    notifyDialogState();
+    sendUpdate(m_xWidget);
 };
 
 JSButton::JSButton(JSDialogSender* pSender, ::Button* pButton, 
SalInstanceBuilder* pBuilder,
@@ -771,6 +771,8 @@ void JSEntry::set_text(const OUString& rText)
     notifyDialogState();
 }
 
+void JSEntry::set_text_without_notify(const OUString& rText) { 
SalInstanceEntry::set_text(rText); }
+
 JSListBox::JSListBox(JSDialogSender* pSender, ::ListBox* pListBox, 
SalInstanceBuilder* pBuilder,
                      bool bTakeOwnership)
     : JSWidget<SalInstanceComboBoxWithoutEdit, ::ListBox>(pSender, pListBox, 
pBuilder,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to