Kaydet (Commit) b4317a01 authored tarafından Eike Rathke's avatar Eike Rathke

replace implementation of ScRange::PutInOrder() with that of Justify()

It does the same, just more efficicient.

Change-Id: Iee2e6a40cf8f8e8be629b458520ae392501af3e9
üst b6c570af
......@@ -1406,21 +1406,24 @@ ScRange ScRange::Intersection( const ScRange& rOther ) const
void ScRange::PutInOrder()
{
SCCOL nCol1 = aStart.Col(), nCol2 = aEnd.Col();
SCROW nRow1 = aStart.Row(), nRow2 = aEnd.Row();
SCTAB nTab1 = aStart.Tab(), nTab2 = aEnd.Tab();
::PutInOrder(nCol1, nCol2);
::PutInOrder(nRow1, nRow2);
::PutInOrder(nTab1, nTab2);
aStart.SetCol(nCol1);
aStart.SetRow(nRow1);
aStart.SetTab(nTab1);
aEnd.SetCol(nCol2);
aEnd.SetRow(nRow2);
aEnd.SetTab(nTab2);
SCCOL nTempCol;
if ( aEnd.Col() < (nTempCol = aStart.Col()) )
{
aStart.SetCol(aEnd.Col());
aEnd.SetCol(nTempCol);
}
SCROW nTempRow;
if ( aEnd.Row() < (nTempRow = aStart.Row()) )
{
aStart.SetRow(aEnd.Row());
aEnd.SetRow(nTempRow);
}
SCTAB nTempTab;
if ( aEnd.Tab() < (nTempTab = aStart.Tab()) )
{
aStart.SetTab(aEnd.Tab());
aEnd.SetTab(nTempTab);
}
}
void ScRange::Justify()
......
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