sw/source/uibase/docvw/edtwin.cxx    |   16 ++++++++++++++--
 sw/source/uibase/uiview/viewport.cxx |    3 ++-
 2 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 862483386614347e45ffdde69e109d4d2dd25fd2
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Thu Mar 27 08:33:51 2025 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Sat Mar 29 08:14:53 2025 +0100

    tdf#50743 improve scrolling with selection
    
    Second attempt to improve scrolling whith selection after
    47bf215cc7693bde89143f63b88556c61a68a132
    
    Change-Id: I46b321b7e0706ef0975e7078018d75ef64d65897
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183361
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Tested-by: Jenkins
    Tested-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 2a8e63afcf83..e1655da968eb 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -672,8 +672,20 @@ IMPL_LINK_NOARG(SwEditWin, TimerHandler, Timer *, void)
             rSh.Drag(&aModPt, false);
             bDone = true;
         }
-        if ( !bDone )
-            aModPt = rSh.GetContentPos( aModPt,aModPt.Y() > 
rSh.VisArea().Bottom() );
+        if (!bDone)
+        {
+            bool bForward = aModPt.Y() > rSh.VisArea().Bottom();
+            if (m_xRowColumnSelectionStart)
+                aModPt = rSh.GetContentPos( aModPt, bForward );
+            else
+            {
+                sal_Int32 nMove = (aOldVis.Bottom() - aOldVis.Top()) / 20;
+                if (bForward)
+                    aModPt.setY(aOldVis.Bottom() + nMove);
+                else
+                    aModPt.setY(aOldVis.Top() - nMove);
+            }
+        }
     }
     if ( !bDone && !(g_bFrameDrag || m_bInsDraw) )
     {
diff --git a/sw/source/uibase/uiview/viewport.cxx 
b/sw/source/uibase/uiview/viewport.cxx
index 84e6f383341a..26275190f17b 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -355,8 +355,9 @@ void SwView::CalcPt( Point *pPt, const tools::Rectangle 
&rRect, sal_uInt16 nRang
         nYScroll = m_aVisArea.Top() > rRect.Top() ?
             m_aVisArea.Top() - rRect.Top() :
             rRect.Bottom() - m_aVisArea.Bottom();
+
         if (eScrollSizeMode == ScrollSizeMode::ScrollSizeTimer)
-             nYScroll = std::min(nDefaultYScroll, nYScroll * 5);
+             nYScroll = std::min(nDefaultYScroll, nYScroll);
         else if (eScrollSizeMode == ScrollSizeMode::ScrollSizeTimer2)
              nYScroll = 2 * nDefaultYScroll;
     }

Reply via email to