summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-05-30 14:18:23 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-05-30 18:27:30 +0200
commit35a79eac56f8b93b62de555ea92c28304f2333d9 (patch)
tree131d0ccabbefd5dccce5bca9401486210a66ac99 /sw/source
parent05bc773b0e88b408a997ffa5851cc9207d3303e5 (diff)
sw: fix infinite recursion in SwEditWin::GetSurroundingText()
This is basically the same as what was fixed by commit 581ba395222e04e43697484bef9181c877d1fd61 and i'm not sure why this problem is now happening here. Change-Id: I0769d1aa0980031452b69c48dee7aaef211df25e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152390 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 147ae7b1d427..648ea2334583 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -6647,6 +6647,9 @@ OUString SwEditWin::GetSurroundingText() const
{
bool bUnLockView = !rSh.IsViewLocked();
rSh.LockView(true);
+
+ // store shell state *before* Push
+ ::std::optional<SwCallLink> aLink(std::in_place, rSh);
rSh.Push();
// disable accessible events for internal-only helper cursor
@@ -6660,7 +6663,7 @@ OUString SwEditWin::GetSurroundingText() const
rSh.GoEndSentence();
rSh.GetSelectedText( sReturn, ParaBreakType::ToOnlyCR );
- rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
+ rSh.Pop(SwCursorShell::PopMode::DeleteCurrent, aLink);
rSh.SetSendAccessibleCursorEvents(bSendAccessibleEventOld);
rSh.HideCursor();