diff options
author | George Hazan <ghazan@miranda.im> | 2020-04-25 19:32:49 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-04-25 19:32:49 +0300 |
commit | 7dc8f0c12ed80977d1092e0c18f053e294b971f2 (patch) | |
tree | b8d42dd75ff043402a1847cf57378ac3ead0cd00 /plugins/NewStory/src | |
parent | 61e9808175dd39d9ff2ba39d26f13194584c8242 (diff) |
fix for data retrieving
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 5 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 3 |
2 files changed, 6 insertions, 2 deletions
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; |