summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src/history_array.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-25 14:19:05 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-25 14:19:05 +0300
commitee7a91629442ba40e876e19e4cdd7af173e8e840 (patch)
treeaf9949706fef750dd88d5aa020f36fbd3f714863 /plugins/NewStory/src/history_array.cpp
parentb2d8179423721eb6cc58286dde0b1f4c94dd87ce (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.cpp11
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;
};