summaryrefslogtreecommitdiffstats
path: root/include/tools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-05-17 14:04:34 +0200
committerEike Rathke <erack@redhat.com>2013-05-17 14:13:36 +0200
commitcd9d1bdf5e3351c929d5b651c009ee17b4d962c4 (patch)
tree6f7dacb40a5c24f736ce1a3765ce0db791a88b35 /include/tools
parentunknown printer metrics property results in empty settings.xml (diff)
downloadcore-cd9d1bdf5e3351c929d5b651c009ee17b4d962c4.tar.gz
core-cd9d1bdf5e3351c929d5b651c009ee17b4d962c4.zip
resolved fdo#63805 max day of month of the intended month
Since 6619955e72c1c2f29a32e82478d19147c0d7610a Date::GetDaysInMonth() operates on the normalized value that corresponds to the actual values set at the Date instance, obtain and set number of days for the intended month instead of using the rolled-over date. Change-Id: Ia6b007675104f8e134b278f216c3bb48b72f061c
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/date.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/tools/date.hxx b/include/tools/date.hxx
index 22586c4aaf47..72351828d233 100644
--- a/include/tools/date.hxx
+++ b/include/tools/date.hxx
@@ -138,6 +138,13 @@ public:
TOOLS_DLLPUBLIC friend Date operator -( const Date& rDate, long nDays );
TOOLS_DLLPUBLIC friend long operator -( const Date& rDate1, const Date& rDate2 );
+ /** Obtain number of days in a month of a year.
+
+ Internally sanitizes nMonth to values 1 <= nMonth <= 12, does not
+ normalize values.
+ */
+ static sal_uInt16 GetDaysInMonth( sal_uInt16 nMonth, sal_uInt16 nYear );
+
/// Internally normalizes values.
static long DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear );
/// Semantically identical to IsValidDate() member method.