summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabview.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/tabview.cxx')
-rw-r--r--sc/source/ui/view/tabview.cxx40
1 files changed, 19 insertions, 21 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 9142393a9152..dea6dbb7810d 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1170,7 +1170,6 @@ void ScTabView::ScrollHdl(ScrollAdaptor* pScroll)
if ( pScroll == aVScrollBottom.get() ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
if (nDelta==0) nDelta=1;
break;
- default: // added to avoid warnings
case ScrollType::Drag:
{
// only scroll in the correct direction, do not jitter around hidden ranges
@@ -1182,31 +1181,30 @@ void ScTabView::ScrollHdl(ScrollAdaptor* pScroll)
tools::Long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
nDelta = nScrollPos - nViewPos;
-
- // tdf#152406 Disable anti-jitter code for scroll wheel events
- // After moving thousands of columns to the right via
- // horizontal scroll wheel or trackpad swipe events, most
- // vertical scroll wheel or trackpad swipe events will trigger
- // the anti-jitter code because nScrollPos and nPrevDragPos
- // will be equal and nDelta will be overriden and set to zero.
- // So, only use the anti-jitter code for mouse drag events.
- if ( eType == ScrollType::Drag )
+ if ( nScrollPos > nPrevDragPos )
{
- if ( nScrollPos > nPrevDragPos )
- {
- if (nDelta<0) nDelta=0;
- }
- else if ( nScrollPos < nPrevDragPos )
- {
- if (nDelta>0) nDelta=0;
- }
- else
- nDelta = 0;
+ if (nDelta<0) nDelta=0;
}
-
+ else if ( nScrollPos < nPrevDragPos )
+ {
+ if (nDelta>0) nDelta=0;
+ }
+ else
+ nDelta = 0;
nPrevDragPos = nScrollPos;
}
break;
+ default:
+ // Note tdf#152406 no anti-jitter code, unlike ScrollType::Drag,
+ // for scroll wheel events.
+ // After moving thousands of columns to the right via horizontal
+ // scroll wheel or trackpad swipe events, most vertical scroll
+ // wheel or trackpad swipe events would trigger the anti-jitter
+ // code because nScrollPos and nPrevDragPos would be equal and
+ // nDelta will be overriden and set to zero. So, only use the
+ // anti-jitter code for mouse drag events.
+ nDelta = GetScrollBarPos(*pScroll) - nViewPos;
+ break;
}
if (nDelta)