void TestTableCellStyle::testMargin() { QTextTableFormat format1; format1.setProperty(QTextFormat::FrameLeftMargin, 4.0); format1.setProperty(QTextFormat::FrameRightMargin, 8.0); format1.setProperty(QTextFormat::FrameTopMargin, 9.0); format1.setProperty(QTextFormat::FrameBottomMargin, 3.0); KoTableStyle *style = new KoTableStyle(format1); QVERIFY(style); QCOMPARE(style->leftMargin(), 4.0); QCOMPARE(style->rightMargin(), 8.0); QCOMPARE(style->topMargin(), 9.0); QCOMPARE(style->bottomMargin(), 3.0); style->setLeftMargin(QTextLength(QTextLength::FixedLength, 14.0)); style->setRightMargin(QTextLength(QTextLength::FixedLength, 18.0)); style->setTopMargin(QTextLength(QTextLength::FixedLength, 19.0)); style->setBottomMargin(QTextLength(QTextLength::FixedLength, 13.0)); QTextTableFormat format2; style->applyStyle(format2); QCOMPARE(format2.doubleProperty(QTextFormat::FrameLeftMargin), 14.0); QCOMPARE(format2.doubleProperty(QTextFormat::FrameRightMargin), 18.0); QCOMPARE(format2.doubleProperty(QTextFormat::FrameTopMargin), 19.0); QCOMPARE(format2.doubleProperty(QTextFormat::FrameBottomMargin), 13.0); }