summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-10-10 22:57:08 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-12 00:02:04 +0200
commit3fe242781e88224d121ebca730db5ebe4fb98ec6 (patch)
tree83686e51074ca336cb6ab3654633ca5eadf6c7b8 /src
parent257e98917c2b9c1bc06272eb663a73ee57c094c1 (diff)
Export the block's line-height settings to html
Task-number: QTBUG-28404 Change-Id: I87e03ecd981c302a5aefdadf7bcfd9729e37bd13 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtextdocument.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 03602712cc..30e0f32547 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -2531,6 +2531,29 @@ void QTextHtmlExporter::emitBlockAttributes(const QTextBlock &block)
html += QLatin1Char(';');
}
+ if (format.lineHeightType() != QTextBlockFormat::SingleHeight) {
+ switch (format.lineHeightType()) {
+ case QTextBlockFormat::ProportionalHeight:
+ case QTextBlockFormat::FixedHeight:
+ html += QLatin1String(" line-height:");
+ break;
+ case QTextBlockFormat::MinimumHeight:
+ html += QLatin1String(" min-height:");
+ break;
+ case QTextBlockFormat::LineDistanceHeight:
+ html += QLatin1String(" line-spacing:");
+ break;
+ case QTextBlockFormat::SingleHeight:
+ default:
+ break; // Should never reach here
+ }
+ html += QString::number(format.lineHeight());
+ if (format.lineHeightType() == QTextBlockFormat::ProportionalHeight)
+ html += QLatin1String("%;");
+ else
+ html += QLatin1String("px;");
+ }
+
emitPageBreakPolicy(format.pageBreakPolicy());
QTextCharFormat diff;