Kornel Benko <[EMAIL PROTECTED]> writes:
| Index: QLyXKeySym.C
| ===================================================================
| RCS file: /cvs/lyx/lyx-devel/src/frontends/qt2/QLyXKeySym.C,v
| retrieving revision 1.10
| diff -u -r1.10 QLyXKeySym.C
| --- QLyXKeySym.C 2002/10/20 01:48:27 1.10
| +++ QLyXKeySym.C 2002/12/08 16:51:53
| @@ -33,7 +33,29 @@
| void QLyXKeySym::set(QKeyEvent * ev)
| {
| key_ = ev->key();
| - text_ = ev->text();
| + {
Why this extra block?
| + QString s = ev->text();
| + lyxerr[Debug::KEY] << " unicode of key is";
| + for (int i = 0; i < s.length(); i++) {
i++ -> ++i
| + QChar a = s.ref(i);
const it?
| + lyxerr[Debug::KEY] << " " << (int) a ;
" " -> ' '
(int)a -> int(a)
| + }
| + if (s.length() > 0) {
if !s.empty()
(I guess this is some isEmpty() in QT speach.)
| + lyxerr[Debug::KEY] << " ascii == " << ev->ascii();
| + }
| + lyxerr[Debug::KEY] << endl;
| + if ((s.length() == 1) && ( key_ == 65535)) {
Is it possible to use a symbolic name for 65535? Instead of this magic
number?
| + if ((int) s.ref(0) == 0) {
s.ref(0) == QChar(0)
would look better to me.
| + char xx[2];
| + xx[0] = ev->ascii();
| + xx[1] = '\0';
| + s = xx;
Can't
s = ev->ascii()
be used?
(why not?)
| + key_ = 0;
| + }
| + }
| + text_ = s;
| + }
| + lyxerr[Debug::KEY] << "Setting key to " << key_ << ", " << text_.latin1() <<
|endl;
| }
|
|
| @@ -63,7 +89,10 @@
|
| if (sym.empty()) {
| lyxerr[Debug::KEY] << "sym empty in getSymbolName()" << endl;
| - sym = text_.latin1();
| + if (text_.length() > 0)
!text_.isEmpty()
--
Lgb