sw/source/uibase/docvw/PostItMgr.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit bfa56c3cabcc4bf037606b4acae325a8a5fd966b Author: Andreas Heinisch <andreas.heini...@yahoo.de> AuthorDate: Fri Apr 4 10:12:59 2025 +0200 Commit: Andreas Heinisch <andreas.heini...@yahoo.de> CommitDate: Fri Apr 4 11:58:00 2025 +0200 tdf#136540 - Prevent scrolling to cursor during deletion of annotations Change-Id: Id71030736233c39100b61dd95581dbd079c07c5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183698 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de> diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 7dbe84eea88a..678663e426ab 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -1620,6 +1620,10 @@ void SwPostItMgr::Delete(const OUString& rAuthor) if (!ConfirmDeleteAll(mpWrtShell->GetView(), sQuestion)) return; + // tdf#136540 - prevent scrolling to cursor during deletion of annotations + const bool bUnLockView = !mpWrtShell->IsViewLocked(); + mpWrtShell->LockView(true); + mpWrtShell->StartAllAction(); if (HasActiveSidebarWin() && (GetActiveSidebarWin()->GetAuthor() == rAuthor)) { @@ -1644,6 +1648,10 @@ void SwPostItMgr::Delete(const OUString& rAuthor) mbLayout = true; CalcRects(); LayoutPostIts(); + + // tdf#136540 - prevent scrolling to cursor during deletion of annotations + if (bUnLockView) + mpWrtShell->LockView(false); } void SwPostItMgr::Delete(sal_uInt32 nPostItId)