mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 18:24:48 +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
|
QString const & mids
|
||||||
= model.data(model.index(mid, 0),
|
= model.data(model.index(mid, 0),
|
||||||
Qt::EditRole).toString();
|
Qt::EditRole).toString();
|
||||||
int sn = s.length();
|
size_t oldLen = s.length();
|
||||||
s = commonPrefix(mids, s);
|
size_t len = commonPrefix(mids, s);
|
||||||
|
s = s.left(len);
|
||||||
|
|
||||||
// left or right?
|
// left or right?
|
||||||
if (s.length() == sn) {
|
if (oldLen == len) {
|
||||||
// middle is not far enough
|
// middle is not far enough
|
||||||
i = mid + 1;
|
i = mid + 1;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user