summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp')
-rw-r--r--tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
index 74a7ac95ea..c287ef30ac 100644
--- a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
+++ b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
@@ -69,6 +69,7 @@ private slots:
void testWriteAll();
void testWriteSection();
void testWriteTable();
+ void testWriteFrameFormat();
private:
/// closes the document and returns the part of the XML stream that the test wrote
@@ -419,5 +420,23 @@ void tst_QTextOdfWriter::testWriteTable()
QCOMPARE(getContentFromXml(), xml);
}
+void tst_QTextOdfWriter::testWriteFrameFormat()
+{
+ QTextFrameFormat tff;
+ tff.setTopMargin(20);
+ tff.setBottomMargin(20);
+ tff.setLeftMargin(20);
+ tff.setRightMargin(20);
+ QTextCursor tc(document);
+ odfWriter->writeFrameFormat(*xmlWriter, tff, 0);
+ // Value of 15pt is based on the pixelToPoint() calculation done in qtextodfwriter.cpp
+ QString xml = QString::fromLatin1(
+ "<style:style style:name=\"s0\" style:family=\"section\">"
+ "<style:section-properties fo:margin-top=\"15pt\" fo:margin-bottom=\"15pt\""
+ " fo:margin-left=\"15pt\" fo:margin-right=\"15pt\"/>"
+ "</style:style>");
+ QCOMPARE(getContentFromXml(), xml);
+}
+
QTEST_MAIN(tst_QTextOdfWriter)
#include "tst_qtextodfwriter.moc"