summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextformat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtextformat.cpp')
-rw-r--r--src/gui/text/qtextformat.cpp7
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();
}