diff options
author | Eike Rathke <erack@redhat.com> | 2011-12-15 21:23:09 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2011-12-15 21:23:09 +0100 |
commit | cad074d663cc6034b73a485a151420287a38d7f9 (patch) | |
tree | 9197346742b1109a221758b48dc290bfa16c5491 | |
parent | c01ed69703a41e94f553ede40487407a0ad1da4e (diff) |
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.
-rw-r--r-- | sc/source/core/data/table3.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index b0d261f15e17..e47d88eeefa5 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); |