sw/source/core/crsr/swcrsr.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 402f36efb215338ad545caa65d39fb8a39685ea1
Author:     Canberk TURAN <canberkktur...@gmail.com>
AuthorDate: Sun Jun 7 16:26:16 2020 +0300
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Jun 8 19:07:41 2020 +0200

    tdf#131990 MACROS: fixes return value of UpDown Method
    
    This patch fixes bRet return value of UpDown method in
    sw/source/core/crsr/swcrsr.cxx. Before this patch UpDown method always 
returns true.
    
    Change-Id: I5ebe4bef4e6b9d7ace4941c31e9d5a03c2023997
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95669
    Tested-by: Jenkins
    Reviewed-by: Gülşah Köse <gulsah.k...@collabora.com>
    (cherry picked from commit 1e5cf1b3ebf39aee01ed2a3bfd5be7ee6f44d18e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95811
    Reviewed-by: Canberk TURAN <canberkktur...@gmail.com>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 6067bfe414d4..9a7c84a44b9f 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -2036,6 +2036,7 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
                 }
                 pFrame->GetModelPositionForViewPoint( GetPoint(), aPt, 
&eTmpState );
             }
+            bRet = !IsSelOvr( SwCursorSelOverFlags::Toggle | 
SwCursorSelOverFlags::ChangePos );
         }
         else
         {
@@ -2047,12 +2048,17 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
             //if cursor has already been at start or end of file,
             //Update cursor to change nUpDownX.
             if ( aOldPos.nContent.GetIndex() == nOffset )
+            {
                 GetDoc()->GetEditShell()->UpdateCursor();
-            else
+                bRet = false;
+            }
+            else{
                 *GetPoint() = aPos; // just give a new position
+                bRet = true;
+            }
+
         }
 
-        bRet = !IsSelOvr( SwCursorSelOverFlags::Toggle | 
SwCursorSelOverFlags::ChangePos );
         DoSetBidiLevelUpDown(); // calculate cursor bidi level
     }
     return bRet;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to