[Libreoffice-commits] core.git: sc/source
Eike Rathke
erack at redhat.com
Wed Jan 20 13:09:57 PST 2016
sc/source/ui/view/tabview3.cxx | 78 +++++++++++++++++++++++++++--------------
1 file changed, 52 insertions(+), 26 deletions(-)
New commits:
commit 24b9f873a691f4cfe4b3fa2c2a48f79a41a12417
Author: Eike Rathke <erack at redhat.com>
Date: Wed Jan 20 22:07:08 2016 +0100
there's no reason to be sparing with new lines
Change-Id: Id8334694aec17ec61490460b0917514beebd94a3
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 6aa1139..0dd373c 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -832,13 +832,15 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
{
nNewDeltaX = nCurX - static_cast<SCsCOL>(aViewData.CellsAtX( nCurX, -1, eAlignX, static_cast<sal_uInt16>(nSpaceX) ));
- if (nNewDeltaX < 0) nNewDeltaX = 0;
+ if (nNewDeltaX < 0)
+ nNewDeltaX = 0;
nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
}
if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY || bForceNew )
{
nNewDeltaY = nCurY - static_cast<SCsROW>(aViewData.CellsAtY( nCurY, -1, eAlignY, static_cast<sal_uInt16>(nSpaceY) ));
- if (nNewDeltaY < 0) nNewDeltaY = 0;
+ if (nNewDeltaY < 0)
+ nNewDeltaY = 0;
nSizeY = (SCsROW) aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
}
bDoLine = true;
@@ -852,13 +854,15 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
{
nNewDeltaX = nDeltaX + nCurX - aViewData.GetCurX();
- if (nNewDeltaX < 0) nNewDeltaX = 0;
+ if (nNewDeltaX < 0)
+ nNewDeltaX = 0;
nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
}
if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY )
{
nNewDeltaY = nDeltaY + nCurY - aViewData.GetCurY();
- if (nNewDeltaY < 0) nNewDeltaY = 0;
+ if (nNewDeltaY < 0)
+ nNewDeltaY = 0;
nSizeY = (SCsROW) aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
}
@@ -867,13 +871,15 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
if ( nCurX < nNewDeltaX || nCurX >= nNewDeltaX+nSizeX )
{
nNewDeltaX = nCurX - (nSizeX / 2);
- if (nNewDeltaX < 0) nNewDeltaX = 0;
+ if (nNewDeltaX < 0)
+ nNewDeltaX = 0;
nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
}
if ( nCurY < nNewDeltaY || nCurY >= nNewDeltaY+nSizeY )
{
nNewDeltaY = nCurY - (nSizeY / 2);
- if (nNewDeltaY < 0) nNewDeltaY = 0;
+ if (nNewDeltaY < 0)
+ nNewDeltaY = 0;
nSizeY = (SCsROW) aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
}
@@ -907,22 +913,30 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
++nNewDeltaY;
nSizeY = (SCsROW) aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
}
- if ( nCurX < nNewDeltaX ) nNewDeltaX = nCurX;
- if ( nCurY < nNewDeltaY ) nNewDeltaY = nCurY;
+ if ( nCurX < nNewDeltaX )
+ nNewDeltaX = nCurX;
+ if ( nCurY < nNewDeltaY )
+ nNewDeltaY = nCurY;
}
if ( nNewDeltaX != nDeltaX )
nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
- if (nNewDeltaX+nSizeX-1 > MAXCOL) nNewDeltaX = MAXCOL-nSizeX+1;
- if (nNewDeltaX < 0) nNewDeltaX = 0;
+ if (nNewDeltaX+nSizeX-1 > MAXCOL)
+ nNewDeltaX = MAXCOL-nSizeX+1;
+ if (nNewDeltaX < 0)
+ nNewDeltaX = 0;
if ( nNewDeltaY != nDeltaY )
nSizeY = (SCsROW) aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
- if (nNewDeltaY+nSizeY-1 > MAXROW) nNewDeltaY = MAXROW-nSizeY+1;
- if (nNewDeltaY < 0) nNewDeltaY = 0;
+ if (nNewDeltaY+nSizeY-1 > MAXROW)
+ nNewDeltaY = MAXROW-nSizeY+1;
+ if (nNewDeltaY < 0)
+ nNewDeltaY = 0;
- if ( nNewDeltaX != nDeltaX ) ScrollX( nNewDeltaX - nDeltaX, eAlignX );
- if ( nNewDeltaY != nDeltaY ) ScrollY( nNewDeltaY - nDeltaY, eAlignY );
+ if ( nNewDeltaX != nDeltaX )
+ ScrollX( nNewDeltaX - nDeltaX, eAlignX );
+ if ( nNewDeltaY != nDeltaY )
+ ScrollY( nNewDeltaY - nDeltaY, eAlignY );
}
// switch active part again
@@ -1494,18 +1508,21 @@ void ScTabView::MarkDataChanged()
void ScTabView::SelectNextTab( short nDir, bool bExtendSelection )
{
- if (!nDir) return;
+ if (!nDir)
+ return;
OSL_ENSURE( nDir==-1 || nDir==1, "SelectNextTab: invalid value");
ScDocument* pDoc = aViewData.GetDocument();
SCTAB nTab = aViewData.GetTabNo();
if (nDir<0)
{
- if (!nTab) return;
+ if (!nTab)
+ return;
--nTab;
while (!pDoc->IsVisible(nTab))
{
- if (!nTab) return;
+ if (!nTab)
+ return;
--nTab;
}
}
@@ -1513,11 +1530,13 @@ void ScTabView::SelectNextTab( short nDir, bool bExtendSelection )
{
SCTAB nCount = pDoc->GetTableCount();
++nTab;
- if (nTab >= nCount) return;
+ if (nTab >= nCount)
+ return;
while (!pDoc->IsVisible(nTab))
{
++nTab;
- if (nTab >= nCount) return;
+ if (nTab >= nCount)
+ return;
}
}
@@ -1968,7 +1987,8 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
SCCOL nScrX = aViewData.GetPosX( eHWhich );
SCROW nScrY = aViewData.GetPosY( eVWhich );
- if (nCol1 < nScrX) nCol1 = nScrX;
+ if (nCol1 < nScrX)
+ nCol1 = nScrX;
if (nCol2 < nScrX)
{
if ( eMode == SC_UPDATE_ALL ) // for UPDATE_ALL, paint anyway
@@ -1976,15 +1996,21 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
else
bOut = true; // completely outside the window
}
- if (nRow1 < nScrY) nRow1 = nScrY;
- if (nRow2 < nScrY) bOut = true;
+ if (nRow1 < nScrY)
+ nRow1 = nScrY;
+ if (nRow2 < nScrY)
+ bOut = true;
SCCOL nLastX = nScrX + aViewData.VisibleCellsX( eHWhich ) + 1;
SCROW nLastY = nScrY + aViewData.VisibleCellsY( eVWhich ) + 1;
- if (nCol1 > nLastX) bOut = true;
- if (nCol2 > nLastX) nCol2 = nLastX;
- if (nRow1 > nLastY) bOut = true;
- if (nRow2 > nLastY) nRow2 = nLastY;
+ if (nCol1 > nLastX)
+ bOut = true;
+ if (nCol2 > nLastX)
+ nCol2 = nLastX;
+ if (nRow1 > nLastY)
+ bOut = true;
+ if (nRow2 > nLastY)
+ nRow2 = nLastY;
if (bOut)
continue;
More information about the Libreoffice-commits
mailing list