On Wed, Dec 04, 2002 at 05:28:57PM +0100, Juergen Spitzmueller wrote:

> Please do this (or send me a patch to test). This area looks very strange to 
> me.

Try this

john


Index: QLyXKeySym.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLyXKeySym.h,v
retrieving revision 1.8
diff -u -r1.8 QLyXKeySym.h
--- QLyXKeySym.h        20 Oct 2002 01:48:27 -0000      1.8
+++ QLyXKeySym.h        4 Dec 2002 16:39:12 -0000
@@ -60,6 +60,11 @@
        int key() const {
                return key_;
        }
+
+       QString text() const {
+               return text_;
+       }
+ 
 private:
        /// the Qt sym value
        int key_;
Index: QLyXKeySym.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLyXKeySym.C,v
retrieving revision 1.10
diff -u -r1.10 QLyXKeySym.C
--- QLyXKeySym.C        20 Oct 2002 01:48:27 -0000      1.10
+++ QLyXKeySym.C        4 Dec 2002 16:39:12 -0000
@@ -79,10 +79,14 @@
 
 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));
+ 
+       if (q1.key() == Qt::Key_unknown) 
+               lyxerr[Debug::KEY] << "q1 is unknown () ??" << q1.text().latin1() << 
+endl;
 
-       return static_cast<QLyXKeySym const &>(k1).key()
-               == static_cast<QLyXKeySym const &>(k2).key();
+       if (q2.key() != Qt::Key_unknown)
+               return q1.key() == q2.key();
 
+       return q1.text() == qtext_to_symbol(q2.text());
 }
Index: qlkey.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qlkey.h,v
retrieving revision 1.16
diff -u -r1.16 qlkey.h
--- qlkey.h     4 Dec 2002 11:06:03 -0000       1.16
+++ qlkey.h     4 Dec 2002 16:39:18 -0000
@@ -555,4 +555,11 @@
        }
 }
 
+
+QString const qtext_to_symbol(QString const & text)
+{
+       if (text == 'Ä') return "Adiaeresis";
+       return "";
+}
+
 #endif // QLKEY_H

Reply via email to