|
a/src/qtgui/ssearch_w.cpp |
|
b/src/qtgui/ssearch_w.cpp |
|
... |
|
... |
350 |
s = qs2utf8s(txt.right(txt.size() - cs));
|
350 |
s = qs2utf8s(txt.right(txt.size() - cs));
|
351 |
return cs;
|
351 |
return cs;
|
352 |
}
|
352 |
}
|
353 |
|
353 |
|
354 |
// Create completion list for term by adding a joker at the end and calling
|
354 |
// Create completion list for term by adding a joker at the end and calling
|
355 |
// rcldb->termMatch(). This does not work well if the db is not
|
355 |
// rcldb->termMatch().
|
356 |
// rcldb->stripped, the completion is casediac-sensitive in this case.
|
|
|
357 |
//
|
|
|
358 |
// What we should do instead is complete the term from the key list in
|
|
|
359 |
// the casediac expansion db (stripped->unstripped synonyms table),
|
|
|
360 |
// then expand each of the completed keys.
|
|
|
361 |
int SSearch::completionList(string s, QStringList& lst, int max)
|
356 |
int SSearch::completionList(string s, QStringList& lst, int max)
|
362 |
{
|
357 |
{
|
363 |
if (!rcldb)
|
358 |
if (!rcldb)
|
364 |
return -1;
|
359 |
return -1;
|
|
|
360 |
if (s.empty())
|
|
|
361 |
return 0;
|
365 |
// Query database for completions
|
362 |
// Query database for completions
|
366 |
s += "*";
|
363 |
s += "*";
|
367 |
Rcl::TermMatchResult tmres;
|
364 |
Rcl::TermMatchResult tmres;
|
368 |
if (!rcldb->termMatch(Rcl::Db::ET_WILD, "", s, tmres, max) ||
|
365 |
if (!rcldb->termMatch(Rcl::Db::ET_WILD, "", s, tmres, max) ||
|
369 |
tmres.entries.size() == 0) {
|
366 |
tmres.entries.size() == 0) {
|