[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source

Canberk TURAN (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 8 17:08:12 UTC 2020


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

New commits:
commit 402f36efb215338ad545caa65d39fb8a39685ea1
Author:     Canberk TURAN <canberkkturann at gmail.com>
AuthorDate: Sun Jun 7 16:26:16 2020 +0300
Commit:     Xisco Fauli <xiscofauli at 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.kose at collabora.com>
    (cherry picked from commit 1e5cf1b3ebf39aee01ed2a3bfd5be7ee6f44d18e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95811
    Reviewed-by: Canberk TURAN <canberkkturann at gmail.com>
    Reviewed-by: Xisco Fauli <xiscofauli at 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;


More information about the Libreoffice-commits mailing list