diff options
author | Eike Rathke <erack@redhat.com> | 2017-05-05 15:11:33 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-05-05 15:36:34 +0200 |
commit | d50fc27e760ffe74d1f676dbfe7cae5e9add5df7 (patch) | |
tree | fb91ad4f69f2516f1645a7da4490936edc1e3513 /include | |
parent | d0a51094918a8540067953c4f70726cb911cf1ed (diff) |
Comment that day and month must be <100 and year != 0
Change-Id: Ibfb003f4ce108b401e3102fecd0843dc75fcb41e
Diffstat (limited to 'include')
-rw-r--r-- | include/tools/date.hxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/tools/date.hxx b/include/tools/date.hxx index 600c4f90a562..97a6adec925d 100644 --- a/include/tools/date.hxx +++ b/include/tools/date.hxx @@ -69,8 +69,11 @@ public: explicit Date( DateInitSystem ); explicit Date( sal_Int32 nDate ) : mnDate(nDate) {} Date( const Date& rDate ) : mnDate(rDate.mnDate) {} + + /** nDay and nMonth both must be <100, nYear must be != 0 */ Date( sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear ) { setDateFromDMY(nDay, nMonth, nYear); } + Date( const css::util::Date& rUDate ) { setDateFromDMY(rUDate.Day, rUDate.Month, rUDate.Year); @@ -83,9 +86,13 @@ public: sal_uInt32 GetDateUnsigned() const { return static_cast<sal_uInt32>(mnDate < 0 ? -mnDate : mnDate); } css::util::Date GetUNODate() const { return css::util::Date(GetDay(), GetMonth(), GetYear()); } + /** nNewDay must be <100 */ void SetDay( sal_uInt16 nNewDay ); + /** nNewMonth must be <100 */ void SetMonth( sal_uInt16 nNewMonth ); + /** nNewYear must be != 0 */ void SetYear( sal_Int16 nNewYear ); + sal_uInt16 GetDay() const { return mnDate < 0 ? |