summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2012-10-18 15:34:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-22 03:54:15 +0200
commite737ea6dbc0430075d30ad995d402437c7231da1 (patch)
tree9491ef0f99b4d38772b66e39f74dff573222ffb1 /src
parent11e820a6a1cee10bed2992a594407dadc9d4dab5 (diff)
Use the right properties when checking the frame's margins
Changed it to check the Frame*Margin property instead of the Block*Margin property as this was incorrect for a QTextFrameFormat. Task-number: QTBUG-22173 Change-Id: I2c3066165fb592ed034874b1180593822859f933 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> (cherry picked from qtbase/d060620e6cd3c94e7e0ff809b21593b9c0da0be2)
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtextodfwriter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index d1d42e8a04..efeb98f3f7 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -669,13 +669,13 @@ void QTextOdfWriter::writeFrameFormat(QXmlStreamWriter &writer, QTextFrameFormat
writer.writeAttribute(styleNS, QString::fromLatin1("name"), QString::fromLatin1("s%1").arg(formatIndex));
writer.writeAttribute(styleNS, QString::fromLatin1("family"), QString::fromLatin1("section"));
writer.writeEmptyElement(styleNS, QString::fromLatin1("section-properties"));
- if (format.hasProperty(QTextFormat::BlockTopMargin))
+ if (format.hasProperty(QTextFormat::FrameTopMargin))
writer.writeAttribute(foNS, QString::fromLatin1("margin-top"), pixelToPoint(qMax(qreal(0.), format.topMargin())) );
- if (format.hasProperty(QTextFormat::BlockBottomMargin))
+ if (format.hasProperty(QTextFormat::FrameBottomMargin))
writer.writeAttribute(foNS, QString::fromLatin1("margin-bottom"), pixelToPoint(qMax(qreal(0.), format.bottomMargin())) );
- if (format.hasProperty(QTextFormat::BlockLeftMargin))
+ if (format.hasProperty(QTextFormat::FrameLeftMargin))
writer.writeAttribute(foNS, QString::fromLatin1("margin-left"), pixelToPoint(qMax(qreal(0.), format.leftMargin())) );
- if (format.hasProperty(QTextFormat::BlockRightMargin))
+ if (format.hasProperty(QTextFormat::FrameRightMargin))
writer.writeAttribute(foNS, QString::fromLatin1("margin-right"), pixelToPoint(qMax(qreal(0.), format.rightMargin())) );
writer.writeEndElement(); // style