diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2018-04-05 22:23:28 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2018-04-07 08:05:04 +0200 |
commit | 83b7bfc0efefb3c77e5c59553320e98539250c62 (patch) | |
tree | 1d23842491eb9f7bd12d315fa83ec85a9bf1cfff /sfx2/source/view | |
parent | 602774aef7d8b2f03914939dd230dd1c67d0093b (diff) |
sw lok: View jumps to cursor position even if it is moved by an other view.
Scrolling is done twice. Once in SwCursorShell::UpdateCursor() by
SCROLLWIN flag. Here we can check the actual viewid and avoid scrolling
if the cursor is move by an other user.
The second instance in the LO online code, for it we need to pass the
viewid identifying the view which moved the cursor.
Change-Id: I033274f88ce41acbb632e2aeb0d986ab11cd2d52
Reviewed-on: https://gerrit.libreoffice.org/52220
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sfx2/source/view')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index b84496be2c27..be2d5e3887a2 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -17,6 +17,7 @@ #include <sfx2/viewfrm.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <comphelper/lok.hxx> +#include <editeng/outliner.hxx> #include <shellimpl.hxx> @@ -199,6 +200,21 @@ void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OStri pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aBuf.makeStringAndClear().getStr()); } +void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* pThisView, const OString& rRectangle) +{ + OString sPayload; + if (comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation()) + { + sPayload = OString("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView()) + + "\", \"rectangle\": \"" + rRectangle + "\" }"; + } + else + { + sPayload = rRectangle; + } + pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sPayload.getStr()); +} + void SfxLokHelper::notifyAllViews(int nType, const OString& rPayload) { const auto payload = rPayload.getStr(); |