summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-07-17 16:49:39 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2018-07-19 01:42:47 +0200
commitcc2c11c2e4a99adf00d184507d6925c9af37e1bd (patch)
tree21d05361c08ace3edc158bd9504d7169c481d4b2
parenta6fc577ca0303006e5668f52ffc93c3cdf0effd6 (diff)
Related: tdf#117016 DoubleRefToVars: always put in order
... as all callers expect, whatever dynamic range creating process may have created it. Change-Id: I47b2e174d5bf4d5c23f10685526b48eee07dd6a4 Reviewed-on: https://gerrit.libreoffice.org/57567 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 6db5e1bdd67531fab14b375d6c624237d38de297) Reviewed-on: https://gerrit.libreoffice.org/57621 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/core/tool/interpr4.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index c600cdca34b1..7c149d95d94a 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -948,6 +948,12 @@ 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);
if (!pDok->m_TableOpList.empty())
{
ScRange aRange( rCol1, rRow1, rTab1, rCol2, rRow2, rTab2 );