From 8ea7253327b70adb2c497bfd3a1734d9abd0c65b Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 2 May 2017 17:23:23 +0200 Subject: Date::IsValidDate: year 0 is not Change-Id: I44e476f354d04a1d070a7348e3b00d75497231c2 --- tools/source/datetime/tdate.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools') diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx index 46e5ad62469e..9815716ebe3f 100644 --- a/tools/source/datetime/tdate.cxx +++ b/tools/source/datetime/tdate.cxx @@ -464,6 +464,8 @@ bool Date::IsValidDate() const //static bool Date::IsValidDate( sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear ) { + if (nYear == 0) + return false; if ( !nMonth || (nMonth > 12) ) return false; if ( !nDay || (nDay > ImplDaysInMonth( nMonth, nYear )) ) -- cgit