summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThomas Zander <t.zander@nokia.com>2010-01-06 11:50:58 (GMT)
committerThomas Zander <t.zander@nokia.com>2010-01-06 11:52:22 (GMT)
commit59a2ed52a780afea84c118054fb7de2440a5d17f (patch)
treeb0883e21aa4770d8c79f689acee2f39c1954c592 /src/gui
parent86e656cccf7555fc4d2f52c79a8f2031cf8d320c (diff)
downloadQt-59a2ed52a780afea84c118054fb7de2440a5d17f.zip
Qt-59a2ed52a780afea84c118054fb7de2440a5d17f.tar.gz
Qt-59a2ed52a780afea84c118054fb7de2440a5d17f.tar.bz2
Don't write out fo:word-spacing if its the default value.
the property fo:word-spacing is still not in an official ODF spec so a strict schema check will fail in any doc that uses it. Lets make sure we limit the writing of that property to only those usecases where the property was really set by the user. Task-number: QTBUG-5725
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextodfwriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index 5822d92..dcc2e7d 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -556,8 +556,8 @@ void QTextOdfWriter::writeCharacterFormat(QXmlStreamWriter &writer, QTextCharFor
}
if (format.hasProperty(QTextFormat::FontLetterSpacing))
writer.writeAttribute(foNS, QString::fromLatin1("letter-spacing"), pixelToPoint(format.fontLetterSpacing()));
- if (format.hasProperty(QTextFormat::FontWordSpacing))
- writer.writeAttribute(foNS, QString::fromLatin1("word-spacing"), pixelToPoint(format.fontWordSpacing()));
+ if (format.hasProperty(QTextFormat::FontWordSpacing) && format.fontWordSpacing() != 0)
+ writer.writeAttribute(foNS, QString::fromLatin1("word-spacing"), pixelToPoint(format.fontWordSpacing()));
if (format.hasProperty(QTextFormat::FontUnderline))
writer.writeAttribute(styleNS, QString::fromLatin1("text-underline-type"),
format.fontUnderline() ? QString::fromLatin1("single") : QString::fromLatin1("none"));