summaryrefslogtreecommitdiff
path: root/sc/source/core/data/column3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/column3.cxx')
-rw-r--r--sc/source/core/data/column3.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index dc206950b3ea..22b75b8d4a6a 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1467,8 +1467,9 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
}
-void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings)
+void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings, bool& rHasDates)
{
+ bool bHasDates = false;
SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
String aString;
SCROW nRow = 0;
@@ -1504,6 +1505,18 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
nValue = 0.0;
}
+ if (pFormatter)
+ {
+ short nType = pFormatter->GetType(nFormat);
+ if ((nType & NUMBERFORMAT_DATE) && !(nType & NUMBERFORMAT_TIME))
+ {
+ // special case for date values. Disregard the time
+ // element if the number format is of date type.
+ nValue = ::rtl::math::approxFloor(nValue);
+ bHasDates = true;
+ }
+ }
+
pData = new TypedStrData( aString, nValue, SC_STRTYPE_VALUE );
}
#if 0 // DR
@@ -1522,6 +1535,8 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
++nIndex;
}
+
+ rHasDates = bHasDates;
}
//