From d814941b31b4f9cc8b6e9bd4ddc5188015529707 Mon Sep 17 00:00:00 2001
From: Michael Stahl <michael.stahl@allotropia.de>
Date: Tue, 8 Mar 2022 13:54:08 +0100
Subject: sw_redlinehide: get text from shell, not node in ExecSpellPopup()

Change-Id: I0160c4927a2f5e71f5025c2162a103f67ed03723
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131209
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
---
 sw/source/uibase/uiview/viewling.cxx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'sw/source/uibase')

diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 93b2d5577da9..854108274fbe 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -692,7 +692,14 @@ bool SwView::ExecSpellPopup(const Point& rPt)
                 // get paragraph text
                 OUString aParaText;
                 if (pNode)
-                    aParaText = pNode->GetText();    // this may include hidden text but that should be Ok
+                {
+                    pCursorShell->Push();
+                    pCursorShell->MovePara(GoCurrPara, fnParaStart);
+                    pCursorShell->SetMark();
+                    pCursorShell->MovePara(GoCurrPara, fnParaEnd);
+                    aParaText = pCursorShell->GetSelText();
+                    pCursorShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
+                }
                 else
                 {
                     OSL_FAIL("text node expected but not found" );
-- 
cgit