summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-15 15:22:10 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-15 15:27:27 +0200
commit72fc24222ab7f89dc9e606e315ebfb134ba157a8 (patch)
tree90162de211a9ff0620dceb8647aaf143c84f2877 /src/gui
parente6f191185d0a80ced3434a8b378b139386c43760 (diff)
Fix drawing text in QPicture and printing in right-to-left mode
Change 979d1d3bbc0c68789edbe93f03464d41d7a8469a requires qt_format_text() to honor the Qt::TextForceLeftToRight flag. Without this, the text will be laid out RTL twice, and the output will be broken. Since printing is done through QPicture, this fixes printing when the UI is reversed. Task-number: 261033 Reviewed-by: Trond
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qpainter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 358e8564ae..97f3dd428f 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -7469,7 +7469,11 @@ void qt_format_text(const QFont &fnt, const QRectF &_r,
bool hidemnmemonic = (tf & Qt::TextHideMnemonic);
Qt::LayoutDirection layout_direction;
- if(option)
+ if (tf & Qt::TextForceLeftToRight)
+ layout_direction = Qt::LeftToRight;
+ else if (tf & Qt::TextForceRightToLeft)
+ layout_direction = Qt::RightToLeft;
+ else if (option)
layout_direction = option->textDirection();
else if (painter)
layout_direction = painter->layoutDirection();