summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextodfwriter
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qtextodfwriter')
-rw-r--r--tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
index 43f859c..9a62277 100644
--- a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
+++ b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
@@ -72,6 +72,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
@@ -422,5 +423,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"