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