From: John Levon Date: Thu, 19 Dec 2002 18:44:31 +0000 (+0000) Subject: Hopefully fix basic text entry for Kornel. Not dealing with non-locale entry yet. X-Git-Tag: 1.6.10~17752 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9ed004522e80addc3736220348f1988c66215452;p=features.git Hopefully fix basic text entry for Kornel. Not dealing with non-locale entry yet. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5880 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 043beff553..f6f130552e 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-12-19 John Levon + + * QLyXKeySym.C: do not attempt to compare Qt::Key_unknowns + 2002-12-19 Jean-Marc Lasgouttes * lyx_gui.C (getStatus): forks-show is not implemented by the qt diff --git a/src/frontends/qt2/QLyXKeySym.C b/src/frontends/qt2/QLyXKeySym.C index 874421e3c9..e3946dd878 100644 --- a/src/frontends/qt2/QLyXKeySym.C +++ b/src/frontends/qt2/QLyXKeySym.C @@ -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(k1)); + QLyXKeySym const & q2(static_cast(k2)); - return static_cast(k1).key() - == static_cast(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(); }