diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dbdocutl.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sc/source/core/data/dbdocutl.cxx b/sc/source/core/data/dbdocutl.cxx index dc7c99c8f1f4..8c18a347f48f 100644 --- a/sc/source/core/data/dbdocutl.cxx +++ b/sc/source/core/data/dbdocutl.cxx @@ -124,14 +124,17 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB SvNumFormatType::DATETIME, ScGlobal::eLnge ); util::DateTime aStamp = xRow->getTimestamp(nRowPos); - nVal = ( Date( aStamp.Day, aStamp.Month, aStamp.Year ) - - pFormTable->GetNullDate() ) + - aStamp.Hours / static_cast<double>(::tools::Time::hourPerDay) + - aStamp.Minutes / static_cast<double>(::tools::Time::minutePerDay) + - aStamp.Seconds / static_cast<double>(::tools::Time::secondPerDay) + - aStamp.NanoSeconds / static_cast<double>(::tools::Time::nanoSecPerDay); - bEmptyFlag = xRow->wasNull(); - bValue = true; + if (aStamp.Year != 0) + { + nVal = ( Date( aStamp.Day, aStamp.Month, aStamp.Year ) - + pFormTable->GetNullDate() ) + + aStamp.Hours / static_cast<double>(::tools::Time::hourPerDay) + + aStamp.Minutes / static_cast<double>(::tools::Time::minutePerDay) + + aStamp.Seconds / static_cast<double>(::tools::Time::secondPerDay) + + aStamp.NanoSeconds / static_cast<double>(::tools::Time::nanoSecPerDay); + bEmptyFlag = xRow->wasNull(); + bValue = true; + } } break; |