summaryrefslogtreecommitdiff
path: root/sc/source/core/data/table3.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2011-12-15 21:22:41 +0100
committerEike Rathke <erack@redhat.com>2011-12-15 21:22:41 +0100
commit2eba7687745b8103f6bc8f07988dab83bcf4c336 (patch)
treed0a5c04a977fb0bcc483c4222a2d28009b9bfc5a /sc/source/core/data/table3.cxx
parent5032e7b0cb95879716e34115cfa5ad040288729d (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.
Diffstat (limited to 'sc/source/core/data/table3.cxx')
-rw-r--r--sc/source/core/data/table3.cxx17
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);