]> git.lyx.org Git - features.git/commitdiff
Fix crash on cygwin with completion in text mode.
authorEnrico Forestieri <forenr@lyx.org>
Thu, 28 Feb 2008 10:28:10 +0000 (10:28 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 28 Feb 2008 10:28:10 +0000 (10:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23308 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiCompleter.cpp

index a6de4f9729ea0ae158f2f957b947b42343e29093..1c1fd009ab4a3b311a27affbae63d6fc92ea0c2a 100644 (file)
@@ -130,9 +130,10 @@ public:
                if (role != Qt::DisplayRole && role != Qt::EditRole)
                    return QVariant();
                    
-               if (index.column() == 0)
-                       return toqstr(list_->data(index.row()));
-               else if (index.column() == 1) {
+               if (index.column() == 0) {
+                       docstring const word = list_->data(index.row());
+                       return toqstr(word);
+               } else if (index.column() == 1) {
                        // get icon from cache
                        QPixmap scaled;
                        QString const name = ":" + toqstr(list_->icon(index.row()));