summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-12-08 17:22:37 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2021-12-10 16:54:56 +0100
commit6e7cb1141ec9b8e7ca1e7d0e14125a69fe59b3c9 (patch)
treefd1d5a7b7d9e8ff14bdd1731d56675e806ff806f /vcl
parent55fe27bf56360c63b4349f2889734e964a2a0b68 (diff)
jsdialog: don't send back typed text for combobox
Do the same what we do for Edit fields for ComboBox entry: when content is changed by event coming from the client because user typed something - then don't send back updated text so it will not disturb typing. It was visible with slow debug builds. Change-Id: Ib73096c4b96ebfdfd038ed56234c31ff32a5cda3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126549 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/jsdialog/jsdialogbuilder.hxx1
-rw-r--r--vcl/jsdialog/executor.cxx7
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx5
3 files changed, 12 insertions, 1 deletions
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index e9102f7e9d8c..ed655ede8435 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -500,6 +500,7 @@ public:
virtual void insert(int pos, const OUString& rStr, const OUString* pId,
const OUString* pIconName, VirtualDevice* pImageSurface) override;
virtual void remove(int pos) override;
+ virtual void set_entry_text_without_notify(const OUString& rText);
virtual void set_entry_text(const OUString& rText) override;
virtual void set_active(int pos) override;
virtual bool changed_by_direct_pick() const override;
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index cddee247c531..8662b246e5f9 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -106,7 +106,12 @@ bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, StringM
}
else if (sAction == "change")
{
- pCombobox->set_entry_text(rData["data"]);
+ // it might be other class than JSComboBox
+ auto pJSCombobox = dynamic_cast<JSComboBox*>(pWidget);
+ if (pJSCombobox)
+ pJSCombobox->set_entry_text_without_notify(rData["data"]);
+ else
+ pCombobox->set_entry_text(rData["data"]);
LOKTrigger::trigger_changed(*pCombobox);
return true;
}
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 981ff5fb746a..a5bdd87033f6 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1243,6 +1243,11 @@ void JSComboBox::remove(int pos)
sendUpdate();
}
+void JSComboBox::set_entry_text_without_notify(const OUString& rText)
+{
+ SalInstanceComboBoxWithEdit::set_entry_text(rText);
+}
+
void JSComboBox::set_entry_text(const OUString& rText)
{
SalInstanceComboBoxWithEdit::set_entry_text(rText);