]> git.lyx.org Git - features.git/commitdiff
Hopefully fix basic text entry for Kornel. Not dealing with non-locale entry yet.
authorJohn Levon <levon@movementarian.org>
Thu, 19 Dec 2002 18:44:31 +0000 (18:44 +0000)
committerJohn Levon <levon@movementarian.org>
Thu, 19 Dec 2002 18:44:31 +0000 (18:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5880 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QLyXKeySym.C

index 043beff55312888c347983cdc1e011289fbc4695..f6f130552ed94e5b4f564d2dbb3ba8245d899737 100644 (file)
@@ -1,3 +1,7 @@
+2002-12-19  John Levon  <levon@movementarian.org>
+
+       * QLyXKeySym.C: do not attempt to compare Qt::Key_unknowns
 2002-12-19  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * lyx_gui.C (getStatus): forks-show is not implemented by the qt
index 874421e3c97ae7ad5e134a514812649ace1758b2..e3946dd8786a7516ef93a5c39bcd020c10d9f0db 100644 (file)
@@ -73,12 +73,10 @@ string QLyXKeySym::getSymbolName() const
 {
        string sym(qkey_to_string(key_));
 
-       if (sym.empty()) {
-               lyxerr[Debug::KEY] << "sym empty in getSymbolName()" << endl;
-               if (!text_.isEmpty())
-                       sym = fromqstr(text_);
-       }
-       lyxerr[Debug::KEY] << "getSymbolName() -> " << sym << endl;
+       // e.g. A-Za-z, and others
+       if (sym.empty())
+               sym = fromqstr(text_);
+
        return sym;
 }
 
@@ -107,10 +105,14 @@ bool QLyXKeySym::isText() const
  
 bool operator==(LyXKeySym const & k1, LyXKeySym const & k2)
 {
-       // note we ignore text_ here (non-strict ==), because
-       // text_ is not filled out by keymap initialisation
+       QLyXKeySym const & q1(static_cast<QLyXKeySym const &>(k1));
+       QLyXKeySym const & q2(static_cast<QLyXKeySym const &>(k2));
 
-       return static_cast<QLyXKeySym const &>(k1).key()
-               == static_cast<QLyXKeySym const &>(k2).key();
+       // we do not have enough info for a fair comparison, so return
+       // false. This works out OK because unknown text from Qt will
+       // get inserted anyway after the isText() check
+       if (q1.key() == Qt::Key_unknown || q2.key() == Qt::Key_unknown)
+               return false;
 
+       return q1.key() == q2.key();
 }