summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-15 13:22:10 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-15 13:27:27 (GMT)
commit72fc24222ab7f89dc9e606e315ebfb134ba157a8 (patch)
tree90162de211a9ff0620dceb8647aaf143c84f2877 /src/gui/painting/qpainter.cpp
parente6f191185d0a80ced3434a8b378b139386c43760 (diff)
downloadQt-72fc24222ab7f89dc9e606e315ebfb134ba157a8.zip
Qt-72fc24222ab7f89dc9e606e315ebfb134ba157a8.tar.gz
Qt-72fc24222ab7f89dc9e606e315ebfb134ba157a8.tar.bz2
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/painting/qpainter.cpp')
-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 358e856..97f3dd4 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();