[Libreoffice-commits] core.git: sw/source

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Fri May 8 21:21:24 UTC 2020


 sw/source/core/crsr/bookmrk.cxx |    8 +++++++-
 sw/source/core/inc/bookmrk.hxx  |    1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 3551f91660d9dbcba69d6cc0b1a05b9d37c4edc1
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri May 8 15:26:57 2020 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri May 8 23:20:50 2020 +0200

    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 at collabora.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

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.


More information about the Libreoffice-commits mailing list