summaryrefslogtreecommitdiffstats
path: root/sc/source/core/tool
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool')
-rw-r--r--sc/source/core/tool/interpr4.cxx9
-rw-r--r--sc/source/core/tool/interpr8.cxx18
2 files changed, 9 insertions, 18 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 28ceba647ccf..27170ca94490 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -944,12 +944,9 @@ void ScInterpreter::DoubleRefToVars( const formula::FormulaToken* p,
const ScComplexRefData& rCRef = *p->GetDoubleRef();
SingleRefToVars( rCRef.Ref1, rCol1, rRow1, rTab1);
SingleRefToVars( rCRef.Ref2, rCol2, rRow2, rTab2);
- if (rCol2 < rCol1)
- std::swap( rCol2, rCol1);
- if (rRow2 < rRow1)
- std::swap( rRow2, rRow1);
- if (rTab2 < rTab1)
- std::swap( rTab2, rTab1);
+ PutInOrder(rCol1, rCol2);
+ PutInOrder(rRow1, rRow2);
+ PutInOrder(rTab1, rTab2);
if (!mrDoc.m_TableOpList.empty())
{
ScRange aRange( rCol1, rRow1, rTab1, rCol2, rRow2, rTab2 );
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 124205e46aaa..df75c92d41f1 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1434,10 +1434,8 @@ void ScInterpreter::ScConcat_MS()
SetError( FormulaError::IllegalParameter);
break;
}
- if ( nRow1 > nRow2 )
- std::swap( nRow1, nRow2 );
- if ( nCol1 > nCol2 )
- std::swap( nCol1, nCol2 );
+ PutInOrder( nRow1, nRow2 );
+ PutInOrder( nCol1, nCol2 );
ScAddress aAdr;
aAdr.SetTab( nTab1 );
for ( SCROW nRow = nRow1; nRow <= nRow2; nRow++ )
@@ -1559,10 +1557,8 @@ void ScInterpreter::ScTextJoin_MS()
SetError( FormulaError::IllegalParameter);
break;
}
- if ( nRow1 > nRow2 )
- std::swap( nRow1, nRow2 );
- if ( nCol1 > nCol2 )
- std::swap( nCol1, nCol2 );
+ PutInOrder( nRow1, nRow2 );
+ PutInOrder( nCol1, nCol2 );
ScAddress aAdr;
aAdr.SetTab( nTab1 );
for ( SCROW nRow = nRow1; nRow <= nRow2; nRow++ )
@@ -1712,10 +1708,8 @@ void ScInterpreter::ScTextJoin_MS()
SetError( FormulaError::IllegalParameter);
break;
}
- if ( nRow1 > nRow2 )
- std::swap( nRow1, nRow2 );
- if ( nCol1 > nCol2 )
- std::swap( nCol1, nCol2 );
+ PutInOrder( nRow1, nRow2 );
+ PutInOrder( nCol1, nCol2 );
ScAddress aAdr;
aAdr.SetTab( nTab1 );
OUString aStr;