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.cxx119
1 files changed, 57 insertions, 62 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 7aa8cee0e344..b9307f8f62ee 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -979,7 +979,7 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
return bDone;
}
-IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll )
+IMPL_LINK_NOARG(ScTabView, EndScrollHdl)
{
if ( bDragging )
{
@@ -991,8 +991,6 @@ IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll )
IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
{
- sal_Bool bOnlineScroll = sal_True; //! Optionen
-
bool bHoriz = ( pScroll == &aHScrollLeft || pScroll == &aHScrollRight );
long nViewPos;
if ( bHoriz )
@@ -1071,73 +1069,70 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
}
}
- if ( bOnlineScroll || eType != SCROLL_DRAG )
+ long nDelta = pScroll->GetDelta();
+ switch ( eType )
{
- long nDelta = pScroll->GetDelta();
- switch ( eType )
- {
- case SCROLL_LINEUP:
- nDelta = -1;
- break;
- case SCROLL_LINEDOWN:
- nDelta = 1;
- break;
- case SCROLL_PAGEUP:
- if ( pScroll == &aHScrollLeft ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_LEFT );
- if ( pScroll == &aHScrollRight ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_RIGHT );
- if ( pScroll == &aVScrollTop ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_TOP );
- if ( pScroll == &aVScrollBottom ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_BOTTOM );
- if (nDelta==0) nDelta=-1;
- break;
- case SCROLL_PAGEDOWN:
- if ( pScroll == &aHScrollLeft ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
- if ( pScroll == &aHScrollRight ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
- if ( pScroll == &aVScrollTop ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP );
- if ( pScroll == &aVScrollBottom ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
- if (nDelta==0) nDelta=1;
- break;
- case SCROLL_DRAG:
+ case SCROLL_LINEUP:
+ nDelta = -1;
+ break;
+ case SCROLL_LINEDOWN:
+ nDelta = 1;
+ break;
+ case SCROLL_PAGEUP:
+ if ( pScroll == &aHScrollLeft ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_LEFT );
+ if ( pScroll == &aHScrollRight ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_RIGHT );
+ if ( pScroll == &aVScrollTop ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_TOP );
+ if ( pScroll == &aVScrollBottom ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_BOTTOM );
+ if (nDelta==0) nDelta=-1;
+ break;
+ case SCROLL_PAGEDOWN:
+ if ( pScroll == &aHScrollLeft ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
+ if ( pScroll == &aHScrollRight ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
+ if ( pScroll == &aVScrollTop ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP );
+ if ( pScroll == &aVScrollBottom ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
+ if (nDelta==0) nDelta=1;
+ break;
+ case SCROLL_DRAG:
+ {
+ // nur in die richtige Richtung scrollen, nicht um ausgeblendete
+ // Bereiche herumzittern
+
+ long nScrollMin = 0; // RangeMin simulieren
+ if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == &aHScrollRight )
+ nScrollMin = aViewData.GetFixPosX();
+ if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == &aVScrollBottom )
+ nScrollMin = aViewData.GetFixPosY();
+
+ long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
+ nDelta = nScrollPos - nViewPos;
+ if ( nScrollPos > nPrevDragPos )
{
- // nur in die richtige Richtung scrollen, nicht um ausgeblendete
- // Bereiche herumzittern
-
- long nScrollMin = 0; // RangeMin simulieren
- if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == &aHScrollRight )
- nScrollMin = aViewData.GetFixPosX();
- if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == &aVScrollBottom )
- nScrollMin = aViewData.GetFixPosY();
-
- long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
- nDelta = nScrollPos - nViewPos;
- if ( nScrollPos > nPrevDragPos )
- {
- if (nDelta<0) nDelta=0;
- }
- else if ( nScrollPos < nPrevDragPos )
- {
- if (nDelta>0) nDelta=0;
- }
- else
- nDelta = 0;
- nPrevDragPos = nScrollPos;
+ if (nDelta<0) nDelta=0;
}
- break;
- default:
- {
- // added to avoid warnings
+ else if ( nScrollPos < nPrevDragPos )
+ {
+ if (nDelta>0) nDelta=0;
+ }
+ else
+ nDelta = 0;
+ nPrevDragPos = nScrollPos;
}
- }
-
- if (nDelta)
+ break;
+ default:
{
- sal_Bool bUpdate = ( eType != SCROLL_DRAG ); // bei Drag die Ranges nicht aendern
- if ( bHoriz )
- ScrollX( nDelta, (pScroll == &aHScrollLeft) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT, bUpdate );
- else
- ScrollY( nDelta, (pScroll == &aVScrollTop) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM, bUpdate );
+ // added to avoid warnings
}
}
+ if (nDelta)
+ {
+ sal_Bool bUpdate = ( eType != SCROLL_DRAG ); // bei Drag die Ranges nicht aendern
+ if ( bHoriz )
+ ScrollX( nDelta, (pScroll == &aHScrollLeft) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT, bUpdate );
+ else
+ ScrollY( nDelta, (pScroll == &aVScrollTop) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM, bUpdate );
+ }
+
return 0;
}