summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-22 15:55:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-22 15:40:26 +0100
commitce43004ca4234010c5b7243e7bb90daa6a9b7f56 (patch)
tree10524be93eb5152d0e8ea9eaa614af1c4887b2e3 /tools
parenta5fd2a21b25d49ee7c60041341aefaad6c920b09 (diff)
don't warn about 0/0/0 year, commonly used as a default-value/no-value
Change-Id: I2f6dc371f99d6963753ffaf5365a7d69ca866ca8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87190 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/datetime/tdate.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index 1fdebaac55bb..e3fd7eff5bbe 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -99,7 +99,9 @@ sal_uInt16 ImplDaysInMonth( sal_uInt16 nMonth, sal_Int16 nYear )
void Date::setDateFromDMY( sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear )
{
- SAL_WARN_IF( nYear == 0, "tools.datetime", "Date::setDateFromDMY - sure about 0 year? It's not in the calendar.");
+ // don't warn about 0/0/0, commonly used as a default-value/no-value
+ SAL_WARN_IF( nYear == 0 && !(nYear == 0 && nMonth == 0 && nDay == 0),
+ "tools.datetime", "Date::setDateFromDMY - sure about 0 year? It's not in the calendar.");
assert( nMonth < 100 && "nMonth % 100 not representable" );
assert( nDay < 100 && "nDay % 100 not representable" );
if (nYear < 0)