From 7dc8f0c12ed80977d1092e0c18f053e294b971f2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 25 Apr 2020 19:32:49 +0300 Subject: fix for data retrieving --- plugins/NewStory/src/history_array.cpp | 5 ++++- plugins/NewStory/src/history_control.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/NewStory/src') diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 5ffc175cff..b5d03d0b23 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -193,7 +193,10 @@ ItemData* HistoryArray::get(int id, ItemData::EventLoadMode mode) if (pageNo >= pages.getCount()) return nullptr; - return &pages[pageNo].data[id % HIST_BLOCK_SIZE]; + auto *p = &pages[pageNo].data[id % HIST_BLOCK_SIZE]; + if (mode != ItemData::ELM_NOTHING) + p->load(mode); + return p; } int HistoryArray::getCount() const diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index e843906dff..7afb4d0556 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -273,7 +273,8 @@ static int LayoutItem(HWND hwnd, HistoryArray *items, int index) int width = rc.right - rc.left; ItemData *item = items->get(index, ItemData::ELM_DATA); - if (!item) return 0; + if (!item) + return 0; int tpl; int fontid; -- cgit v1.2.3