Kaydet (Commit) 2eba7687 authored tarafından Eike Rathke's avatar Eike Rathke

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.
üst 5032e7b0
...@@ -1683,15 +1683,26 @@ public: ...@@ -1683,15 +1683,26 @@ public:
void operator() (ScQueryEntry::Item& rItem) void operator() (ScQueryEntry::Item& rItem)
{ {
// Double-check if the query by date is really appropriate. if (rItem.meType != ScQueryEntry::ByString && rItem.meType != ScQueryEntry::ByDate)
if (rItem.meType != ScQueryEntry::ByDate)
return; return;
sal_uInt32 nIndex = 0; sal_uInt32 nIndex = 0;
bool bNumber = mrDoc.GetFormatTable()-> bool bNumber = mrDoc.GetFormatTable()->
IsNumberFormat(rItem.maString, nIndex, rItem.mfVal); 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)) if (bNumber && ((nIndex % SV_COUNTRY_LANGUAGE_OFFSET) != 0))
{ {
const SvNumberformat* pEntry = mrDoc.GetFormatTable()->GetEntry(nIndex); const SvNumberformat* pEntry = mrDoc.GetFormatTable()->GetEntry(nIndex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment