summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2021-03-02 22:46:33 +0100
committerLászló Németh <nemeth@numbertext.org>2021-03-12 12:20:48 +0100
commit26032e63abd01c3d5941a2728ef024da290d6b0a (patch)
tree4a30aeec14215ffd5aef9804c2c0fbba4cf1f5f1 /sc/source/core/data
parent2fce798d70bb39fe1b1dc95e2661e5836026de1a (diff)
tdf#137626 XLSX import: fix missing datetime filters
by convert string representation of the datetime data to ISO 8601 (with blank instead of T) datetime to eliminate locale dependent behaviour when filtering for datetimes. Follow-up of commit 0e751d0cb816197f15a2448ec36c57df17387e40 (tdf#116818 sc,offapi,XLSX import: fix autofiltered date columns). Change-Id: I3a0f41dbbf28a1a60a54fe7b2c8c338516edb079 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111851 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/column3.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index edf99f02bef5..2285a859d75b 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2472,6 +2472,14 @@ class FilterEntriesHandler
sal_uInt32 nIndex = pFormatter->GetFormatIndex( NF_DATE_DIN_YYYYMMDD);
pFormatter->GetInputLineString( fVal, nIndex, aStr);
}
+ else if (nType == SvNumFormatType::DATETIME)
+ {
+ // special case for datetime values.
+ // Convert string representation to ISO 8601 (with blank instead of T) datetime
+ // to eliminate locale dependent behaviour later when filtering for datetimes.
+ sal_uInt32 nIndex = pFormatter->GetFormatIndex(NF_DATETIME_ISO_YYYYMMDD_HHMMSS);
+ pFormatter->GetInputLineString(fVal, nIndex, aStr);
+ }
// maybe extend ScTypedStrData enum is also an option here
mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, ScTypedStrData::Value,bDate));
}