summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2011-11-30 02:05:24 +0100
committerEike Rathke <erack@redhat.com>2011-11-30 02:05:24 +0100
commit07a7b2937a9427b2feb3307804ec0f527091bb92 (patch)
tree99d2b0949d945004f581a89f97acb24b10465321 /chart2
parent6619955e72c1c2f29a32e82478d19147c0d7610a (diff)
fixed fdo#40363 freeze chart wizard with non-gregorian date
Use the newly introduced Date::Normalize() instead of a never ending while(!date.IsValid())
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/axes/DateHelper.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/chart2/source/view/axes/DateHelper.cxx b/chart2/source/view/axes/DateHelper.cxx
index 6749e749171e..247e0f66c16a 100644
--- a/chart2/source/view/axes/DateHelper.cxx
+++ b/chart2/source/view/axes/DateHelper.cxx
@@ -73,8 +73,7 @@ Date DateHelper::GetDateSomeMonthsAway( const Date& rD, long nMonthDistance )
nNewMonth += 12;
aRet.SetMonth( sal_uInt16(nNewMonth) );
aRet.SetYear( sal_uInt16(nNewYear) );
- while(!aRet.IsValidAndGregorian())
- aRet--;
+ aRet.Normalize();
return aRet;
}
@@ -82,8 +81,7 @@ Date DateHelper::GetDateSomeYearsAway( const Date& rD, long nYearDistance )
{
Date aRet(rD);
aRet.SetYear( static_cast<sal_uInt16>(rD.GetYear()+nYearDistance) );
- while(!aRet.IsValidAndGregorian())
- aRet--;
+ aRet.Normalize();
return aRet;
}