summaryrefslogtreecommitdiff
path: root/plugins/NotesAndReminders/src/reminders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NotesAndReminders/src/reminders.cpp')
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp161
1 files changed, 0 insertions, 161 deletions
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp
index c2fc4306ea..21d9626fdd 100644
--- a/plugins/NotesAndReminders/src/reminders.cpp
+++ b/plugins/NotesAndReminders/src/reminders.cpp
@@ -68,167 +68,6 @@ static int ReminderSortCb(TREEELEMENT *v1, TREEELEMENT *v2)
return (((REMINDERDATA*)v1->ptrdata)->When.QuadPart < ((REMINDERDATA*)v2->ptrdata)->When.QuadPart) ? -1 : 1;
}
-
-#ifndef WINXP_MINIMUM
-// TzSpecificLocalTimeToSystemTime/SystemTimeToTzSpecificLocalTime (re-)implemented to work on win2k and older
-
-static const int DaysInMonth[2][12] =
-{
- { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, // normal year
- { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } // leap year
-};
-
-static __inline BOOL IsLeapYear(UINT Y)
-{
- return !(Y & 3) && ((Y % 100) || !(Y % 400));
-}
-
-static int TZDateComp(const SYSTEMTIME *lpDate, const SYSTEMTIME *lpDateRef)
-{
- int boundaryDay, day;
-
- if (lpDate->wMonth < lpDateRef->wMonth)
- return -1;
- if (lpDate->wMonth > lpDateRef->wMonth)
- return 1;
-
- if (!lpDateRef->wYear)
- {
- const int week = (int)lpDateRef->wDay;
- const WORD wFirst = (6 + lpDateRef->wDayOfWeek - lpDate->wDayOfWeek + lpDate->wDay) % 7 + 1;
- boundaryDay = (int)wFirst + 7 * (week - 1);
- if (boundaryDay > DaysInMonth[ IsLeapYear(lpDate->wYear) ][lpDate->wMonth-1])
- boundaryDay -= 7;
- }
- else
- boundaryDay = (int)lpDateRef->wDay;
-
- boundaryDay = ((boundaryDay * 24 + (int)lpDateRef->wHour) * 60 + (int)lpDateRef->wMinute) * 60;
- day = (((int)lpDate->wDay * 24 + (int)lpDate->wHour) * 60 + (int)lpDate->wMinute) * 60 + (int)lpDate->wSecond;
-
- return (day < boundaryDay) ? -1 : (day > boundaryDay);
-}
-
-static UINT TZGetType(LPTIME_ZONE_INFORMATION lpTZI, ULARGE_INTEGER *lpFT, BOOL bLocal)
-{
- if (lpTZI->DaylightDate.wMonth)
- {
- ULARGE_INTEGER ft = *lpFT;
- SYSTEMTIME tm;
- BOOL BeforeStandardDate, AfterDaylightDate;
- UINT id;
-
- if (!lpTZI->StandardDate.wMonth || (!lpTZI->StandardDate.wYear
- && (!lpTZI->StandardDate.wDay || lpTZI->StandardDate.wDay > 5
- || !lpTZI->DaylightDate.wDay || lpTZI->DaylightDate.wDay > 5)))
- return TIME_ZONE_ID_INVALID;
-
- if (!bLocal)
- ft.QuadPart -= (LONGLONG)(lpTZI->Bias + lpTZI->DaylightBias) * (LONGLONG)600000000;
-
- FileTimeToSystemTime((FILETIME*)&ft, &tm);
-
- BeforeStandardDate = (TZDateComp(&tm, &lpTZI->StandardDate) < 0);
-
- if (!bLocal)
- {
- ft.QuadPart -= (LONGLONG)(lpTZI->StandardBias - lpTZI->DaylightBias) * (LONGLONG)600000000;
- FileTimeToSystemTime((FILETIME*)&ft, &tm);
- }
-
- AfterDaylightDate = (TZDateComp(&tm, &lpTZI->DaylightDate) >= 0);
-
- id = TIME_ZONE_ID_STANDARD;
- if (lpTZI->DaylightDate.wMonth < lpTZI->StandardDate.wMonth)
- {
- if (BeforeStandardDate && AfterDaylightDate)
- id = TIME_ZONE_ID_DAYLIGHT;
- }
- else
- {
- if (BeforeStandardDate || AfterDaylightDate)
- id = TIME_ZONE_ID_DAYLIGHT;
- }
-
- return id;
- }
-
- return TIME_ZONE_ID_UNKNOWN;
-}
-
-static BOOL TZGetBias(LPTIME_ZONE_INFORMATION lpTZI, ULARGE_INTEGER *lpFT, BOOL bLocal, LONG *pBias)
-{
- LONG Bias = lpTZI->Bias;
-
- switch ( TZGetType(lpTZI, lpFT, bLocal) )
- {
- case TIME_ZONE_ID_INVALID: return FALSE;
- case TIME_ZONE_ID_DAYLIGHT: Bias += lpTZI->DaylightBias; break;
- case TIME_ZONE_ID_STANDARD: Bias += lpTZI->StandardBias; break;
- }
-
- *pBias = Bias;
-
- return TRUE;
-}
-
-#define TzSpecificLocalTimeToSystemTime _TzSpecificLocalTimeToSystemTime
-static BOOL _TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTZI, LPSYSTEMTIME lpLocal, LPSYSTEMTIME lpUtc)
-{
- TIME_ZONE_INFORMATION tzi;
- ULARGE_INTEGER ft;
- LONG Bias;
-
- // if possible use the real function (shouldn't be necessary, be feels more comfortable)
- if (MyTzSpecificLocalTimeToSystemTime)
- return MyTzSpecificLocalTimeToSystemTime(lpTZI, lpLocal, lpUtc);
-
- if (!lpTZI)
- {
- if (GetTimeZoneInformation(&tzi) == TIME_ZONE_ID_INVALID)
- return FALSE;
- lpTZI = &tzi;
- }
-
- if (!SystemTimeToFileTime(lpLocal, (FILETIME*)&ft)
- || !TZGetBias(lpTZI, &ft, TRUE, &Bias))
- return FALSE;
-
- ft.QuadPart += (LONGLONG)Bias * (LONGLONG)600000000;
-
- return FileTimeToSystemTime((FILETIME*)&ft, lpUtc);
-}
-
-#define SystemTimeToTzSpecificLocalTime _SystemTimeToTzSpecificLocalTime
-static BOOL _SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION lpTZI, LPSYSTEMTIME lpUtc, LPSYSTEMTIME lpLocal)
-{
- TIME_ZONE_INFORMATION tzi;
- ULARGE_INTEGER ft;
- LONG Bias;
-
- // if possible use the real function (shouldn't be necessary, be feels more comfortable)
- if (MySystemTimeToTzSpecificLocalTime)
- return MySystemTimeToTzSpecificLocalTime(lpTZI, lpUtc, lpLocal);
-
- if (!lpTZI)
- {
- if (GetTimeZoneInformation(&tzi) == TIME_ZONE_ID_INVALID)
- return FALSE;
- lpTZI = &tzi;
- }
-
- if (!SystemTimeToFileTime(lpUtc, (FILETIME*)&ft)
- || !TZGetBias(lpTZI, &ft, FALSE, &Bias))
- return FALSE;
-
- ft.QuadPart -= (LONGLONG)Bias * (LONGLONG)600000000;
-
- return FileTimeToSystemTime((FILETIME*)&ft, lpLocal);
-}
-
-#endif
-
-
// time convertsion routines that take local time-zone specific daylight saving configuration into account
// (unlike the standard FileTimeToLocalFileTime functions)