mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 20:45:33 +00:00
Merge remote-tracking branch 'filkry/bug1047dialoglinks'
This commit is contained in:
commit
a85c73cf35
3 changed files with 13 additions and 3 deletions
|
@ -162,7 +162,8 @@ namespace MWGui
|
|||
{
|
||||
std::string::const_iterator i = text.begin ();
|
||||
KeywordSearchT::Match match;
|
||||
while (i != text.end () && keywordSearch->search (i, text.end (), match))
|
||||
|
||||
while (i != text.end () && keywordSearch->search (i, text.end (), match, text.begin ()))
|
||||
{
|
||||
if (i != match.mBeg)
|
||||
addTopicLink (typesetter, 0, i - text.begin (), match.mBeg - text.begin ());
|
||||
|
|
|
@ -178,7 +178,7 @@ struct JournalViewModelImpl : JournalViewModel
|
|||
|
||||
KeywordSearchT::Match match;
|
||||
|
||||
while (i != utf8text.end () && mModel->mKeywordSearch.search (i, utf8text.end (), match))
|
||||
while (i != utf8text.end () && mModel->mKeywordSearch.search (i, utf8text.end (), match, utf8text.begin()))
|
||||
{
|
||||
if (i != match.mBeg)
|
||||
visitor (0, i - utf8text.begin (), match.mBeg - utf8text.begin ());
|
||||
|
|
|
@ -66,10 +66,19 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
bool search (Point beg, Point end, Match & match)
|
||||
bool search (Point beg, Point end, Match & match, Point start)
|
||||
{
|
||||
for (Point i = beg; i != end; ++i)
|
||||
{
|
||||
// check if previous character marked start of new word
|
||||
if (i != start)
|
||||
{
|
||||
Point prev = i;
|
||||
--prev;
|
||||
if(isalpha(*prev))
|
||||
continue;
|
||||
}
|
||||
|
||||
// check first character
|
||||
typename Entry::childen_t::iterator candidate = mRoot.mChildren.find (std::tolower (*i, mLocale));
|
||||
|
||||
|
|
Loading…
Reference in a new issue