diff options
author | Bayram Çiçek <mail@bayramcicek.com.tr> | 2021-07-08 12:56:23 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2021-08-20 11:13:21 +0200 |
commit | 4bb59cd1f45133994d3d13642367470f528094f4 (patch) | |
tree | 575dd198a85b01560f4be9efd3cb8cedde2c6c9c /sw/source/uibase | |
parent | fc7fbbd8ba089570c93917eedf1de0512cc0ba3b (diff) |
tdf#91519: prevent jump to top of the comment view
In Writer,
there are 3 issues about comment section:
- comment section scrolls to top of its view
when clicking inside a comment view.
- clicking inside a comment view, scrolls the
view to old cursor location automatically
(if old cursor out of the visible area)
- comment section scrolls automatically to the
old *selected* text (if it's out of visible area)
when clicking inside the Writer canvas view
this commit is intended to solve these issues
Change-Id: If7d62373f5215adea85512b66b78736e04e02c3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118638
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/docvw/AnnotationWin2.cxx | 17 | ||||
-rw-r--r-- | sw/source/uibase/docvw/SidebarTxtControl.cxx | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 12988e4d3343..19f663f9895c 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -994,7 +994,10 @@ void SwAnnotationWin::ActivatePostIt() CheckMetaText(); SetViewState(ViewState::EDIT); - GetOutlinerView()->ShowCursor(); + + // prevent autoscroll to the old cursor location + // when cursor out of visible area + GetOutlinerView()->ShowCursor(false); mpOutlinerView->GetEditView().SetInsertMode(mrView.GetWrtShellPtr()->IsInsMode()); @@ -1168,10 +1171,10 @@ bool SwAnnotationWin::SetActiveSidebarWin() { if (mrMgr.GetActiveSidebarWin() == this) return false; - const bool bLockView = mrView.GetWrtShell().IsViewLocked(); mrView.GetWrtShell().LockView( true ); mrMgr.SetActiveSidebarWin(this); - mrView.GetWrtShell().LockView( bLockView ); + mrView.GetWrtShell().LockView( true ); + return true; } @@ -1179,10 +1182,14 @@ void SwAnnotationWin::UnsetActiveSidebarWin() { if (mrMgr.GetActiveSidebarWin() != this) return; - const bool bLockView = mrView.GetWrtShell().IsViewLocked(); mrView.GetWrtShell().LockView( true ); mrMgr.SetActiveSidebarWin(nullptr); - mrView.GetWrtShell().LockView( bLockView ); + mrView.GetWrtShell().LockView( false ); +} + +void SwAnnotationWin::LockView(bool bLock) +{ + mrView.GetWrtShell().LockView( bLock ); } IMPL_LINK(SwAnnotationWin, ScrollHdl, weld::ScrolledWindow&, rScrolledWindow, void) diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx index b9dde38dc1a7..ba544b7c88dd 100644 --- a/sw/source/uibase/docvw/SidebarTxtControl.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx @@ -147,6 +147,8 @@ void SidebarTextControl::LoseFocus() { Invalidate(); } + // set false for autoscroll to typing location + mrSidebarWin.LockView(false); } OUString SidebarTextControl::RequestHelp(tools::Rectangle& rHelpRect) |