mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-24 05:40:59 +00:00
* fix longest prefix algorithm for sorted models: commonPrefix(...) returns the length, not the prefix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23217 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9a5aba0877
commit
ff2e0db6c2
@ -695,11 +695,12 @@ docstring GuiCompleter::longestUniqueCompletion() const
|
||||
QString const & mids
|
||||
= model.data(model.index(mid, 0),
|
||||
Qt::EditRole).toString();
|
||||
int sn = s.length();
|
||||
s = commonPrefix(mids, s);
|
||||
size_t oldLen = s.length();
|
||||
size_t len = commonPrefix(mids, s);
|
||||
s = s.left(len);
|
||||
|
||||
// left or right?
|
||||
if (s.length() == sn) {
|
||||
if (oldLen == len) {
|
||||
// middle is not far enough
|
||||
i = mid + 1;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user