diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-20 18:53:48 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-20 18:53:48 +0300 |
commit | 14457811ab95419fd256d4fefd02d61a47603b7a (patch) | |
tree | 3e12a0c1239b66d4b99f03bb7c2433239eac707d /plugins | |
parent | 72fc3f5206fc56f1a573d6a284be413411679c57 (diff) |
NewStory: fix for slow Bookmarks window
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 3 | ||||
-rw-r--r-- | plugins/NewStory/src/history_dlg.cpp | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 441eda90fd..d8c6c4d213 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -121,6 +121,9 @@ static void __cdecl sttLoadItems(void *param) auto *pData = (NewstoryListData *)param; for (int i = pData->totalCount-1; i >= 0; i--) { auto *pItem = pData->LoadItem(i, true); + if (!pItem) + break; + switch (pItem->dbe.eventType) { case EVENTTYPE_FILE: if (!pItem->m_bOfflineFile) diff --git a/plugins/NewStory/src/history_dlg.cpp b/plugins/NewStory/src/history_dlg.cpp index 2f9c80fba4..3a60ea0766 100644 --- a/plugins/NewStory/src/history_dlg.cpp +++ b/plugins/NewStory/src/history_dlg.cpp @@ -339,12 +339,14 @@ class CHistoryDlg : public CDlgBase else { ImageList_ReplaceIcon(hBookmarksIcons, -1, g_plugin.getIcon(IDI_BOOKMARK)); - auto &pArray = m_histCtrl->items; - int numItems = pArray.getCount(); - for (int i = 0; i < numItems; i++) - if (auto *pItem = pArray.get(i, true)) + int numItems = m_histCtrl->totalCount; + + for (int i = 0; i < numItems; i++) { + auto *pItem = m_histCtrl->GetItem(i); + if (pItem->fetch()) if (pItem->dbe.flags & DBEF_BOOKMARK) m_bookmarks.AddItem(pItem->wtext, 0, i); + } } } |