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
This commit is contained in:
Georg Baum 2007-01-24 14:01:34 +00:00
parent cb71a1c869
commit 9281cd4675
5 changed files with 7 additions and 5 deletions

View File

@ -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.

View File

@ -201,7 +201,7 @@ string QLyXKeySym::getSymbolName() const
}
size_t QLyXKeySym::getUCSEncoded() const
char_type QLyXKeySym::getUCSEncoded() const
{
if (text_.isEmpty())
return 0;

View File

@ -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.

View File

@ -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

View File

@ -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;
///