Correct the bit field sizes in QTextOption

There's an off-by-one error that has been carried over since at least
Qt 4.0.0. Because of that, the class is actually 4 bytes bigger than
calculated.

Change-Id: Iaefdf657fdc780aae16390fde3c01074160e4cd9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Thiago Macieira 2013-09-29 21:13:25 -07:00 committed by The Qt Project
parent 660aed3516
commit 57e1c9a7bd
2 changed files with 5 additions and 1 deletions

View File

@ -61,6 +61,7 @@ QTextOption::QTextOption()
wordWrap(QTextOption::WordWrap), wordWrap(QTextOption::WordWrap),
design(false), design(false),
unused(0), unused(0),
unused2(0),
f(0), f(0),
tab(-1), tab(-1),
d(0) d(0)
@ -78,6 +79,7 @@ QTextOption::QTextOption(Qt::Alignment alignment)
wordWrap(QTextOption::WordWrap), wordWrap(QTextOption::WordWrap),
design(false), design(false),
unused(0), unused(0),
unused2(0),
f(0), f(0),
tab(-1), tab(-1),
d(0) d(0)
@ -104,6 +106,7 @@ QTextOption::QTextOption(const QTextOption &o)
design(o.design), design(o.design),
direction(o.direction), direction(o.direction),
unused(o.unused), unused(o.unused),
unused2(o.unused2),
f(o.f), f(o.f),
tab(o.tab), tab(o.tab),
d(0) d(0)

View File

@ -134,7 +134,8 @@ private:
uint wordWrap : 4; uint wordWrap : 4;
uint design : 1; uint design : 1;
uint direction : 2; uint direction : 2;
uint unused : 18; uint unused : 17;
uint unused2; // ### Qt 6: remove unnecessary, extra 32 bits
uint f; uint f;
qreal tab; qreal tab;
QTextOptionPrivate *d; QTextOptionPrivate *d;