[Libreoffice-commits] core.git: sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Fri Mar 8 09:13:01 PST 2013


 sc/source/core/tool/interpr1.cxx |   27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

New commits:
commit 6d29f0abb4925b865ae6a968d65abd489ab6d0bf
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Mar 8 12:13:22 2013 -0500

    Adjusted this to the latest code base to get it to apply...
    
    Change-Id: I95cc141d4d13cf27fcf1e736862093837cc1e065

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 8398b1b..9e793c0 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;
 }
 


More information about the Libreoffice-commits mailing list