diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-09-04 13:05:46 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2009-09-04 13:09:12 (GMT) |
commit | 3eb65f48c97dc5e1a8980afa35bea8e4b16f08ba (patch) | |
tree | fe1e43eb08314fd5cd548d9d48e17f16950c5bbf /src/gui | |
parent | e15ab744f15127422ef62a0b70e6cf129f52f48f (diff) | |
download | Qt-3eb65f48c97dc5e1a8980afa35bea8e4b16f08ba.zip Qt-3eb65f48c97dc5e1a8980afa35bea8e4b16f08ba.tar.gz Qt-3eb65f48c97dc5e1a8980afa35bea8e4b16f08ba.tar.bz2 |
Remove implicit margin on bulleted lists when exporting to HTML
When we export a bulleted list to HTML, we add a meta-block around the
list items to set the bullet style of the list (<ul> or <ol>.) This
block will implicitly have a margin, even if the list itself does not
in the internal document. The result is that exporting a list to HTML
and then reloading it will give a different apperance, because the 0
margin of the original was not saved. The fix is to always set the
meta-block's margin to 0, since it is only there to set the bullet
style and should not affect the layout at all.
Task-number: 201228
Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 1bdaceb..e565d0a 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2521,13 +2521,15 @@ void QTextHtmlExporter::emitBlock(const QTextBlock &block) default: html += QLatin1String("<ul"); // ### should not happen } + html += QLatin1String(" style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"); + if (format.hasProperty(QTextFormat::ListIndent)) { - html += QLatin1String(" style=\"-qt-list-indent: "); + html += QLatin1String(" -qt-list-indent: "); html += QString::number(format.indent()); - html += QLatin1String(";\""); + html += QLatin1Char(';'); } - html += QLatin1Char('>'); + html += QLatin1String("\">"); } html += QLatin1String("<li"); |