Skip to content

Commit

Permalink
Add a file with missing QTextItemInt symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Jul 13, 2020
1 parent fffdce5 commit 88a4a27
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ PRIVATE
ui/style/style_core_scale.h
ui/style/style_core_types.cpp
ui/style/style_core_types.h
ui/text/qtextitemint.cpp
ui/text/text.cpp
ui/text/text.h
ui/text/text_block.cpp
Expand Down
54 changes: 54 additions & 0 deletions ui/text/qtextitemint.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// This file is part of Desktop App Toolkit,
// a set of libraries for developing nice desktop applications.
//
// For license and copyright information please follow this link:
// https://github.com/desktop-app/legal/blob/master/LEGAL
//
#ifdef DESKTOP_APP_USE_PACKAGED
#include <private/qtextengine_p.h>

QTextItemInt::QTextItemInt(
const QGlyphLayout &g,
QFont *font,
const QChar *chars_,
int numChars,
QFontEngine *fe,
const QTextCharFormat &format)
: flags(0)
, justified(false)
, underlineStyle(QTextCharFormat::NoUnderline)
, charFormat(format)
, num_chars(numChars)
, chars(chars_)
, logClusters(0)
, f(font)
, glyphs(g)
, fontEngine(fe) {
}

void QTextItemInt::initWithScriptItem(const QScriptItem &si) {
// explicitly initialize flags so that initFontAttributes can be called
// multiple times on the same TextItem
flags = 0;
if (si.analysis.bidiLevel %2)
flags |= QTextItem::RightToLeft;
ascent = si.ascent;
descent = si.descent;

if (charFormat.hasProperty(QTextFormat::TextUnderlineStyle)) {
underlineStyle = charFormat.underlineStyle();
} else if (charFormat.boolProperty(QTextFormat::FontUnderline)
|| f->d->underline) {
underlineStyle = QTextCharFormat::SingleUnderline;
}

// compat
if (underlineStyle == QTextCharFormat::SingleUnderline)
flags |= QTextItem::Underline;

if (f->d->overline || charFormat.fontOverline())
flags |= QTextItem::Overline;
if (f->d->strikeOut || charFormat.fontStrikeOut())
flags |= QTextItem::StrikeOut;
}
#endif // !DESKTOP_APP_USE_PACKAGED

0 comments on commit 88a4a27

Please sign in to comment.