diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2010-06-05 19:45:25 (GMT) |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2010-06-09 22:07:46 (GMT) |
commit | 7358af18674f6dbd9abf67f6e02809f43e2cfc3e (patch) | |
tree | c3375195fe986e6da7a4875f9f5b760a3a48cdb0 /src | |
parent | 906a68a59c242744568afb12aba1ccc474bf6217 (diff) | |
download | Qt-7358af18674f6dbd9abf67f6e02809f43e2cfc3e.zip Qt-7358af18674f6dbd9abf67f6e02809f43e2cfc3e.tar.gz Qt-7358af18674f6dbd9abf67f6e02809f43e2cfc3e.tar.bz2 |
Make sure LayoutDirectionAuto is the default text direction
QTextFormat::intProperty requires a small change to ensure
we return the right value for layoutDirection.
No need to change QTextFormat::property, as an invalid
QVariant will be returned if the layoutDirection is not
explicitly set.
Reviewed-by: Simon Hausmann
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qtextformat.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 140cf43..46db253 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -900,11 +900,14 @@ bool QTextFormat::boolProperty(int propertyId) const */ int QTextFormat::intProperty(int propertyId) const { + // required, since the default layout direction has to be LayoutDirectionAuto, which is not integer 0 + int def = (propertyId == QTextFormat::LayoutDirection) ? int(Qt::LayoutDirectionAuto) : 0; + if (!d) - return 0; + return def; const QVariant prop = d->property(propertyId); if (prop.userType() != QVariant::Int) - return 0; + return def; return prop.toInt(); } |