From 26032e63abd01c3d5941a2728ef024da290d6b0a Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Tue, 2 Mar 2021 22:46:33 +0100 Subject: tdf#137626 XLSX import: fix missing datetime filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: László Németh --- sc/source/core/data/column3.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sc/source/core/data') 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)); } -- cgit v1.2.3