diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-25 14:19:05 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-25 14:19:05 +0300 |
commit | ee7a91629442ba40e876e19e4cdd7af173e8e840 (patch) | |
tree | af9949706fef750dd88d5aa020f36fbd3f714863 /plugins/NewStory/src/history_array.cpp | |
parent | b2d8179423721eb6cc58286dde0b1f4c94dd87ce (diff) |
NewStory: fast fetch()-based version of search (closes #4068 completely)
Diffstat (limited to 'plugins/NewStory/src/history_array.cpp')
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 7fa979e204..1193f56449 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -54,8 +54,15 @@ bool Filter::check(ItemData *item) const } } - if (flags & (EVENTTEXT | EVENTONLY)) - return CheckFilter(item->getWBuf(), text); + if (flags & (EVENTTEXT | EVENTONLY)) { + if (item->m_bLoaded) + return CheckFilter(item->wtext, text); + + if (!item->fetch()) + return false; + + return CheckFilter(ptrW(DbEvent_GetTextW(&item->dbe, CP_UTF8)), text); + } return true; }; |