Update to m13
[ooovba.git] / applied_patches / 0161-calc-filter-by-date-strip-time.diff
blob76a66ec63ba3ae8717f0fe2c5cf76a0cfb24e823
1 --- sc/source/core/data/column3.cxx.old 2009-04-02 10:45:01.000000000 +0000
2 +++ sc/source/core/data/column3.cxx 2009-04-06 16:41:49.000000000 +0000
3 @@ -1418,6 +1418,15 @@ void ScColumn::GetFilterEntries(SCROW nS
4 nValue = 0.0;
7 + if (pFormatter)
8 + {
9 + short nType = pFormatter->GetType(nFormat);
10 + if ((nType & NUMBERFORMAT_DATE) && !(nType & NUMBERFORMAT_TIME))
11 + // special case for date values. Disregard the time
12 + // element if the number format is of date type.
13 + nValue = ::rtl::math::approxFloor(nValue);
14 + }
16 pData = new TypedStrData( aString, nValue, SC_STRTYPE_VALUE );
18 #if 0 // DR
19 --- sc/source/core/data/table3.cxx.old 2009-04-06 16:41:48.000000000 +0000
20 +++ sc/source/core/data/table3.cxx 2009-04-06 16:41:49.000000000 +0000
21 @@ -61,6 +61,7 @@
22 #include "progress.hxx"
23 #include "cellform.hxx"
24 #include "postit.hxx"
25 +#include "svtools/zformat.hxx"
27 #include <vector>
29 @@ -1166,6 +1167,17 @@ BOOL ScTable::ValidQuery(SCROW nRow, con
31 else
32 nCellVal = GetValue( static_cast<SCCOL>(rEntry.nField), nRow );
34 + sal_uInt32 nNumFmt = GetNumberFormat(static_cast<SCCOL>(rEntry.nField), nRow);
35 + const SvNumberformat* pEntry = pDocument->GetFormatTable()->GetEntry(nNumFmt);
36 + if (pEntry)
37 + {
38 + short nNumFmtType = pEntry->GetType();
39 + if ((nNumFmtType & NUMBERFORMAT_DATE) && !(nNumFmtType & NUMBERFORMAT_TIME))
40 + // The format is of date type. Strip off the time element.
41 + nCellVal = ::rtl::math::approxFloor(nCellVal);
42 + }
44 switch (rEntry.eOp)
46 case SC_EQUAL :