summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-19 21:46:51 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-20 13:44:42 -0400
commit1882a2b15187259a7e22d0a09f264ad149fa76be (patch)
tree2871f34269f2f07c6a1d768b6e727add54d3a6a2 /sc
parent81a555edbcea7493c6981dda452bf7d20e06fc02 (diff)
Try not to use array index access here...
Change-Id: I48967956c63ba72b62604bcabe7166fc58061d13
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/compare.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/core/tool/compare.cxx b/sc/source/core/tool/compare.cxx
index 6c603710ebe3..679b103f8ae9 100644
--- a/sc/source/core/tool/compare.cxx
+++ b/sc/source/core/tool/compare.cxx
@@ -197,7 +197,12 @@ double CompareFunc( const Compare& rComp, CompareOptions* pOptions )
// As in ScTable::ValidQuery() match a numeric string for a
// number query that originated from a string, e.g. in SUMIF
// and COUNTIF. Transliteration is not needed here.
- bool bEqual = rComp.maCells[nStringQuery-1].maStr == rItem.maString;
+ bool bEqual = false;
+ if (nStringQuery == 1)
+ bEqual = rCell1.maStr == rItem.maString;
+ else
+ bEqual = rCell2.maStr == rItem.maString;
+
// match => fRes=0, else fRes=1
fRes = (rEntry.eOp == SC_NOT_EQUAL) ? bEqual : !bEqual;
}