9
#include "../TextShape.h"
12
class KoTextDocumentLayout;
18
class TestSections : public QObject
27
* Initialize for a new test.
29
* @param sectionStyles a list of section styles to use.
31
void initTest(const KoSectionStyle *sectionStyles);
34
* Initialize for a new test. Simplified version.
36
* @param sectionStyle the section style to use.
38
void initTestSimple(KoSectionStyle *sectionStyle);
40
/// Clean up after a test.
44
/// Common initialization for all tests.
46
/// Test very basic layout functionality.
47
void testBasicLayout();
48
/// Test table padding.
49
void testShrinkByMargin();
50
/// Test table padding.
51
void testMoveByMargin();
56
KoTextDocumentLayout *m_layout;
57
KoStyleManager *m_styleManager;
59
MockTextShape *m_shape;
61
// Default styles for the test.
62
KoSectionStyle *m_defaultSectionStyle;
65
class MockTextShape : public TextShape
68
MockTextShape() : TextShape(0)
70
layout = qobject_cast<KoTextDocumentLayout*>(textShapeData()->document()->documentLayout());
72
void paint(QPainter &painter, const KoViewConverter &converter)
77
virtual void saveOdf(KoShapeSavingContext &) const {}
78
virtual bool loadOdf(const KoXmlElement &, KoShapeLoadingContext &) {
81
KoTextDocumentLayout *layout;
84
#endif // TESTSECTIONS_H