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-08 23:20:50 +0200 |
commit | 3551f91660d9dbcba69d6cc0b1a05b9d37c4edc1 (patch) | |
tree | 9702c15974f82f17cf68365ca7a066227431a43e | |
parent | 59636f1bd42be310ff0cff12f6c55c6395fb2cf5 (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
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93732
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-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 c68879c23aed..e39c5ced6a05 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -701,7 +701,10 @@ namespace sw::mark { if(m_aPortionPaintArea == rPortionPaintArea && m_pButton && m_pButton->IsVisible()) + { + SendLOKMessage("show"); return; + } m_aPortionPaintArea = rPortionPaintArea; if(m_pButton) @@ -763,7 +766,10 @@ namespace sw::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 90be64f1644a..27e4171bebc6 100644 --- a/sw/source/core/inc/bookmrk.hxx +++ b/sw/source/core/inc/bookmrk.hxx @@ -306,6 +306,7 @@ namespace sw { private: SwRect m_aPortionPaintArea; + OString m_sLastSentLOKMsg; }; /// Fieldmark representing a date form field. |