-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
4.7.4
-
None
This code:
QString str = "<div style=\"font-size: 16pt;\">large<font size=\"2\">small</font>large again</div>";
QTextDocument doc;
doc.setHtml(str);
QString result = doc.toHtml();
leaves 'result' with this:
...
<span style=" font-size:16pt;">large</span>
<span style=" font-size:16pt;">small</span>
<span style=" font-size:16pt;">large again</span>
...
Which is wrong, since the middle span should have "font-size: small" instead of "font-size; 16pt;". During toHtml(), the QTextCharFormat object that holds the format for that span has both the QTextFormat::FontPointSize property set and the QTextFormat::FontSizeAdjustment property set, when I think it should only have the latter. As a result, the toHtml() call makes its way to QTextHtmlExporter::emitCharFormatStyle(), finds the FontPointSize property, and writes this out while incorrectly ignoring the FontSizeAdjustment property.