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

New commits:
commit d2819832dcd092195c2c2dec5450dba6bd86b045
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue May 17 13:12:49 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue May 17 21:26:47 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>
    (cherry picked from commit e2ff01a08a70a96517287ac9b9e9de6fbfd6a00b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134445
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index ad7e9e697d04..461f7c8afa58 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