From 07feb451bf28c855a383b395d1d27eb6e2558b66 Mon Sep 17 00:00:00 2001 From: George Hazan <george.hazan@gmail.com> Date: Sun, 10 Dec 2023 18:52:02 +0300 Subject: =?UTF-8?q?fixes=20#4039=20(NewStory:=20Forward=20=D0=B8=D0=B7=20?= =?UTF-8?q?=D1=87=D0=B0=D1=82=D0=B0=20=D1=81=20=D0=BF=D1=83=D1=81=D1=82?= =?UTF-8?q?=D1=8B=D0=BC=20=D0=B6=D1=83=D1=80=D0=BD=D0=B0=D0=BB=D0=BE=D0=BC?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=D0=B2=D0=BE=D0=B4=D0=B8=D1=82=20=D0=BA=20?= =?UTF-8?q?=D0=BF=D0=B0=D0=B4=D0=B5=D0=BD=D0=B8=D1=8E)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history_svc.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'plugins/NewStory/src') diff --git a/plugins/NewStory/src/history_svc.cpp b/plugins/NewStory/src/history_svc.cpp index e8dc1a154f..ad3d508df6 100644 --- a/plugins/NewStory/src/history_svc.cpp +++ b/plugins/NewStory/src/history_svc.cpp @@ -38,11 +38,10 @@ static INT_PTR SvcGetSelection(WPARAM wParam, LPARAM lParam) auto *pData = (NewstoryListData *)wParam; auto *pRet = (std::vector<MEVENT>*)lParam; if (pData && pRet) { - for (int i = pData->totalCount; i >= 0; i--) { - auto *p = pData->items.get(i); - if (p->m_bSelected) - pRet->push_back(p->hEvent); - } + for (int i = pData->totalCount; i >= 0; i--) + if (auto *p = pData->items.get(i)) + if (p->m_bSelected) + pRet->push_back(p->hEvent); if (pRet->empty() && pData->caret != -1) if (auto *p = pData->GetItem(pData->caret)) -- cgit v1.2.3