diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2020-04-14 14:49:23 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2020-04-23 09:35:51 +0200 |
commit | 0aaf94d75410cb41b572a64935db767f586ffa73 (patch) | |
tree | 9f6e7b7277dbd1143e1b258e97b6f0bf6afa4a36 /include | |
parent | 7b9878671a74dc9043d0cdc93e019fdd7d622e8c (diff) |
lokit: fix edit-text/view-cursor position
in case of views with heterogeneous zooms.
1. EditText render position fix
The EditView has an 'output-area' which is used to clip the rectangle
we pass to the Paint() call. It also holds on to the ScGridWindow
instance where the edit started. The 'output-area' of the EditView is in
the coordinates/units of the MapMode of the ScGridWindow it holds. So we
need to temporarily change the MapMode and 'output-area' of the EditView
in agreement to the device(with the current view's zoom settings) where
we are going to paint to. After we call the Paint(), we rollback the
original settings of the EditView.
2. EditViewCursor position fix
Before this change the cursor position in twips (calculated based on
pixel aligned cell position in the view where editing occurred) is
broadcasted to all the client-views. If the clients have different zooms, then
simply scaling this common cursor position in the client for its zoom
is not going to be accurate enough (due to the non-linear Logic->Pixel->Logic
transformation involving pixel rounding). This is very visible if you are
editing far away from A1 (like Z50).
The fix is to turn off this broadcast for calc-cell editing and send
view specific edit-cursor invalidation messages.
This is accompanied by a online.git patch that removes unnessecary
broadcast of view-cursor invalidation messages which messes up things again.
"Do not broadcast view-cursor invalidation messages"
(cherry picked from commit d58f1e334245f9e136750fbba267c2a941a213cc)
Conflicts:
editeng/source/editeng/impedit.cxx
editeng/source/editeng/impedit.hxx
Change-Id: Ib2fbbe4b6f93f26fc85d6adaa8684dd4397d886f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92631
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92721
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/editview.hxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 0f76948c3ffc..441dcb99c794 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -160,6 +160,8 @@ public: void Invalidate(); Pair Scroll( long nHorzScroll, long nVertScroll, ScrollRangeCheck nRangeCheck = ScrollRangeCheck::NoNegative ); + void SetBroadcastLOKViewCursor(bool bSet); + tools::Rectangle GetEditCursor() const; void ShowCursor( bool bGotoCursor = true, bool bForceVisCursor = true, bool bActivate = false ); void HideCursor( bool bDeactivate = false ); |