sw/source/uibase/uiview/viewling.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit e2ff01a08a70a96517287ac9b9e9de6fbfd6a00b
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue May 17 13:12:49 2022 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue May 17 19:02:57 2022 +0200

    tdf#148869 sw_redlinehide: fix SwView::ExecSpellPopup()
    
    How could i forget that MovePara(GoCurrPara, fnParaStart) will move to
    a previous paragraph when it's already at the start of the current one,
    it's so intuitive.
    
    (regression from commit d814941b31b4f9cc8b6e9bd4ddc5188015529707)
    
    Change-Id: Ief9bcd42b7ea78feef50ac42bc93580c29c080b2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134468
    Tested-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index 854108274fbe..d7c6fa406a43 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -694,9 +694,15 @@ bool SwView::ExecSpellPopup(const Point& rPt)
                 if (pNode)
                 {
                     pCursorShell->Push();
-                    pCursorShell->MovePara(GoCurrPara, fnParaStart);
+                    if (!pCursorShell->IsSttPara())
+                    {
+                        pCursorShell->MovePara(GoCurrPara, fnParaStart);
+                    }
                     pCursorShell->SetMark();
-                    pCursorShell->MovePara(GoCurrPara, fnParaEnd);
+                    if (!pCursorShell->IsEndPara())
+                    {
+                        pCursorShell->MovePara(GoCurrPara, fnParaEnd);
+                    }
                     aParaText = pCursorShell->GetSelText();
                     pCursorShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
                 }

Reply via email to