Kaydet (Commit) a3065229 authored tarafından Julien Nabet's avatar Julien Nabet

tdf#108473: don't let empty date in datetime in forms

If only an hour is given (so no date part), copy behavior for table and query
and put 30/12/99 by default

Change-Id: Ifb371758538d2d11bd02b101a347d34816b6fddf
Reviewed-on: https://gerrit.libreoffice.org/48665Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst d4fecf0e
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <connectivity/dbconversion.hxx> #include <connectivity/dbconversion.hxx>
#include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/DataType.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <com/sun/star/util/DateTime.hpp>
using namespace dbtools; using namespace dbtools;
...@@ -235,6 +236,8 @@ bool OTimeModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) ...@@ -235,6 +236,8 @@ bool OTimeModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
else else
{ {
util::DateTime aDateTime = m_xColumn->getTimestamp(); util::DateTime aDateTime = m_xColumn->getTimestamp();
if (aDateTime.Year == 0 && aDateTime.Month == 0 && aDateTime.Day == 0)
aDateTime = ::com::sun::star::util::DateTime(0,0,0,0,30,12,1899, false);
aDateTime.NanoSeconds = aTime.NanoSeconds; aDateTime.NanoSeconds = aTime.NanoSeconds;
aDateTime.Seconds = aTime.Seconds; aDateTime.Seconds = aTime.Seconds;
aDateTime.Minutes = aTime.Minutes; aDateTime.Minutes = aTime.Minutes;
......
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