From ee7a91629442ba40e876e19e4cdd7af173e8e840 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Dec 2023 14:19:05 +0300 Subject: NewStory: fast fetch()-based version of search (closes #4068 completely) --- plugins/NewStory/src/history_array.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'plugins/NewStory/src/history_array.cpp') 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; }; -- cgit v1.2.3