Merge pull request #4920 from Vulpine05/Vulpine05-4913

This commit is contained in:
Vitalii Koshura 2022-09-09 09:15:05 +02:00 committed by GitHub
commit 4120d2a3ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 20 deletions

View File

@ -1312,10 +1312,12 @@ void CViewWork::GetDocReportDeadline(wxInt32 item, time_t& tBuffer) const {
void CViewWork::GetDocEstCompletionDate(wxInt32 item, time_t& tBuffer) const {
RESULT* result = wxGetApp().GetDocument()->result(item);
tBuffer = 0;
if (result->active_task_state == 1) {
time_t ttime = time(0);
tBuffer = ttime;
tBuffer += (time_t)result->estimated_cpu_time_remaining;
if (result) {
if (result->active_task_state == 1) {
time_t ttime = time(0);
tBuffer = ttime;
tBuffer += (time_t)result->estimated_cpu_time_remaining;
}
}
}
@ -1323,13 +1325,14 @@ void CViewWork::GetDocEstCompletionDate(wxInt32 item, time_t& tBuffer) const {
void CViewWork::GetDocEstDeadlineDiff(wxInt32 item, double& fBuffer) const {
RESULT* result = wxGetApp().GetDocument()->result(item);
fBuffer = 0;
if (result->active_task_state == 1) {
time_t tdeadline, testcompletion;
GetDocEstCompletionDate(item, testcompletion);
GetDocReportDeadline(item, tdeadline);
fBuffer = (double)(tdeadline - testcompletion);
if (result) {
if (result->active_task_state == 1) {
time_t tdeadline, testcompletion;
GetDocEstCompletionDate(item, testcompletion);
GetDocReportDeadline(item, tdeadline);
fBuffer = (double)(tdeadline - testcompletion);
}
}
}