diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2020-05-08 15:26:57 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2020-05-09 09:36:15 +0200 |
commit | 5beba4976f09c3b5f6e9adf6ba03c6db41639518 (patch) | |
tree | 6233ddfe424475428bf8a84eb96b45f6eb196245 /sw | |
parent | 5c325eb0e6867eec42d234ade6eb65da99e4fde1 (diff) |
lok: MSForms: send button message also when paint area is not changing.
We can filter out duplicated messages with storing the last
message.
Ignoring messages with the same paint area is a problem, if
we change the drop down field content to a new item with
the same size.
Change-Id: Ie2e0bab445eb0e6e5b9b25846adbd79af55e7816
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/bookmrk.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/inc/bookmrk.hxx | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 53300c97863a..d32d66404efe 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -557,7 +557,10 @@ namespace sw { namespace mark { if(m_aPortionPaintArea == rPortionPaintArea && m_pButton && m_pButton->IsVisible()) + { + SendLOKMessage("show"); return; + } m_aPortionPaintArea = rPortionPaintArea; if(m_pButton) @@ -625,7 +628,10 @@ namespace sw { namespace mark { sPayload = "{\"action\": \"hide\", \"type\": \"drop-down\"}"; } - pEditWin->GetView().GetWrtShell().GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON, sPayload.toString().getStr()); + if (sPayload.toString() != m_sLastSentLOKMsg) { + m_sLastSentLOKMsg = sPayload.toString(); + pEditWin->GetView().GetWrtShell().GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_FORM_FIELD_BUTTON, m_sLastSentLOKMsg.getStr()); + } } } diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx index c156a86c9772..ebbc0c944b87 100644 --- a/sw/source/core/inc/bookmrk.hxx +++ b/sw/source/core/inc/bookmrk.hxx @@ -305,6 +305,7 @@ namespace sw { private: SwRect m_aPortionPaintArea; + OString m_sLastSentLOKMsg; }; /// Fieldmark representing a date form field. |