mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-06 00:10:59 +00:00
Compilation fix for QT2
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5417 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c2771dd61f
commit
f4af5ce9cf
@ -257,14 +257,16 @@ Painter & QLPainter::text(int x, int y,
|
||||
encoding = encodings.symbol_encoding();
|
||||
|
||||
QString str;
|
||||
#if QT_VERSION >= 0x030000
|
||||
str.setLength(ls);
|
||||
for (size_t i = 0; i < ls; ++i)
|
||||
str[i] = QChar(encoding->ucs(s[i]));
|
||||
|
||||
#if QT_VERSION >= 0x030000
|
||||
// HACK: QT3 refuses to show single compose characters
|
||||
if (ls = 1 && str[0].unicode() >= 0x05b0 && str[0].unicode() <= 0x05c2)
|
||||
str = ' '+str;
|
||||
#else
|
||||
for (size_t i = 0; i < ls; ++i)
|
||||
str += QChar(encoding->ucs(s[i]));
|
||||
#endif
|
||||
|
||||
if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
|
||||
|
@ -85,9 +85,14 @@ int width(char const * s, size_t ls, LyXFont const & f)
|
||||
encoding = encodings.symbol_encoding();
|
||||
|
||||
QString str;
|
||||
#if QT_VERSION >= 0x030000
|
||||
str.setLength(ls);
|
||||
for (size_t i = 0; i < ls; ++i)
|
||||
str[i] = QChar(encoding->ucs(s[i]));
|
||||
#else
|
||||
for (size_t i = 0; i < ls; ++i)
|
||||
str += QChar(encoding->ucs(s[i]));
|
||||
#endif
|
||||
|
||||
if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
|
||||
return metrics(f).width(str);
|
||||
|
Loading…
Reference in New Issue
Block a user