summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-10-15 08:43:23 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-10-24 01:40:45 +0200
commit273a25c796fca9afa0dfadac57dc3f336831221c (patch)
tree3efb1e505e27164bcdb2c164c59a48c814221ffe /sw/inc
parent667c2499d861cfcd26935fc0512cb5aaf602c4c5 (diff)
change some LOK internal updates to be pull model instead of push
Some LOK messages may get called very often, such as updates about cursor position. And since only the last one matters, they get generated every time, which costs some time, and then later except for one they get all discard again from CallbackFlushHandler queue, which again costs time. Change the model to instead only set an 'updated' flag, and CallbackFlushHandler will request the actual message payload only before flushing. This commit changes LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR and LOK_CALLBACK_INVALIDATE_VIEW_CURSOR to work this way. Change-Id: I376be63176c0b4b5cb492fbf529c21ed01b35481 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124083 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/view.hxx1
-rw-r--r--sw/inc/viscrs.hxx3
2 files changed, 4 insertions, 0 deletions
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 7a5423732a6e..2f6381469d34 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -693,6 +693,7 @@ public:
virtual tools::Rectangle getLOKVisibleArea() const override;
virtual void flushPendingLOKInvalidateTiles() override;
+ virtual OString getLOKPayload(int nType, int nViewId) const override;
};
inline tools::Long SwView::GetXScroll() const
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index 9ad0753f0bc0..c8b8b356f7e3 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -43,6 +43,7 @@ class SW_DLLPUBLIC SwVisibleCursor
/// For LibreOfficeKit only - remember what page we were at the last time.
sal_uInt16 m_nPageLastTime;
+ SwRect m_aLastLOKRect;
bool m_bIsVisible;
bool m_bIsDragCursor;
@@ -58,6 +59,8 @@ public:
void SetDragCursor( bool bFlag = true ) { m_bIsDragCursor = bFlag; }
void SetPosAndShow(SfxViewShell const * pViewShell);
const vcl::Cursor& GetTextCursor() const;
+
+ OString getLOKPayload(int nType, int nViewId) const;
};
// From here classes/methods for selections.