[Libreoffice-commits] .: sc/source

Eike Rathke erack at kemper.freedesktop.org
Thu Dec 15 12:23:34 PST 2011


 sc/source/core/data/table3.cxx |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 2eba7687745b8103f6bc8f07988dab83bcf4c336
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Dec 15 21:22:41 2011 +0100

    Resolved fdo#43831 Advanced FILTER incompatible with 3.4.4 documents
    
    * Reintroduced logic in PrepareQueryItem::operator() that got lost during
      rework of ScQueryEntry.
      * ScQueryParamBase::FillInExcelSyntax() and the calling
        lcl_createExcelQuery() create query entries always as ByString, that
        needs to be converted to ByValue if appropriate.

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index b0d261f..e47d88e 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1683,15 +1683,26 @@ public:
 
     void operator() (ScQueryEntry::Item& rItem)
     {
-        // Double-check if the query by date is really appropriate.
-
-        if (rItem.meType != ScQueryEntry::ByDate)
+        if (rItem.meType != ScQueryEntry::ByString && rItem.meType != ScQueryEntry::ByDate)
             return;
 
         sal_uInt32 nIndex = 0;
         bool bNumber = mrDoc.GetFormatTable()->
             IsNumberFormat(rItem.maString, nIndex, rItem.mfVal);
 
+        // Advanced Filter creates only ByString queries that need to be
+        // converted to ByValue if appropriate. rItem.mfVal now holds the value
+        // if bNumber==true.
+
+        if (rItem.meType == ScQueryEntry::ByString)
+        {
+            if (bNumber)
+                rItem.meType = ScQueryEntry::ByValue;
+            return;
+        }
+
+        // Double-check if the query by date is really appropriate.
+
         if (bNumber && ((nIndex % SV_COUNTRY_LANGUAGE_OFFSET) != 0))
         {
             const SvNumberformat* pEntry = mrDoc.GetFormatTable()->GetEntry(nIndex);


More information about the Libreoffice-commits mailing list