From 0c444f72281fded5e226ec786614595a86bff4e3 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 4 Feb 2010 14:01:33 +0100 Subject: Revert changes made to QTextEngine for QStaticText Some changes were made to QTextEngine for the sake of QStaticText, but as the implementation of QStaticText changed, these are no longer needed. Although they are harmless, I'll remove them to minimize the diff. --- src/gui/text/qtextengine.cpp | 58 -------------------------------------------- src/gui/text/qtextengine_p.h | 11 +-------- 2 files changed, 1 insertion(+), 68 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index b55ac68..02eae98 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2109,19 +2109,6 @@ void QTextEngine::LayoutData::reallocate(int totalGlyphs) allocated = newAllocated; } -QGlyphLayout QGlyphLayout::clone(char *address) const -{ - QGlyphLayout layout(address, numGlyphs); - memmove(layout.offsets, offsets, numGlyphs * sizeof(QFixedPoint)); - memmove(layout.attributes, attributes, numGlyphs * sizeof(HB_GlyphAttributes)); - memmove(layout.justifications, justifications, numGlyphs * sizeof(QGlyphJustification)); - memmove(layout.advances_y, advances_y, numGlyphs * sizeof(QFixed)); - memmove(layout.advances_x, advances_x, numGlyphs * sizeof(QFixed)); - memmove(layout.glyphs, glyphs, numGlyphs * sizeof(HB_Glyph)); - - return layout; -} - // grow to the new size, copying the existing data to the new layout void QGlyphLayout::grow(char *address, int totalGlyphs) { @@ -2637,51 +2624,6 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo : justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format), num_chars(0), chars(0), logClusters(0), f(0), fontEngine(0) { - init(si, font, format); -} - -QTextItemInt::QTextItemInt(const QTextItemInt &other) - : descent(other.descent), ascent(other.ascent), width(other.width), - flags(other.flags), justified(other.justified), underlineStyle(other.underlineStyle), - charFormat(other.charFormat), num_chars(other.num_chars), chars(other.chars), - fontEngine(other.fontEngine), f(other.f), glyphs(other.glyphs), - logClusters(other.logClusters) -{ -} - - -QTextItemInt QTextItemInt::clone(char *glyphLayoutMemory, unsigned short *logClusterMemory) const -{ - QTextItemInt ti(*this); - - ti.glyphs = glyphs.clone(glyphLayoutMemory); - ti.logClusters = logClusterMemory; - memmove(logClusterMemory, logClusters, glyphs.numGlyphs * sizeof(unsigned short)); - - return ti; -} - -QTextItemInt &QTextItemInt::operator=(const QTextItemInt &other) -{ - descent = other.descent; - ascent = other.ascent; - width = other.width; - flags = other.flags; - justified = other.justified; - underlineStyle = other.underlineStyle; - charFormat = other.charFormat; - num_chars = other.num_chars; - chars = other.chars; - fontEngine = other.fontEngine; - f = other.f; - glyphs = other.glyphs; - logClusters = other.logClusters; - - return *this; -} - -void QTextItemInt::init(const QScriptItem &si, QFont *font, const QTextCharFormat &format) -{ // explicitly initialize flags so that initFontAttributes can be called // multiple times on the same TextItem flags = 0; diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 347b71e..f36cbd2 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -262,8 +262,6 @@ struct QGlyphLayout } void grow(char *address, int totalGlyphs); - - QGlyphLayout clone(char *address) const; }; class QVarLengthGlyphLayoutArray : private QVarLengthArray, public QGlyphLayout @@ -312,19 +310,12 @@ public: : justified(false), underlineStyle(QTextCharFormat::NoUnderline), num_chars(0), chars(0), logClusters(0), f(0), fontEngine(0) {} - - QTextItemInt(const QTextItemInt &other); QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat()); - void init(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat()); - - QTextItemInt clone(char *glyphLayoutMemory, unsigned short *logClusterMemory) const; /// copy the structure items, adjusting the glyphs arrays to the right subarrays. /// the width of the returned QTextItemInt is not adjusted, for speed reasons QTextItemInt midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const; - QTextItemInt &operator=(const QTextItemInt &other); - QFixed descent; QFixed ascent; QFixed width; @@ -332,7 +323,7 @@ public: RenderFlags flags; bool justified; QTextCharFormat::UnderlineStyle underlineStyle; - QTextCharFormat charFormat; + const QTextCharFormat charFormat; int num_chars; const QChar *chars; const unsigned short *logClusters; -- cgit v0.12