]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QLyXKeySym.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / QLyXKeySym.C
index a391e523254b3d1e6f074a1fcd9f92f2b7562ae1..8260a6aff2c48b8bf2c3266be6edd486537f6ee9 100644 (file)
@@ -200,18 +200,11 @@ string QLyXKeySym::getSymbolName() const
 
 size_t QLyXKeySym::getUCSEncoded() const
 {
-    unsigned short const * ptr = text_.ucs2();
-    std::vector<unsigned short> tmp(ptr, ptr + text_.length());
-
-    //lyxerr << "Data is " << tmp << endl;
-    lyxerr << "Length is " << text_.length() << endl;
-
-    if (text_.isEmpty())
-       return 0;
+       if (text_.isEmpty())
+               return 0;
 
-    //size_t res = utf8_to_ucs4(tmp, tmp.length());
-    //lyxerr << "Res is " << res << endl;
-    return ucs2_to_ucs4(tmp)[0];
+       BOOST_ASSERT(text_.size() == 1);
+       return qchar_to_ucs4(text_[0]);
 }