Kaydet (Commit) eace834d authored tarafından Eike Rathke's avatar Eike Rathke

Assert that nMonth and nDay <100 to be representable

Change-Id: Ie52269478ecac75519d04310a17873904c8167e6
üst 9daa6e29
...@@ -104,6 +104,8 @@ inline sal_uInt16 ImplDaysInMonth( sal_uInt16 nMonth, sal_Int16 nYear ) ...@@ -104,6 +104,8 @@ inline sal_uInt16 ImplDaysInMonth( sal_uInt16 nMonth, sal_Int16 nYear )
void Date::setDateFromDMY( sal_uInt16 nDay, 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."); SAL_WARN_IF( nYear == 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) if (nYear < 0)
mnDate = mnDate =
(static_cast<sal_Int32>( nYear ) * 10000) - (static_cast<sal_Int32>( nYear ) * 10000) -
......
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