Changeset View
Changeset View
Standalone View
Standalone View
libs/textlayout/tests/TestTableLayout.h
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 42 | private Q_SLOTS: | |||
---|---|---|---|---|---|
50 | 50 | | |||
51 | /** | 51 | /** | ||
52 | * Test merged cells. In this testcase the table is modelled after a special case where we happened | 52 | * Test merged cells. In this testcase the table is modelled after a special case where we happened | ||
53 | * to end in an infinite layout-loop in the past. The loop was caused by us not being able to place | 53 | * to end in an infinite layout-loop in the past. The loop was caused by us not being able to place | ||
54 | * content in a cell and therefore we keeped on to ask for new root-areas. This test should verify | 54 | * content in a cell and therefore we keeped on to ask for new root-areas. This test should verify | ||
55 | * exactly this case. | 55 | * exactly this case. | ||
56 | */ | 56 | */ | ||
57 | void testMergedCells(); | 57 | void testMergedCells(); | ||
58 | | ||||
59 | /** | 58 | /** | ||
60 | * If no column-width is defined then the available width should be distributed among | 59 | * If no column-width is defined then the available width should be distributed among | ||
61 | * the available columns. Since the provided rootArea's have a width of 200 and we | 60 | * the available columns. Since the provided rootArea's have a width of 200 and we | ||
62 | * have 3 columns it is expected that every of the columns has a width of 200/3. | 61 | * have 3 columns it is expected that every of the columns has a width of 200/3. | ||
63 | */ | 62 | */ | ||
64 | void testColumnWidthUndefined(); | 63 | void testColumnWidthUndefined(); | ||
65 | 64 | | |||
66 | /** | 65 | /** | ||
Show All 26 Lines | 88 | /** | |||
93 | */ | 92 | */ | ||
94 | void testRowHeightFixed(); | 93 | void testRowHeightFixed(); | ||
95 | 94 | | |||
96 | /** | 95 | /** | ||
97 | * Test minimum row-height. | 96 | * Test minimum row-height. | ||
98 | */ | 97 | */ | ||
99 | void testRowHeightMinimum(); | 98 | void testRowHeightMinimum(); | ||
100 | 99 | | |||
100 | void testOneTableNeedsTwoRootAreas(); | ||||
101 | void testTwoTablesNeedsTwoRootAreas(); | ||||
102 | void testMergedRowsSpansAreas(); | ||||
103 | void testMergedRowsSpansAreas2(); | ||||
104 | void testTwoTablesMergedRowsSpansAreas(); | ||||
105 | void testTwoTablesMergedRowsSpansThreeAreas(); | ||||
106 | | ||||
101 | private: | 107 | private: | ||
102 | QTextCursor setupTest(); | 108 | QTextCursor setupTest(); | ||
103 | void setupTest(const QString &mergedText, const QString &topRightText, const QString &midRightText, const QString &bottomLeftText, const QString &bottomMidText, const QString &bottomRightText, KoTableStyle* tableStyle = 0); | 109 | void setupTest(const QString &mergedText, const QString &topRightText, const QString &midRightText, const QString &bottomLeftText, const QString &bottomMidText, const QString &bottomRightText, KoTableStyle* tableStyle = 0); | ||
110 | QTextTable *addTable(QTextCursor cursor, int rows, int columns, KoTableStyle* tableStyle = 0); | ||||
104 | 111 | | |||
105 | private: | 112 | private: | ||
106 | QTextDocument *m_doc; | 113 | QTextDocument *m_doc; | ||
107 | KoTextDocumentLayout *m_layout; | 114 | KoTextDocumentLayout *m_layout; | ||
108 | QTextBlock m_block; | 115 | QTextBlock m_block; | ||
109 | QTextBlock mergedCellBlock() const; | 116 | QTextBlock mergedCellBlock() const; | ||
110 | QTextBlock topRightCellBlock() const; | 117 | QTextBlock topRightCellBlock() const; | ||
111 | QTextBlock midRightCellBlock() const; | 118 | QTextBlock midRightCellBlock() const; | ||
Show All 9 Lines |