Kaydet (Commit) 245dddf1 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#704280 Logically dead code

Change-Id: I4ba45a63373d5edf709688594cd25be4ff1385ec
üst eae56604
...@@ -176,7 +176,7 @@ private: ...@@ -176,7 +176,7 @@ private:
void InitScrollBar( ScrollBar& rScrollBar, long nMaxVal ); void InitScrollBar( ScrollBar& rScrollBar, long nMaxVal );
DECL_LINK( ScrollHdl, ScrollBar* ); DECL_LINK( ScrollHdl, ScrollBar* );
DECL_LINK( EndScrollHdl, ScrollBar* ); DECL_LINK( EndScrollHdl, void* );
DECL_LINK( SplitHdl, Splitter* ); DECL_LINK( SplitHdl, Splitter* );
void DoHSplit(long nSplitPos); void DoHSplit(long nSplitPos);
......
...@@ -979,7 +979,7 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ) ...@@ -979,7 +979,7 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
return bDone; return bDone;
} }
IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll ) IMPL_LINK_NOARG(ScTabView, EndScrollHdl)
{ {
if ( bDragging ) if ( bDragging )
{ {
...@@ -991,8 +991,6 @@ IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll ) ...@@ -991,8 +991,6 @@ IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll )
IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll ) IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
{ {
sal_Bool bOnlineScroll = sal_True; //! Optionen
bool bHoriz = ( pScroll == &aHScrollLeft || pScroll == &aHScrollRight ); bool bHoriz = ( pScroll == &aHScrollLeft || pScroll == &aHScrollRight );
long nViewPos; long nViewPos;
if ( bHoriz ) if ( bHoriz )
...@@ -1071,73 +1069,70 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll ) ...@@ -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(); case SCROLL_LINEUP:
switch ( eType ) nDelta = -1;
{ break;
case SCROLL_LINEUP: case SCROLL_LINEDOWN:
nDelta = -1; nDelta = 1;
break; break;
case SCROLL_LINEDOWN: case SCROLL_PAGEUP:
nDelta = 1; if ( pScroll == &aHScrollLeft ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_LEFT );
break; if ( pScroll == &aHScrollRight ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_RIGHT );
case SCROLL_PAGEUP: if ( pScroll == &aVScrollTop ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_TOP );
if ( pScroll == &aHScrollLeft ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_LEFT ); if ( pScroll == &aVScrollBottom ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_BOTTOM );
if ( pScroll == &aHScrollRight ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_RIGHT ); if (nDelta==0) nDelta=-1;
if ( pScroll == &aVScrollTop ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_TOP ); break;
if ( pScroll == &aVScrollBottom ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_BOTTOM ); case SCROLL_PAGEDOWN:
if (nDelta==0) nDelta=-1; if ( pScroll == &aHScrollLeft ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
break; if ( pScroll == &aHScrollRight ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
case SCROLL_PAGEDOWN: if ( pScroll == &aVScrollTop ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP );
if ( pScroll == &aHScrollLeft ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT ); if ( pScroll == &aVScrollBottom ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
if ( pScroll == &aHScrollRight ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT ); if (nDelta==0) nDelta=1;
if ( pScroll == &aVScrollTop ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP ); break;
if ( pScroll == &aVScrollBottom ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM ); case SCROLL_DRAG:
if (nDelta==0) nDelta=1; {
break; // nur in die richtige Richtung scrollen, nicht um ausgeblendete
case SCROLL_DRAG: // 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 if (nDelta<0) nDelta=0;
// 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;
} }
break; else if ( nScrollPos < nPrevDragPos )
default: {
{ if (nDelta>0) nDelta=0;
// added to avoid warnings }
else
nDelta = 0;
nPrevDragPos = nScrollPos;
} }
} break;
default:
if (nDelta)
{ {
sal_Bool bUpdate = ( eType != SCROLL_DRAG ); // bei Drag die Ranges nicht aendern // added to avoid warnings
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 );
} }
} }
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; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment