Update ooo320-m1
[ooovba.git] / applied_patches / 0135-calc-filter-by-date-strip-time.diff
blob53fc5b3db5b12e7e1300cbbf9f98b70762f8fdb3
1 diff --git sc/inc/column.hxx sc/inc/column.hxx
2 index 47417c3..11f2955 100644
3 --- sc/inc/column.hxx
4 +++ sc/inc/column.hxx
5 @@ -379,7 +379,7 @@ public:
6 /// Including current, may return -1
7 SCsROW GetNextUnprotected( SCROW nRow, BOOL bUp ) const;
9 - void GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings);
10 + void GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings, bool& rHasDates);
11 BOOL GetDataEntries(SCROW nRow, TypedScStrCollection& rStrings, BOOL bLimit);
13 //UNUSED2008-05 SCROW NoteCount( SCROW nMaxRow = MAXROW ) const;
14 diff --git sc/inc/dbcolect.hxx sc/inc/dbcolect.hxx
15 index 1346b12..edd5a09 100644
16 --- sc/inc/dbcolect.hxx
17 +++ sc/inc/dbcolect.hxx
18 @@ -88,6 +88,7 @@ private:
19 SCCOLROW nQueryField[MAXQUERY];
20 ScQueryOp eQueryOp[MAXQUERY];
21 BOOL bQueryByString[MAXQUERY];
22 + bool bQueryByDate[MAXQUERY];
23 String* pQueryStr[MAXQUERY];
24 double nQueryVal[MAXQUERY];
25 ScQueryConnect eQueryConnect[MAXQUERY];
26 diff --git sc/inc/document.hxx sc/inc/document.hxx
27 index 06b3fbe..ddb87fa 100644
28 --- sc/inc/document.hxx
29 +++ sc/inc/document.hxx
30 @@ -1379,9 +1379,9 @@ public:
31 void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr);
33 BOOL GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
34 - TypedScStrCollection& rStrings, bool bFilter = false );
35 + bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates);
36 SC_DLLPUBLIC BOOL GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow,
37 - SCTAB nTab, TypedScStrCollection& rStrings );
38 + SCTAB nTab, TypedScStrCollection& rStrings, bool& rHasDates );
39 BOOL GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
40 TypedScStrCollection& rStrings, BOOL bLimit = FALSE );
41 BOOL GetFormulaEntries( TypedScStrCollection& rStrings );
42 diff --git sc/inc/global.hxx sc/inc/global.hxx
43 index cc2e078..de5be83 100644
44 --- sc/inc/global.hxx
45 +++ sc/inc/global.hxx
46 @@ -791,6 +791,7 @@ struct ScQueryEntry
48 BOOL bDoQuery;
49 BOOL bQueryByString;
50 + bool bQueryByDate;
51 SCCOLROW nField;
52 ScQueryOp eOp;
53 ScQueryConnect eConnect;
54 diff --git sc/inc/table.hxx sc/inc/table.hxx
55 index 597baf3..d623a9c 100644
56 --- sc/inc/table.hxx
57 +++ sc/inc/table.hxx
58 @@ -638,8 +638,8 @@ public:
59 SCSIZE Query(ScQueryParam& rQueryParam, BOOL bKeepSub);
60 BOOL CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
62 - void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings);
63 - void GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings );
64 + void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings, bool& rHasDates);
65 + void GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings, bool& rHasDates );
66 BOOL GetDataEntries(SCCOL nCol, SCROW nRow, TypedScStrCollection& rStrings, BOOL bLimit);
68 BOOL HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
69 diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx
70 index 242c5c0..560801d 100644
71 --- sc/source/core/data/column3.cxx
72 +++ sc/source/core/data/column3.cxx
73 @@ -1470,8 +1470,9 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
77 -void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings)
78 +void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings, bool& rHasDates)
80 + bool bHasDates = false;
81 SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
82 String aString;
83 SCROW nRow = 0;
84 @@ -1507,6 +1508,18 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
85 nValue = 0.0;
88 + if (pFormatter)
89 + {
90 + short nType = pFormatter->GetType(nFormat);
91 + if ((nType & NUMBERFORMAT_DATE) && !(nType & NUMBERFORMAT_TIME))
92 + {
93 + // special case for date values. Disregard the time
94 + // element if the number format is of date type.
95 + nValue = ::rtl::math::approxFloor(nValue);
96 + bHasDates = true;
97 + }
98 + }
100 pData = new TypedStrData( aString, nValue, SC_STRTYPE_VALUE );
102 #if 0 // DR
103 @@ -1525,6 +1538,8 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
105 ++nIndex;
108 + rHasDates = bHasDates;
112 diff --git sc/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx
113 index a0b524f..68e4383 100644
114 --- sc/source/core/data/documen3.cxx
115 +++ sc/source/core/data/documen3.cxx
116 @@ -1255,7 +1255,8 @@ BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol,
117 // GetFilterEntries - Eintraege fuer AutoFilter-Listbox
120 -BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScStrCollection& rStrings, bool bFilter )
121 +BOOL ScDocument::GetFilterEntries(
122 + SCCOL nCol, SCROW nRow, SCTAB nTab, bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates)
124 if ( ValidTab(nTab) && pTab[nTab] && pDBCollection )
126 @@ -1292,11 +1293,11 @@ BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScSt
128 if ( bFilter )
130 - pTab[nTab]->GetFilteredFilterEntries( nCol, nStartRow, nEndRow, aParam, rStrings );
131 + pTab[nTab]->GetFilteredFilterEntries( nCol, nStartRow, nEndRow, aParam, rStrings, rHasDates );
133 else
135 - pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings );
136 + pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings, rHasDates );
139 return TRUE;
140 @@ -1311,11 +1312,11 @@ BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScSt
143 BOOL ScDocument::GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow,
144 - SCTAB nTab, TypedScStrCollection& rStrings )
145 + SCTAB nTab, TypedScStrCollection& rStrings, bool& rHasDates )
147 if ( ValidTab(nTab) && pTab[nTab] )
149 - pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings );
150 + pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings, rHasDates );
151 return TRUE;
154 diff --git sc/source/core/data/global2.cxx sc/source/core/data/global2.cxx
155 index f71b842..c9b2e3e 100644
156 --- sc/source/core/data/global2.cxx
157 +++ sc/source/core/data/global2.cxx
158 @@ -145,30 +145,32 @@ BOOL ScImportParam::operator==( const ScImportParam& rOther ) const
159 //------------------------------------------------------------------------
160 // struct ScQueryParam:
162 -ScQueryEntry::ScQueryEntry()
163 +ScQueryEntry::ScQueryEntry() :
164 + bDoQuery(FALSE),
165 + bQueryByString(FALSE),
166 + bQueryByDate(false),
167 + nField(0),
168 + eOp(SC_EQUAL),
169 + eConnect(SC_AND),
170 + pStr(new String),
171 + nVal(0.0),
172 + pSearchParam(NULL),
173 + pSearchText(NULL)
177 +ScQueryEntry::ScQueryEntry(const ScQueryEntry& r) :
178 + bDoQuery(r.bDoQuery),
179 + bQueryByString(r.bQueryByString),
180 + bQueryByDate(r.bQueryByDate),
181 + nField(r.nField),
182 + eOp(r.eOp),
183 + eConnect(r.eConnect),
184 + pStr(new String(*r.pStr)),
185 + nVal(r.nVal),
186 + pSearchParam(NULL),
187 + pSearchText(NULL)
189 - bDoQuery = FALSE;
190 - bQueryByString = FALSE;
191 - eOp = SC_EQUAL;
192 - eConnect = SC_AND;
193 - nField = 0;
194 - nVal = 0.0;
195 - pStr = new String;
196 - pSearchParam = NULL;
197 - pSearchText = NULL;
200 -ScQueryEntry::ScQueryEntry(const ScQueryEntry& r)
202 - bDoQuery = r.bDoQuery;
203 - bQueryByString = r.bQueryByString;
204 - eOp = r.eOp;
205 - eConnect = r.eConnect;
206 - nField = r.nField;
207 - nVal = r.nVal;
208 - pStr = new String(*r.pStr);
209 - pSearchParam = NULL;
210 - pSearchText = NULL;
213 ScQueryEntry::~ScQueryEntry()
214 @@ -185,6 +187,7 @@ ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r )
216 bDoQuery = r.bDoQuery;
217 bQueryByString = r.bQueryByString;
218 + bQueryByDate = r.bQueryByDate;
219 eOp = r.eOp;
220 eConnect = r.eConnect;
221 nField = r.nField;
222 @@ -205,6 +208,7 @@ void ScQueryEntry::Clear()
224 bDoQuery = FALSE;
225 bQueryByString = FALSE;
226 + bQueryByDate = false;
227 eOp = SC_EQUAL;
228 eConnect = SC_AND;
229 nField = 0;
230 @@ -223,6 +227,7 @@ BOOL ScQueryEntry::operator==( const ScQueryEntry& r ) const
232 return bDoQuery == r.bDoQuery
233 && bQueryByString == r.bQueryByString
234 + && bQueryByDate == r.bQueryByDate
235 && eOp == r.eOp
236 && eConnect == r.eConnect
237 && nField == r.nField
238 diff --git sc/source/core/data/table3.cxx sc/source/core/data/table3.cxx
239 index 7dffb3d..7067799 100644
240 --- sc/source/core/data/table3.cxx
241 +++ sc/source/core/data/table3.cxx
242 @@ -60,7 +60,8 @@
243 #include "progress.hxx"
244 #include "cellform.hxx"
245 #include "postit.hxx"
246 #include "queryparam.hxx"
247 +#include "svtools/zformat.hxx"
249 #include <vector>
251 @@ -1143,6 +1144,20 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
253 else
254 nCellVal = GetValue( static_cast<SCCOL>(rEntry.nField), nRow );
256 + if (rEntry.bQueryByDate)
258 + sal_uInt32 nNumFmt = GetNumberFormat(static_cast<SCCOL>(rEntry.nField), nRow);
259 + const SvNumberformat* pEntry = pDocument->GetFormatTable()->GetEntry(nNumFmt);
260 + if (pEntry)
262 + short nNumFmtType = pEntry->GetType();
263 + if ((nNumFmtType & NUMBERFORMAT_DATE) && !(nNumFmtType & NUMBERFORMAT_TIME))
264 + // The format is of date type. Strip off the time element.
265 + nCellVal = ::rtl::math::approxFloor(nCellVal);
269 switch (rEntry.eOp)
271 case SC_EQUAL :
272 @@ -1930,12 +1945,13 @@ BOOL ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndCol *
273 return TRUE;
276 -void ScTable::GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings)
277 +void ScTable::GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings, bool& rHasDates)
279 - aCol[nCol].GetFilterEntries( nRow1, nRow2, rStrings );
280 + aCol[nCol].GetFilterEntries( nRow1, nRow2, rStrings, rHasDates );
283 -void ScTable::GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings )
284 +void ScTable::GetFilteredFilterEntries(
285 + SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings, bool& rHasDates )
287 // remove the entry for this column from the query parameter
288 ScQueryParam aParam( rParam );
289 @@ -1953,15 +1969,18 @@ void ScTable::GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, co
291 BOOL* pSpecial = new BOOL[nEntryCount];
292 lcl_PrepareQuery( pDocument, this, aParam, pSpecial );
294 + bool bHasDates = false;
295 for ( SCROW j = nRow1; j <= nRow2; ++j )
297 if ( ValidQuery( j, aParam, pSpecial ) )
299 - aCol[nCol].GetFilterEntries( j, j, rStrings );
300 + bool bThisHasDates = false;
301 + aCol[nCol].GetFilterEntries( j, j, rStrings, bThisHasDates );
302 + bHasDates |= bThisHasDates;
306 + rHasDates = bHasDates;
307 delete[] pSpecial;
310 diff --git sc/source/core/tool/dbcolect.cxx sc/source/core/tool/dbcolect.cxx
311 index 162fcbd..9ed2645 100644
312 --- sc/source/core/tool/dbcolect.cxx
313 +++ sc/source/core/tool/dbcolect.cxx
314 @@ -158,6 +158,7 @@ ScDBData::ScDBData( const ScDBData& rData ) :
315 nQueryField[i] = rData.nQueryField[i];
316 eQueryOp[i] = rData.eQueryOp[i];
317 bQueryByString[i] = rData.bQueryByString[i];
318 + bQueryByDate[i] = rData.bQueryByDate[i];
319 pQueryStr[i] = new String( *(rData.pQueryStr[i]) );
320 nQueryVal[i] = rData.nQueryVal[i];
321 eQueryConnect[i] = rData.eQueryConnect[i];
322 @@ -248,6 +249,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData)
323 nQueryField[i] = rData.nQueryField[i];
324 eQueryOp[i] = rData.eQueryOp[i];
325 bQueryByString[i] = rData.bQueryByString[i];
326 + bQueryByDate[i] = rData.bQueryByDate[i];
327 *pQueryStr[i] = *rData.pQueryStr[i];
328 nQueryVal[i] = rData.nQueryVal[i];
329 eQueryConnect[i] = rData.eQueryConnect[i];
330 @@ -518,6 +520,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const
331 rEntry.nField = nQueryField[i];
332 rEntry.eOp = eQueryOp[i];
333 rEntry.bQueryByString = bQueryByString[i];
334 + rEntry.bQueryByDate = bQueryByDate[i];
335 *rEntry.pStr = *pQueryStr[i];
336 rEntry.nVal = nQueryVal[i];
337 rEntry.eConnect = eQueryConnect[i];
338 @@ -549,6 +552,7 @@ void ScDBData::SetQueryParam(const ScQueryParam& rQueryParam)
339 nQueryField[i] = rEntry.nField;
340 eQueryOp[i] = rEntry.eOp;
341 bQueryByString[i] = rEntry.bQueryByString;
342 + bQueryByDate[i] = rEntry.bQueryByDate;
343 *pQueryStr[i] = *rEntry.pStr;
344 nQueryVal[i] = rEntry.nVal;
345 eQueryConnect[i] = rEntry.eConnect;
346 diff --git sc/source/ui/dbgui/filtdlg.cxx sc/source/ui/dbgui/filtdlg.cxx
347 index 4a2d4d4..4f56adb 100644
348 --- sc/source/ui/dbgui/filtdlg.cxx
349 +++ sc/source/ui/dbgui/filtdlg.cxx
350 @@ -451,24 +451,27 @@ void ScFilterDlg::UpdateValueList( USHORT nList )
351 SCCOL nColumn = theQueryData.nCol1 + static_cast<SCCOL>(nFieldSelPos) - 1;
352 if (!pEntryLists[nColumn])
354 + USHORT nOffset = GetSliderPos();
355 SCTAB nTab = nSrcTab;
356 SCROW nFirstRow = theQueryData.nRow1;
357 SCROW nLastRow = theQueryData.nRow2;
358 + mbHasDates[nOffset+nList-1] = false;
360 // erstmal ohne die erste Zeile
362 pEntryLists[nColumn] = new TypedScStrCollection( 128, 128 );
363 pEntryLists[nColumn]->SetCaseSensitive( aBtnCase.IsChecked() );
364 pDoc->GetFilterEntriesArea( nColumn, nFirstRow+1, nLastRow,
365 - nTab, *pEntryLists[nColumn] );
366 + nTab, *pEntryLists[nColumn], mbHasDates[nOffset+nList-1] );
368 // Eintrag fuer die erste Zeile
369 //! Eintrag (pHdrEntry) ohne Collection erzeugen?
371 nHeaderPos[nColumn] = USHRT_MAX;
372 TypedScStrCollection aHdrColl( 1, 1 );
373 + bool bDummy = false;
374 pDoc->GetFilterEntriesArea( nColumn, nFirstRow, nFirstRow,
375 - nTab, aHdrColl );
376 + nTab, aHdrColl, bDummy );
377 TypedStrData* pHdrEntry = aHdrColl[0];
378 if ( pHdrEntry )
380 @@ -1064,7 +1067,8 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd )
381 static_cast<SCCOL>(nField) - 1) : static_cast<SCCOL>(0);
383 ScQueryOp eOp = (ScQueryOp)pLbCond->GetSelectEntryPos();
384 - rEntry.eOp = eOp;
385 + rEntry.eOp = eOp;
386 + rEntry.bQueryByDate = mbHasDates[nQE];
390 diff --git sc/source/ui/dbgui/pfiltdlg.cxx sc/source/ui/dbgui/pfiltdlg.cxx
391 index 35bfc35..42c2c26 100644
392 --- sc/source/ui/dbgui/pfiltdlg.cxx
393 +++ sc/source/ui/dbgui/pfiltdlg.cxx
394 @@ -352,11 +352,12 @@ void ScPivotFilterDlg::UpdateValueList( USHORT nList )
395 SCROW nFirstRow = theQueryData.nRow1;
396 SCROW nLastRow = theQueryData.nRow2;
397 nFirstRow++;
398 + bool bHasDates = false;
400 pEntryLists[nColumn] = new TypedScStrCollection( 128, 128 );
401 pEntryLists[nColumn]->SetCaseSensitive( aBtnCase.IsChecked() );
402 pDoc->GetFilterEntriesArea( nColumn, nFirstRow, nLastRow,
403 - nTab, *pEntryLists[nColumn] );
404 + nTab, *pEntryLists[nColumn], bHasDates );
407 TypedScStrCollection* pColl = pEntryLists[nColumn];
408 diff --git sc/source/ui/inc/filtdlg.hxx sc/source/ui/inc/filtdlg.hxx
409 index c418e82..7409b5a 100644
410 --- sc/source/ui/inc/filtdlg.hxx
411 +++ sc/source/ui/inc/filtdlg.hxx
412 @@ -167,6 +167,7 @@ private:
413 ListBox* aFieldLbArr[4];
414 ListBox* aCondLbArr[4];
415 ListBox* aConnLbArr[4];
416 + bool mbHasDates[MAXQUERY];
417 BOOL bRefreshExceptQuery[MAXQUERY];
418 USHORT nFieldCount;
419 BOOL bRefInputMode;
420 diff --git sc/source/ui/inc/gridwin.hxx sc/source/ui/inc/gridwin.hxx
421 index 4013e1a..aae0353 100644
422 --- sc/source/ui/inc/gridwin.hxx
423 +++ sc/source/ui/inc/gridwin.hxx
424 @@ -218,7 +218,7 @@ private:
426 BOOL IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab );
427 void ExecFilter( ULONG nSel, SCCOL nCol, SCROW nRow,
428 - const String& aValue );
429 + const String& aValue, bool bCheckForDates );
430 void FilterSelect( ULONG nSel );
432 void ExecDataSelect( SCCOL nCol, SCROW nRow, const String& rStr );
433 diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx
434 index b547e2c..6fc33d5 100644
435 --- sc/source/ui/view/gridwin.cxx
436 +++ sc/source/ui/view/gridwin.cxx
437 @@ -170,6 +170,7 @@ private:
438 BOOL bInit;
439 BOOL bCancelled;
440 BOOL bInSelect;
441 + bool mbListHasDates;
442 ULONG nSel;
443 ScFilterBoxMode eMode;
445 @@ -193,6 +194,8 @@ public:
446 BOOL IsInInit() const { return bInit; }
447 void SetCancelled() { bCancelled = TRUE; }
448 BOOL IsInSelect() const { return bInSelect; }
449 + void SetListHasDates(bool b) { mbListHasDates = b; }
450 + bool HasDates() const { return mbListHasDates; }
453 //-------------------------------------------------------------------
454 @@ -208,6 +211,7 @@ ScFilterListBox::ScFilterListBox( Window* pParent, ScGridWindow* pGrid,
455 bInit( TRUE ),
456 bCancelled( FALSE ),
457 bInSelect( FALSE ),
458 + mbListHasDates(false),
459 nSel( 0 ),
460 eMode( eNewMode )
462 @@ -912,7 +916,9 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, BOOL bDataSelect )
463 pFilterBox->SetSeparatorPos( nDefCount - 1 );
465 // get list entries
466 - pDoc->GetFilterEntries( nCol, nRow, nTab, aStrings, true );
467 + bool bHasDates = false;
468 + pDoc->GetFilterEntries( nCol, nRow, nTab, true, aStrings, bHasDates);
469 + pFilterBox->SetListHasDates(bHasDates);
471 // check widths of numerical entries (string entries are not included)
472 // so all numbers are completely visible
473 @@ -1122,7 +1128,7 @@ void ScGridWindow::FilterSelect( ULONG nSel )
474 ExecDataSelect( nCol, nRow, aString );
475 break;
476 case SC_FILTERBOX_FILTER:
477 - ExecFilter( nSel, nCol, nRow, aString );
478 + ExecFilter( nSel, nCol, nRow, aString, pFilterBox->HasDates() );
479 break;
480 case SC_FILTERBOX_SCENARIO:
481 pViewData->GetView()->UseScenario( aString );
482 @@ -1155,7 +1161,7 @@ void ScGridWindow::ExecDataSelect( SCCOL nCol, SCROW nRow, const String& rStr )
484 void ScGridWindow::ExecFilter( ULONG nSel,
485 SCCOL nCol, SCROW nRow,
486 - const String& aValue )
487 + const String& aValue, bool bCheckForDates )
489 SCTAB nTab = pViewData->GetTabNo();
490 ScDocument* pDoc = pViewData->GetDocument();
491 @@ -1227,6 +1233,7 @@ void ScGridWindow::ExecFilter( ULONG nSel,
492 rNewEntry.bDoQuery = TRUE;
493 rNewEntry.bQueryByString = TRUE;
494 rNewEntry.nField = nCol;
495 + rNewEntry.bQueryByDate = bCheckForDates;
496 if ( nSel == SC_AUTOFILTER_TOP10 )
498 rNewEntry.eOp = SC_TOPVAL;