From 9281cd467543214628bb57abacbc45e3bca5d68a Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Wed, 24 Jan 2007 14:01:34 +0000 Subject: [PATCH] We use char_type, not size_t for storing UCS4 characters. This may make a difference when char_type is signed. * src/frontends/LyXKeySym.h (getUCSEncoded): change return type from size_t to char_type * src/frontends/qt4/QLyXKeySym.[Ch] (getUCSEncoded): ditto * src/lyxfunc.C (LyXFunc::processKeySym): adjust to the above and add a FIXME since this is strange code that looks like it was not intended to do what it does. * src/lyxfunc.h (encoded_last_key): Correct documentation git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16833 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/LyXKeySym.h | 2 +- src/frontends/qt4/QLyXKeySym.C | 2 +- src/frontends/qt4/QLyXKeySym.h | 2 +- src/lyxfunc.C | 4 +++- src/lyxfunc.h | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/frontends/LyXKeySym.h b/src/frontends/LyXKeySym.h index fe30a1c769..23ab01b2b2 100644 --- a/src/frontends/LyXKeySym.h +++ b/src/frontends/LyXKeySym.h @@ -57,7 +57,7 @@ public: * Return the value of the keysym into the UCS-4 encoding. * This converts the LyXKeySym to a 32-bit encoded character. */ - virtual size_t getUCSEncoded() const = 0; + virtual char_type getUCSEncoded() const = 0; /** * Return a string describing the KeySym with modifier mod. diff --git a/src/frontends/qt4/QLyXKeySym.C b/src/frontends/qt4/QLyXKeySym.C index 665be121b0..4f8627947f 100644 --- a/src/frontends/qt4/QLyXKeySym.C +++ b/src/frontends/qt4/QLyXKeySym.C @@ -201,7 +201,7 @@ string QLyXKeySym::getSymbolName() const } -size_t QLyXKeySym::getUCSEncoded() const +char_type QLyXKeySym::getUCSEncoded() const { if (text_.isEmpty()) return 0; diff --git a/src/frontends/qt4/QLyXKeySym.h b/src/frontends/qt4/QLyXKeySym.h index 45a607fc8e..69d6001fe0 100644 --- a/src/frontends/qt4/QLyXKeySym.h +++ b/src/frontends/qt4/QLyXKeySym.h @@ -61,7 +61,7 @@ public: * Return the value of the keysym into the UCS-4 encoding. * This converts the LyXKeySym to a 32-bit encoded character. */ - virtual size_t getUCSEncoded() const; + virtual char_type getUCSEncoded() const; /** * Return a human-readable version of a key+modifier pair. diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 012ea03fe3..1e10da58a2 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -296,7 +296,9 @@ void LyXFunc::processKeySym(LyXKeySymPtr keysym, key_modifier::state state) //Encoding const * encoding = view()->cursor().getEncoding(); //encoded_last_key = keysym->getISOEncoded(encoding ? encoding->name() : ""); - size_t encoded_last_key = keysym->getUCSEncoded(); + // FIXME: encoded_last_key shadows the member variable of the same + // name. Is that intended? + char_type encoded_last_key = keysym->getUCSEncoded(); // Do a one-deep top-level lookup for // cancel and meta-fake keys. RVDK_PATCH_5 diff --git a/src/lyxfunc.h b/src/lyxfunc.h index d819fe27f5..4fce15e678 100644 --- a/src/lyxfunc.h +++ b/src/lyxfunc.h @@ -88,7 +88,7 @@ private: /// LyXView * lyx_view_; - /// the last character added to the key sequence, in ISO encoded form + /// the last character added to the key sequence, in UCS4 encoded form char_type encoded_last_key; ///