Kaydet (Commit) 5374c04a authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: tdf#100822 use sax::Converter::parseDateTime() for 'd' ISO 8601 date

Instead of squeezing the string through the locale dependent
number parser (which should force '.' Time100SecSeparator for 'T'
ISO 8601 but apparently doesn't yet) that is a bottle neck anyway.

Change-Id: I70f74e680322a715c9cc658c8be033620d9798e3
üst 625653c8
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "documentimport.hxx" #include "documentimport.hxx"
#include "formulabuffer.hxx" #include "formulabuffer.hxx"
#include <numformat.hxx> #include <numformat.hxx>
#include <sax/tools/converter.hxx>
namespace oox { namespace oox {
namespace xls { namespace xls {
...@@ -206,15 +207,17 @@ void SheetDataBuffer::setErrorCell( const CellModel& rModel, sal_uInt8 nErrorCod ...@@ -206,15 +207,17 @@ void SheetDataBuffer::setErrorCell( const CellModel& rModel, sal_uInt8 nErrorCod
void SheetDataBuffer::setDateCell( const CellModel& rModel, const OUString& rDateString ) void SheetDataBuffer::setDateCell( const CellModel& rModel, const OUString& rDateString )
{ {
ScDocument& rDoc = getScDocument(); css::util::DateTime aDateTime;
SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); if (!sax::Converter::parseDateTime( aDateTime, nullptr, rDateString))
{
double fValue = 0.0; SAL_WARN("sc.filter", "SheetDataBuffer::setDateCell - could not parse: " << rDateString);
sal_uInt32 nFormatIndex = 0; // At least don't lose data.
bool bValid = pFormatter->IsNumberFormat( rDateString, nFormatIndex, fValue ); setStringCell( rModel, rDateString);
return;
}
if(bValid) double fSerial = getUnitConverter().calcSerialFromDateTime( aDateTime);
setValueCell( rModel, fValue ); setValueCell( rModel, fSerial);
} }
void SheetDataBuffer::createSharedFormula(const ScAddress& rAddr, const ApiTokenSequence& rTokens) void SheetDataBuffer::createSharedFormula(const ScAddress& rAddr, const ApiTokenSequence& rTokens)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment