[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - forms/source
Julien Nabet
serval2412 at yahoo.fr
Fri Jan 26 15:16:46 UTC 2018
forms/source/component/Time.cxx | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit b34ddf572bd5dab6173bf7daf6341d3f0f74535a
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Fri Jan 26 11:19:36 2018 +0100
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/48665
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
(cherry picked from commit a30652295be09afdbba707ce13d0a03e22c4e7a3)
Reviewed-on: https://gerrit.libreoffice.org/48692
Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/forms/source/component/Time.cxx b/forms/source/component/Time.cxx
index f54e160c038c..5ba0c808a981 100644
--- a/forms/source/component/Time.cxx
+++ b/forms/source/component/Time.cxx
@@ -22,6 +22,7 @@
#include <connectivity/dbconversion.hxx>
#include <com/sun/star/sdbc/DataType.hpp>
#include <comphelper/processfactory.hxx>
+#include <com/sun/star/util/DateTime.hpp>
using namespace dbtools;
@@ -235,6 +236,8 @@ bool OTimeModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
else
{
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.Seconds = aTime.Seconds;
aDateTime.Minutes = aTime.Minutes;
More information about the Libreoffice-commits
mailing list