mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-09 18:52:46 +00:00
* QLyXKeySym::getUCSEncoded(): properly handle the QString (UTF16) to ucs4 conversion.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17068 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a399d6e22e
commit
ea06ca9265
@ -206,8 +206,21 @@ char_type QLyXKeySym::getUCSEncoded() const
|
|||||||
if (text_.isEmpty())
|
if (text_.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
BOOST_ASSERT(text_.size() == 1);
|
// UTF16 has a maximum of two characters.
|
||||||
return qchar_to_ucs4(text_[0]);
|
BOOST_ASSERT(text_.size() <= 2);
|
||||||
|
|
||||||
|
if (lyxerr.debugging() && text_.size() > 1) {
|
||||||
|
// We don't know yet how well support the full ucs4 range.
|
||||||
|
lyxerr[Debug::KEY] << "QLyXKeySym::getUCSEncoded()" << endl;
|
||||||
|
for (int i = 0; i < text_.size(); ++i) {
|
||||||
|
lyxerr[Debug::KEY] << "char " << i << ": "
|
||||||
|
<< text_[i].unicode() << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only one UCS4 character at the end.
|
||||||
|
docstring ucs4_text = qstring_to_ucs4(text_);
|
||||||
|
return ucs4_text[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user