summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2020-04-14 14:49:23 +0530
committerMichael Meeks <michael.meeks@collabora.com>2020-04-22 11:29:27 +0200
commitd58f1e334245f9e136750fbba267c2a941a213cc (patch)
treeeeb3f729190a0daddbe46cd3022ea5a8ba9d5ff9 /include
parent62c1dd2b26d66231d2941ff40664b455634333e5 (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" 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>
Diffstat (limited to 'include')
-rw-r--r--include/editeng/editview.hxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index b516e4484eb1..1d9ceece9d59 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -149,6 +149,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 );