summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-03-25 13:04:08 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-05-22 14:39:23 +0200
commit702417af43342f36bf635ef4224c7d65597b4de8 (patch)
tree886d58b92ac7a5988bb73157ea97d3c070511f99
parent4de6ccf7bc1a7f4a70449fdd62ccf7ce291d3547 (diff)
jsdialog: resend JSON only if changed
Change-Id: I80a0faf7544c66e30576d2342315a1f9f508fc12
-rw-r--r--include/vcl/jsdialog/jsdialogbuilder.hxx17
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx12
2 files changed, 16 insertions, 13 deletions
diff --git a/include/vcl/jsdialog/jsdialogbuilder.hxx b/include/vcl/jsdialog/jsdialogbuilder.hxx
index 85684c222e39..cebf6a8bc543 100644
--- a/include/vcl/jsdialog/jsdialogbuilder.hxx
+++ b/include/vcl/jsdialog/jsdialogbuilder.hxx
@@ -98,24 +98,21 @@ public:
{
}
- virtual void show() override
+ virtual void set_visible(bool visible) override
{
- BaseInstanceClass::show();
- notifyDialogState();
- }
-
- virtual void hide() override
- {
- BaseInstanceClass::hide();
- notifyDialogState();
+ bool change = visible != BaseInstanceClass::get_visible();
+ BaseInstanceClass::set_visible(visible);
+ if (change)
+ notifyDialogState();
}
virtual void set_sensitive(bool sensitive) override
{
bool change = sensitive != BaseInstanceClass::get_sensitive();
BaseInstanceClass::set_sensitive(sensitive);
- if (change)
+ if (change) {
notifyDialogState();
+ }
}
};
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 643bd29403dc..52c3de7b7255 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -327,8 +327,10 @@ JSLabel::JSLabel(VclPtr<vcl::Window> aOwnedToplevel, FixedText* pLabel,
void JSLabel::set_label(const OUString& rText)
{
+ bool change = get_label() != rText;
SalInstanceLabel::set_label(rText);
- notifyDialogState();
+ if (change)
+ notifyDialogState();
};
JSButton::JSButton(VclPtr<vcl::Window> aOwnedToplevel, ::Button* pButton,
@@ -345,8 +347,10 @@ JSEntry::JSEntry(VclPtr<vcl::Window> aOwnedToplevel, ::Edit* pEntry, SalInstance
void JSEntry::set_text(const OUString& rText)
{
+ bool change = get_text() != rText;
SalInstanceEntry::set_text(rText);
- notifyDialogState();
+ if (change)
+ notifyDialogState();
}
JSListBox::JSListBox(VclPtr<vcl::Window> aOwnedToplevel, ::ListBox* pListBox,
@@ -479,8 +483,10 @@ JSCheckButton::JSCheckButton(VclPtr<vcl::Window> aOwnedToplevel, ::CheckBox* pCh
void JSCheckButton::set_state(TriState eState)
{
+ bool change = get_state() != eState;
SalInstanceCheckButton::set_state(eState);
- notifyDialogState();
+ if (change)
+ notifyDialogState();
}
JSTreeView::JSTreeView(VclPtr<vcl::Window> aOwnedToplevel, ::SvTabListBox* pTreeView,