summaryrefslogtreecommitdiff
path: root/basic/source/sbx/sbxscan.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-05-02 23:08:03 +0200
committerEike Rathke <erack@redhat.com>2017-05-02 23:12:34 +0200
commit6d424f07701bf26d8fb173563b567d5f097c33e2 (patch)
tree06c5a0bf2eb4b70668d56bb6e972587b19243627 /basic/source/sbx/sbxscan.cxx
parenteace834d0830bbf4c89f7f5ea8666fb91527e466 (diff)
Replace mouth-painted "inaccurate around leap year" rollover algorithm
... with proper tools::Date methods Normalize() and AddMonths(). Also prepare functionality to easily switch on rollover for StarBASIC as well, i.e. when called by DateSerial() runtime function. For StarBASIC, invalid date for day > daysinmonthofyear is now (or better since a previous commit 94bb96ada421b423e9ed30526fe5a6aac95f00b9 from today) properly detected, not just dumb 1<=day<=31. Change-Id: Ibb44f7247726f1e1168f0e66c5ae18e073d19f08
Diffstat (limited to 'basic/source/sbx/sbxscan.cxx')
-rw-r--r--basic/source/sbx/sbxscan.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index dd0a531e964c..5e73e62f2db7 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -761,7 +761,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
{
sal_Int16 nYear = implGetDateYear( nNumber );
double dBaseDate;
- implDateSerial( nYear, 1, 1, true, dBaseDate );
+ implDateSerial( nYear, 1, 1, true, false, dBaseDate );
sal_Int32 nYear32 = 1 + sal_Int32( nNumber - dBaseDate );
rRes = OUString::number(nYear32);
}