From ad9ed8a247cb644670ab59612d7318dc2c3684e2 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Tue, 14 Jul 2026 19:13:46 -0400 Subject: [PATCH] tdf#93875 sw viewsrch: avoid bogus found selection from UnSelectFrame In the Quick Find or Find&Replace dialog, after a match is found, then if some frame had the selection, then the visible selection is changed to cover the match. However, UnSelectFrame actually sets the cursor as it disengages. Well, we don't care about that cursor change, so just drop it and restore the match-selection. Change-Id: If5d7968f4541954defeead39306be685c872a73e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208129 Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/source/uibase/uiview/viewsrch.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index bb83a5c023f5..9e0eb4639224 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -517,8 +517,10 @@ bool SwView::SearchAndWrap(bool bApi) s_bFound = true; if(m_pWrtShell->IsSelFrameMode()) { + m_pWrtShell->Push(); // push the 'found' cursor to the stack m_pWrtShell->UnSelectFrame(); m_pWrtShell->LeaveSelFrameMode(); + m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent); // restore stack cursor } m_pWrtShell->Pop(); m_pWrtShell->EndAllAction();