[Libreoffice-commits] .: sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Nov 10 12:49:29 PST 2011


 sc/inc/queryparam.hxx              |    1 -
 sc/source/core/data/dociter.cxx    |    4 ----
 sc/source/core/data/table3.cxx     |   17 -----------------
 sc/source/core/tool/doubleref.cxx  |    1 -
 sc/source/core/tool/interpr1.cxx   |    3 ---
 sc/source/core/tool/queryparam.cxx |    6 ++----
 6 files changed, 2 insertions(+), 30 deletions(-)

New commits:
commit eaea417bfdf8d06df2b7f2e42c904c32ce77e871
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Thu Nov 10 15:45:53 2011 -0500

    Removing the mixed comparison flag, which is no longer needed.
    
    This flag was introduced years ago to deal with Excel's behavior on
    incorrectly sorted data range. But later versions of Excel no longer
    follow that behavior & keeping this flag would make the evaluation
    code unnecessarily more complex & hard to adopt to multi-item matching.

diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx
index d04f7b4..49fa2bc 100644
--- a/sc/inc/queryparam.hxx
+++ b/sc/inc/queryparam.hxx
@@ -45,7 +45,6 @@ struct ScQueryParamBase
     bool            bCaseSens;
     bool            bRegExp;
     bool            bDuplicate;
-    bool            bMixedComparison;   // whether numbers are smaller than strings
 
     virtual ~ScQueryParamBase();
 
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 5efe016..689e68e 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -865,10 +865,6 @@ bool ScDBQueryDataIterator::DataAccessMatrix::isValidQuery(SCROW nRow, const ScM
             }
             while (false);
         }
-        else if (mpParam->bMixedComparison)
-        {
-            // Not used at the moment.
-        }
 
         if (aResults.empty())
             // First query entry.
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 16c4793..4539055 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1442,23 +1442,6 @@ bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
                 }
             }
         }
-        else if (rParam.bMixedComparison)
-        {
-            if (rItem.meType == ScQueryEntry::ByString &&
-                    (rEntry.eOp == SC_LESS || rEntry.eOp == SC_LESS_EQUAL) &&
-                    (pCell ? pCell->HasValueData() :
-                     HasValueData( static_cast<SCCOL>(rEntry.nField), nRow)))
-            {
-                bOk = true;
-            }
-            else if (rItem.meType != ScQueryEntry::ByString &&
-                    (rEntry.eOp == SC_GREATER || rEntry.eOp == SC_GREATER_EQUAL) &&
-                    (pCell ? pCell->HasStringData() :
-                     HasStringData( static_cast<SCCOL>(rEntry.nField), nRow)))
-            {
-                bOk = true;
-            }
-        }
 
         if (nPos == -1)
         {
diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx
index 15e6d53..a7414aa 100644
--- a/sc/source/core/tool/doubleref.cxx
+++ b/sc/source/core/tool/doubleref.cxx
@@ -276,7 +276,6 @@ void ScDBRangeBase::fillQueryOptions(ScQueryParamBase* pParam)
     pParam->bCaseSens = false;
     pParam->bRegExp = false;
     pParam->bDuplicate = true;
-    pParam->bMixedComparison = false;
 }
 
 ScDocument* ScDBRangeBase::getDoc() const
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a0a577f..bc33bf8 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4473,7 +4473,6 @@ void ScInterpreter::ScMatch()
             rParam.nRow1       = nRow1;
             rParam.nCol2       = nCol2;
             rParam.nTab        = nTab1;
-            rParam.bMixedComparison = true;
 
             ScQueryEntry& rEntry = rParam.GetEntry(0);
             ScQueryEntry::Item& rItem = rEntry.GetQueryItem();
@@ -5805,7 +5804,6 @@ void ScInterpreter::ScLookup()
     aParam.nCol2            = bVertical ? nCol1 : nCol2;
     aParam.nRow2            = bVertical ? nRow2 : nRow1;
     aParam.bByRow           = bVertical;
-    aParam.bMixedComparison = true;
 
     rEntry.bDoQuery = true;
     rEntry.eOp = SC_LESS_EQUAL;
@@ -6026,7 +6024,6 @@ void ScInterpreter::CalculateLookup(bool HLookup)
                 rParam.nRow2       = nRow2;
                 rParam.nTab        = nTab1;
             }
-            rParam.bMixedComparison = true;
 
             ScQueryEntry& rEntry = rParam.GetEntry(0);
             rEntry.bDoQuery = true;
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index 4012f13..a1df6a2 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -48,7 +48,7 @@ ScQueryParamBase::ScQueryParamBase()
 
 ScQueryParamBase::ScQueryParamBase(const ScQueryParamBase& r) :
     bHasHeader(r.bHasHeader), bByRow(r.bByRow), bInplace(r.bInplace), bCaseSens(r.bCaseSens),
-    bRegExp(r.bRegExp), bDuplicate(r.bDuplicate), bMixedComparison(r.bMixedComparison),
+    bRegExp(r.bRegExp), bDuplicate(r.bDuplicate),
     maEntries(r.maEntries)
 {
 }
@@ -226,7 +226,7 @@ void ScQueryParam::Clear()
     nCol1=nCol2 = 0;
     nRow1=nRow2 = 0;
     nTab = SCTAB_MAX;
-    bHasHeader = bCaseSens = bRegExp = bMixedComparison = false;
+    bHasHeader = bCaseSens = bRegExp = false;
     bInplace = bByRow = bDuplicate = sal_True;
 
     boost::ptr_vector<ScQueryEntry>::iterator itr = maEntries.begin(), itrEnd = maEntries.end();
@@ -260,7 +260,6 @@ ScQueryParam& ScQueryParam::operator=( const ScQueryParam& r )
     bInplace    = r.bInplace;
     bCaseSens   = r.bCaseSens;
     bRegExp     = r.bRegExp;
-    bMixedComparison = r.bMixedComparison;
     bDuplicate  = r.bDuplicate;
     bByRow      = r.bByRow;
     bDestPers   = r.bDestPers;
@@ -297,7 +296,6 @@ bool ScQueryParam::operator==( const ScQueryParam& rOther ) const
         && (bInplace    == rOther.bInplace)
         && (bCaseSens   == rOther.bCaseSens)
         && (bRegExp     == rOther.bRegExp)
-        && (bMixedComparison == rOther.bMixedComparison)
         && (bDuplicate  == rOther.bDuplicate)
         && (bDestPers   == rOther.bDestPers)
         && (nDestTab    == rOther.nDestTab)


More information about the Libreoffice-commits mailing list