]> git.lyx.org Git - features.git/commitdiff
* the longest completion does not depend on the competion.
authorStefan Schimanski <sts@lyx.org>
Thu, 28 Feb 2008 12:43:56 +0000 (12:43 +0000)
committerStefan Schimanski <sts@lyx.org>
Thu, 28 Feb 2008 12:43:56 +0000 (12:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23317 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiCompleter.cpp

index d3169948cb34d859854c727d9b329cf9f6a5c402..aa54d93d1d406146031b2d365a7c94f1fd87ac80 100644 (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