diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-08 12:13:22 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-08 12:14:29 -0500 |
commit | 6d29f0abb4925b865ae6a968d65abd489ab6d0bf (patch) | |
tree | 1d86c235b55a14f1d3716ebade00eb688018b13f /sc | |
parent | 5bf2a07f76d351a8964cb2ebe91be227e012010f (diff) |
Adjusted this to the latest code base to get it to apply...
Change-Id: I95cc141d4d13cf27fcf1e736862093837cc1e065
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 8398b1bccf3c..9e793c0a027a 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -967,24 +967,27 @@ double ScInterpreter::CompareFunc( const ScCompare& rComp, ScCompareOptions* pOp fRes = (double) ScGlobal::GetCaseCollator()->compareString( *rComp.pVal[ 0 ], *rComp.pVal[ 1 ] ); } -#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE + if (nStringQuery && pOptions) { const ScQueryEntry& rEntry = pOptions->aQueryEntry; - if (!rEntry.bQueryByString && rEntry.pStr->Len() && - (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL)) + const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems(); + if (!rItems.empty()) { - // 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.pVal[nStringQuery-1]->Equals( *rEntry.pStr); - // match => fRes=0, else fRes=1 - fRes = (rEntry.eOp == SC_NOT_EQUAL) ? bEqual : !bEqual; + const ScQueryEntry::Item& rItem = rItems[0]; + if (rItem.meType != ScQueryEntry::ByString && !rItem.maString.isEmpty() && + (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL)) + { + // 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.pVal[nStringQuery-1]->Equals(rItem.maString); + // match => fRes=0, else fRes=1 + fRes = (rEntry.eOp == SC_NOT_EQUAL) ? bEqual : !bEqual; + } } } -#else - (void)nStringQuery; -#endif + return fRes; } |