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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 5 07:59:54 UTC 2021


 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 c73edd94565e7044a0369d7e33d59f717ee36251
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Jan 19 08:39:15 2021 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Fri Feb 5 08:59:21 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.klos at collabora.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109909
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 4e6ce0d2f909..88afa4a45383 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -264,7 +264,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
@@ -338,6 +338,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 75a474b08433..f8a1f938bfb2 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -184,12 +184,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 dca72aa5ebf1..58a23332ae14 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -760,7 +760,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,
@@ -781,6 +781,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,


More information about the Libreoffice-commits mailing list