From 82aa9dbec84f664174e760fbe3e4f97932bb8ee6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 May 2020 17:41:41 +0300 Subject: =?UTF-8?q?fixes=20#2384=20(NewStory:=20=D1=83=20=D0=BC=D0=BD?= =?UTF-8?q?=D0=BE=D0=B3=D0=B8=D1=85=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=20=D0=B2=20time=20tree=20=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D1=8C=201970=20=D0=B3=D0=BE=D0=B4)=20+=20code=20cleaning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/NewStory/src/history.cpp b/plugins/NewStory/src/history.cpp index 6f5cab65bd..e1aefa08eb 100644 --- a/plugins/NewStory/src/history.cpp +++ b/plugins/NewStory/src/history.cpp @@ -346,8 +346,10 @@ class CHistoryDlg : public CDlgBase int CurYear = 0, CurMonth = 0, CurDay = 0, PrevYear = -1, PrevMonth = -1, PrevDay = -1; HTREEITEM hCurYear = 0, hCurMonth = 0, hCurDay = 0; - for (int i=0; i < numItems; i++) { + for (int i = 0; i < numItems; i++) { auto *pItem = pArray->get(i, true); + if (pItem->dbe.timestamp == 0) + continue; struct tm ts = { 0 }; time_t timestamp = pItem->dbe.timestamp; @@ -362,24 +364,21 @@ class CHistoryDlg : public CDlgBase TVINSERTSTRUCT tvi; tvi.hParent = nullptr; tvi.item.mask = TVIF_TEXT | TVIF_PARAM; - if (CurYear != PrevYear) - { + if (CurYear != PrevYear) { _itow(CurYear, buf, 10); tvi.item.pszText = buf; tvi.item.lParam = 0; hCurYear = TreeView_InsertItem(m_timeTree.GetHwnd(), &tvi); PrevYear = CurYear; } - if (CurMonth != PrevMonth) - { + if (CurMonth != PrevMonth) { tvi.hParent = hCurYear; tvi.item.pszText = TranslateW(months[CurMonth - 1]); tvi.item.lParam = CurMonth; hCurMonth = TreeView_InsertItem(m_timeTree.GetHwnd(), &tvi); PrevMonth = CurMonth; } - if (CurDay != PrevDay) - { + if (CurDay != PrevDay) { _itow(CurDay, buf, 10); tvi.hParent = hCurMonth; tvi.item.pszText = buf; -- cgit v1.2.3