diff options
author | Noel Grandin <noel@peralex.com> | 2016-10-11 08:15:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-11 08:43:33 +0000 |
commit | d0304a8f57b3fe0065193a2a3f7089f414b1ffd9 (patch) | |
tree | 6ac18f078dc91b56ae7db204028c15089113339c /i18npool | |
parent | 52dfb06b194bf890510352a98540c64bc3d44b70 (diff) |
remove some conversion operator methods
which, in these cases, only serve to make the code harder to read
Change-Id: Ic9bcf42545b4fcfd60a535fb63956092d392f469
Reviewed-on: https://gerrit.libreoffice.org/29685
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/calendar/calendar_jewish.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/i18npool/source/calendar/calendar_jewish.cxx b/i18npool/source/calendar/calendar_jewish.cxx index 19b62d3229e5..a060aa9d5bf6 100644 --- a/i18npool/source/calendar/calendar_jewish.cxx +++ b/i18npool/source/calendar/calendar_jewish.cxx @@ -139,20 +139,20 @@ public: explicit HebrewDate(sal_Int32 d) { // Computes the Hebrew date from the absolute date. year = (d + HebrewEpoch) / 366; // Approximation from below. // Search forward for year from the approximation. - while (d >= HebrewDate(7,1,year + 1)) + while (d >= HebrewDate(7,1,year + 1).GetAbsoluteDate()) year++; // Search forward for month from either Tishri or Nisan. - if (d < HebrewDate(1, 1, year)) + if (d < HebrewDate(1, 1, year).GetAbsoluteDate()) month = 7; // Start at Tishri else month = 1; // Start at Nisan - while (d > HebrewDate(month, (LastDayOfHebrewMonth(month,year)), year)) + while (d > HebrewDate(month, (LastDayOfHebrewMonth(month,year)), year).GetAbsoluteDate()) month++; // Calculate the day by subtraction. - day = d - HebrewDate(month, 1, year) + 1; + day = d - HebrewDate(month, 1, year).GetAbsoluteDate() + 1; } - operator int() { // Computes the absolute date of Hebrew date. + int GetAbsoluteDate() const { // Computes the absolute date of Hebrew date. sal_Int32 DayInYear = day; // Days so far this month. if (month < 7) { // Before Tishri, so add days in prior months // this year before and after Nisan. @@ -217,16 +217,16 @@ public: explicit GregorianDate(int d) { // Computes the Gregorian date from the absolute date. // Search forward year by year from approximate year year = d/366; - while (d >= GregorianDate(1,1,year+1)) + while (d >= GregorianDate(1,1,year+1).GetAbsoluteDate()) year++; // Search forward month by month from January month = 1; - while (d > GregorianDate(month, LastDayOfGregorianMonth(month,year), year)) + while (d > GregorianDate(month, LastDayOfGregorianMonth(month,year), year).GetAbsoluteDate()) month++; - day = d - GregorianDate(month,1,year) + 1; + day = d - GregorianDate(month,1,year).GetAbsoluteDate() + 1; } - operator int() { // Computes the absolute date from the Gregorian date. + int GetAbsoluteDate() const { // Computes the absolute date from the Gregorian date. int N = day; // days this month for (int m = month - 1; m > 0; m--) // days in prior months this year N = N + LastDayOfGregorianMonth(m, year); @@ -251,7 +251,7 @@ void Calendar_jewish::mapFromGregorian() throw(RuntimeException) if (fieldValue[CalendarFieldIndex::ERA] == 0) y = 1 - y; GregorianDate Temp(fieldValue[CalendarFieldIndex::MONTH] + 1, fieldValue[CalendarFieldIndex::DAY_OF_MONTH], y); - HebrewDate hd(Temp); + HebrewDate hd(Temp.GetAbsoluteDate()); fieldValue[CalendarFieldIndex::ERA] = hd.GetYear() <= 0 ? 0 : 1; fieldValue[CalendarFieldIndex::MONTH] = sal::static_int_cast<sal_Int16>( hd.GetMonth() - 1 ); @@ -268,7 +268,7 @@ void Calendar_jewish::mapToGregorian() throw(RuntimeException) if (fieldSetValue[CalendarFieldIndex::ERA] == 0) y = 1 - y; HebrewDate Temp(fieldSetValue[CalendarFieldIndex::MONTH] + 1, fieldSetValue[CalendarFieldIndex::DAY_OF_MONTH], y); - GregorianDate gd(Temp); + GregorianDate gd(Temp.GetAbsoluteDate()); fieldSetValue[CalendarFieldIndex::ERA] = gd.GetYear() <= 0 ? 0 : 1; fieldSetValue[CalendarFieldIndex::MONTH] = sal::static_int_cast<sal_Int16>( gd.GetMonth() - 1 ); |