summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-07-01 19:24:01 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2010-07-01 19:24:01 +0200
commit745ecfd8925716d962c97a4415881377faf6bdd5 (patch)
treec4f78b3bd143af52372064cd3ba5c0ae440813c5 /src/gui/text/qtextdocument.cpp
parentbda164303570629e44185e8baa52908ced6da301 (diff)
parent8968c79c575755cdb52d5e615ed19e4529047464 (diff)
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: bin/syncqt src/gui/text/qtextlayout.cpp tools/assistant/tools/assistant/helpviewer_qwv.cpp tools/assistant/tools/assistant/helpviewer_qwv.h tools/configure/configureapp.cpp
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r--src/gui/text/qtextdocument.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 6132d10c69..ac735e1d97 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -127,6 +127,8 @@ bool Qt::mightBeRichText(const QString& text)
tag += text[i];
else if (!tag.isEmpty() && text[i].isSpace())
break;
+ else if (!tag.isEmpty() && text[i] == QLatin1Char('/') && i + 1 == close)
+ break;
else if (!text[i].isSpace() && (!tag.isEmpty() || text[i] != QLatin1Char('!')))
return false; // that's not a tag
}
@@ -2498,13 +2500,10 @@ void QTextHtmlExporter::emitBlockAttributes(const QTextBlock &block)
QTextBlockFormat format = block.blockFormat();
emitAlignment(format.alignment());
- Qt::LayoutDirection dir = format.layoutDirection();
- if (dir == Qt::LeftToRight) {
- // assume default to not bloat the html too much
- // html += QLatin1String(" dir='ltr'");
- } else {
+ // assume default to not bloat the html too much
+ // html += QLatin1String(" dir='ltr'");
+ if (block.textDirection() == Qt::RightToLeft)
html += QLatin1String(" dir='rtl'");
- }
QLatin1String style(" style=\"");
html += style;