From 9ad9ff28888db9b5c4bdac667e431f797898b9e2 Mon Sep 17 00:00:00 2001 From: msharov Date: Sat, 9 Sep 2006 17:00:06 +0000 Subject: [PATCH] Fix compound item progress calculation to include the item --- tddoc.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tddoc.cc b/tddoc.cc index 1c69c31..a47db91 100644 --- a/tddoc.cc +++ b/tddoc.cc @@ -239,8 +239,6 @@ void CTodoDocument::AppendEntry (void) void CTodoDocument::MarkEntryComplete (void) { iitem_t icuri (FindCurrentItem()); - if (icuri->HasSublist()) - return; // Compound entries are complete when all sublist items are complete icuri->MarkComplete (100 * !icuri->Complete()); UpdateCompleteStatus (icuri->Id()); ResortVisibleList(); @@ -311,7 +309,8 @@ void CTodoDocument::UpdateItemProgress (icdep_t first, icdep_t last) uint32_t progress = 0; for (; first < last; ++first) progress += FindItem(first->m_DepId)->Progress(); - progress = min (progress / nItems, 100U); + // +1 treats the parent item as part of the list. + progress = min (progress / (nItems + 1), 100U); iitem_t ii = FindItem (rangeId); if (ii == m_Todos.end() || ii->Progress() == progress) return; -- 2.11.4.GIT