* the longest completion does not depend on the competion.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23317 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stefan Schimanski 2008-02-28 12:43:56 +00:00
parent 93d8667d39
commit 7ff4b67487

View File

@ -743,9 +743,11 @@ size_t commonPrefix(QString const & s1, QString const & s2)
docstring GuiCompleter::longestUniqueCompletion() const
{
QAbstractItemModel const & model = *popup()->model();
QString s = currentCompletion();
size_t n = model.rowCount();
if (n == 0)
return docstring();
QString s = model.data(model.index(0, 0), Qt::EditRole).toString();
if (modelSorting() == QCompleter::UnsortedModel) {
// For unsorted model we cannot do more than iteration.
// Iterate through the completions and cut off where s differs