author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 19 Feb 2010 23:40:16 +0200 | |
branch | RCL_3 |
changeset 4 | 3b1da2848fc7 |
parent 0 | 1918ee327afb |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the test suite of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
#include <QtTest/QtTest> |
|
42 |
#include <QTextDocument> |
|
43 |
#include <QTextCursor> |
|
44 |
#include <QTextBlock> |
|
45 |
#include <QTextList> |
|
46 |
#include <QTextTable> |
|
47 |
#include <QBuffer> |
|
48 |
#include <QDebug> |
|
49 |
||
50 |
#ifdef Q_OS_SYMBIAN |
|
51 |
#define SRCDIR "." |
|
52 |
#endif |
|
53 |
||
54 |
#include <private/qtextodfwriter_p.h> |
|
55 |
||
56 |
class tst_QTextOdfWriter : public QObject |
|
57 |
{ |
|
58 |
Q_OBJECT |
|
59 |
public slots: |
|
60 |
void init(); |
|
61 |
void cleanup(); |
|
62 |
||
63 |
private slots: |
|
64 |
void testWriteParagraph_data(); |
|
65 |
void testWriteParagraph(); |
|
66 |
void testWriteStyle1_data(); |
|
67 |
void testWriteStyle1(); |
|
68 |
void testWriteStyle2(); |
|
69 |
void testWriteList(); |
|
70 |
void testWriteList2(); |
|
71 |
void createArchive(); |
|
72 |
void testWriteAll(); |
|
73 |
void testWriteSection(); |
|
74 |
void testWriteTable(); |
|
75 |
||
76 |
private: |
|
77 |
/// closes the document and returns the part of the XML stream that the test wrote |
|
78 |
QString getContentFromXml(); |
|
79 |
||
80 |
private: |
|
81 |
QTextDocument *document; |
|
82 |
QXmlStreamWriter *xmlWriter; |
|
83 |
QTextOdfWriter *odfWriter; |
|
84 |
QBuffer *buffer; |
|
85 |
}; |
|
86 |
||
87 |
void tst_QTextOdfWriter::init() |
|
88 |
{ |
|
89 |
document = new QTextDocument(); |
|
90 |
odfWriter = new QTextOdfWriter(*document, 0); |
|
91 |
||
92 |
buffer = new QBuffer(); |
|
93 |
buffer->open(QIODevice::WriteOnly); |
|
94 |
xmlWriter = new QXmlStreamWriter(buffer); |
|
95 |
xmlWriter->writeNamespace(odfWriter->officeNS, "office"); |
|
96 |
xmlWriter->writeNamespace(odfWriter->textNS, "text"); |
|
97 |
xmlWriter->writeNamespace(odfWriter->styleNS, "style"); |
|
98 |
xmlWriter->writeNamespace(odfWriter->foNS, "fo"); |
|
99 |
xmlWriter->writeNamespace(odfWriter->tableNS, "table"); |
|
100 |
xmlWriter->writeStartDocument(); |
|
101 |
xmlWriter->writeStartElement("dummy"); |
|
102 |
} |
|
103 |
||
104 |
void tst_QTextOdfWriter::cleanup() |
|
105 |
{ |
|
106 |
delete document; |
|
107 |
delete odfWriter; |
|
108 |
delete xmlWriter; |
|
109 |
delete buffer; |
|
110 |
} |
|
111 |
||
112 |
QString tst_QTextOdfWriter::getContentFromXml() |
|
113 |
{ |
|
114 |
xmlWriter->writeEndDocument(); |
|
115 |
buffer->close(); |
|
116 |
QString stringContent = QString::fromUtf8(buffer->data()); |
|
117 |
int index = stringContent.indexOf("<dummy"); |
|
118 |
Q_ASSERT(index); |
|
119 |
index = stringContent.indexOf('>', index); |
|
120 |
stringContent = stringContent.mid(index+1, stringContent.length() - index - 10); |
|
121 |
return stringContent; |
|
122 |
} |
|
123 |
||
124 |
void tst_QTextOdfWriter::testWriteParagraph_data() |
|
125 |
{ |
|
126 |
QTest::addColumn<QString>("input"); |
|
127 |
QTest::addColumn<QString>("xml"); |
|
128 |
||
129 |
QTest::newRow("empty") << "" << |
|
130 |
"<text:p text:style-name=\"p1\"/>"; |
|
131 |
QTest::newRow("spaces") << "foobar word" << |
|
132 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">foobar <text:s text:c=\"2\"/>word</text:span></text:p>"; |
|
133 |
QTest::newRow("starting spaces") << " starting spaces" << |
|
134 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\"><text:s text:c=\"2\"/>starting spaces</text:span></text:p>"; |
|
135 |
QTest::newRow("trailing spaces") << "trailing spaces " << |
|
136 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">trailing spaces <text:s/></text:span></text:p>"; |
|
137 |
QTest::newRow("tab") << "word\ttab x" << |
|
138 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">word<text:tab/>tab x</text:span></text:p>"; |
|
139 |
QTest::newRow("tab2") << "word\t\ttab\tx" << |
|
140 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">word<text:tab/><text:tab/>tab<text:tab/>x</text:span></text:p>"; |
|
141 |
QTest::newRow("misc") << "foobar word\ttab x" << |
|
142 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">foobar <text:s text:c=\"2\"/>word<text:tab/>tab x</text:span></text:p>"; |
|
143 |
QTest::newRow("misc2") << "\t \tFoo" << |
|
144 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\"><text:tab/> <text:s text:c=\"4\"/><text:tab/>Foo</text:span></text:p>"; |
|
145 |
QTest::newRow("linefeed") << QString("line1%1line2").arg(QChar(0x2028)) << |
|
146 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">line1<text:line-break/>line2</text:span></text:p>"; |
|
147 |
QTest::newRow("spaces") << "The quick brown fox jumped over the lazy dog" << |
|
148 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">The quick brown fox jumped over the lazy dog</text:span></text:p>"; |
|
149 |
} |
|
150 |
||
151 |
void tst_QTextOdfWriter::testWriteParagraph() |
|
152 |
{ |
|
153 |
QFETCH(QString, input); |
|
154 |
QFETCH(QString, xml); |
|
155 |
||
156 |
QTextCursor cursor(document); |
|
157 |
cursor.insertText(input); |
|
158 |
||
159 |
odfWriter->writeBlock(*xmlWriter, document->begin()); |
|
160 |
QCOMPARE( getContentFromXml(), xml); |
|
161 |
} |
|
162 |
||
163 |
void tst_QTextOdfWriter::testWriteStyle1_data() |
|
164 |
{ |
|
165 |
QTest::addColumn<QString>("htmlInput"); |
|
166 |
QTest::addColumn<int>("cursorPosition"); |
|
167 |
QTest::addColumn<QString>("xml"); |
|
168 |
||
169 |
QString text1 = "Normal<b>bold</b><i>italic</i><b><i>Bold/Italic</i></b>"; |
|
170 |
QTest::newRow("normal") << text1 << 2 << |
|
171 |
"<style:style style:name=\"c4\" style:family=\"text\"><style:text-properties fo:font-family=\"Sans\"/></style:style>"; |
|
172 |
QTest::newRow("bold") << text1 << 10 << |
|
173 |
"<style:style style:name=\"c4\" style:family=\"text\"><style:text-properties fo:font-weight=\"bold\" fo:font-family=\"Sans\"/></style:style>"; |
|
174 |
QTest::newRow("italic") << text1 << 14 << |
|
175 |
"<style:style style:name=\"c4\" style:family=\"text\"><style:text-properties fo:font-style=\"italic\" fo:font-family=\"Sans\"/></style:style>"; |
|
176 |
QTest::newRow("bold+italic") << text1 << 25 << |
|
177 |
"<style:style style:name=\"c4\" style:family=\"text\"><style:text-properties fo:font-style=\"italic\" fo:font-weight=\"bold\" fo:font-family=\"Sans\"/></style:style>"; |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
178 |
QString colorText = "<span style=\"color: #00FF00; background-color: #FF0000;\"> Color Text </span>"; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
179 |
QTest::newRow("green/red") << colorText << 3 << |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
180 |
"<style:style style:name=\"c4\" style:family=\"text\"><style:text-properties fo:font-family=\"Sans\" fo:color=\"#00ff00\" fo:background-color=\"#ff0000\"/></style:style>"; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
181 |
|
0 | 182 |
} |
183 |
||
184 |
void tst_QTextOdfWriter::testWriteStyle1() |
|
185 |
{ |
|
186 |
QFETCH(QString, htmlInput); |
|
187 |
QFETCH(int, cursorPosition); |
|
188 |
QFETCH(QString, xml); |
|
189 |
document->setHtml(htmlInput); |
|
190 |
||
191 |
QTextCursor cursor(document); |
|
192 |
cursor.setPosition(cursorPosition); |
|
193 |
odfWriter->writeCharacterFormat(*xmlWriter, cursor.charFormat(), 4); |
|
194 |
QCOMPARE( getContentFromXml(), xml); |
|
195 |
} |
|
196 |
||
197 |
void tst_QTextOdfWriter::testWriteStyle2() |
|
198 |
{ |
|
199 |
QTextBlockFormat bf; // = cursor.blockFormat(); |
|
200 |
QList<QTextOption::Tab> tabs; |
|
201 |
QTextOption::Tab tab1; |
|
202 |
tab1.position = 40; |
|
203 |
tab1.type = QTextOption::RightTab; |
|
204 |
tabs << tab1; |
|
205 |
QTextOption::Tab tab2; |
|
206 |
tab2.position = 80; |
|
207 |
tab2.type = QTextOption::DelimiterTab; |
|
208 |
tab2.delimiter = 'o'; |
|
209 |
tabs << tab2; |
|
210 |
bf.setTabPositions(tabs); |
|
211 |
||
212 |
odfWriter->writeBlockFormat(*xmlWriter, bf, 1); |
|
213 |
QString xml = QString::fromLatin1( |
|
214 |
"<style:style style:name=\"p1\" style:family=\"paragraph\">" |
|
215 |
"<style:paragraph-properties>" |
|
216 |
"<style:style-tab-stops>" |
|
217 |
"<style:style-tab-stop style:position=\"30pt\" style:type=\"right\"/>" |
|
218 |
"<style:style-tab-stop style:position=\"60pt\" style:type=\"char\" style:char=\"o\"/>" |
|
219 |
"</style:style-tab-stops>" |
|
220 |
"</style:paragraph-properties>" |
|
221 |
"</style:style>"); |
|
222 |
QCOMPARE(getContentFromXml(), xml); |
|
223 |
} |
|
224 |
||
225 |
void tst_QTextOdfWriter::testWriteList() |
|
226 |
{ |
|
227 |
QTextCursor cursor(document); |
|
228 |
QTextList *list = cursor.createList(QTextListFormat::ListDisc); |
|
229 |
cursor.insertText("ListItem 1"); |
|
230 |
list->add(cursor.block()); |
|
231 |
cursor.insertBlock(); |
|
232 |
cursor.insertText("ListItem 2"); |
|
233 |
list->add(cursor.block()); |
|
234 |
||
235 |
odfWriter->writeBlock(*xmlWriter, cursor.block()); |
|
236 |
QString xml = QString::fromLatin1( |
|
237 |
"<text:list text:style-name=\"L2\">" |
|
238 |
"<text:list-item>" |
|
239 |
//"<text:numbered-paragraph text:style-name=\"L2\" text:level=\"1\">" |
|
240 |
//"<text:number>")+ QChar(0x25cf) + QString::fromLatin1("</text:number>" // 0x25cf is a bullet |
|
241 |
"<text:p text:style-name=\"p3\"><text:span text:style-name=\"c0\">ListItem 2</text:span></text:p>" |
|
242 |
"</text:list-item>" |
|
243 |
"</text:list>"); |
|
244 |
||
245 |
QCOMPARE(getContentFromXml(), xml); |
|
246 |
} |
|
247 |
||
248 |
void tst_QTextOdfWriter::testWriteList2() |
|
249 |
{ |
|
250 |
QTextCursor cursor(document); |
|
251 |
QTextList *list = cursor.createList(QTextListFormat::ListDisc); |
|
252 |
cursor.insertText("Cars"); |
|
253 |
list->add(cursor.block()); |
|
254 |
cursor.insertBlock(); |
|
255 |
QTextListFormat level2; |
|
256 |
level2.setStyle(QTextListFormat::ListSquare); |
|
257 |
level2.setIndent(2); |
|
258 |
QTextList *list2 = cursor.createList(level2); |
|
259 |
cursor.insertText("Model T"); |
|
260 |
list2->add(cursor.block()); |
|
261 |
cursor.insertBlock(); |
|
262 |
cursor.insertText("Kitt"); |
|
263 |
list2->add(cursor.block()); |
|
264 |
cursor.insertBlock(); |
|
265 |
cursor.insertText("Animals"); |
|
266 |
list->add(cursor.block()); |
|
267 |
||
268 |
cursor.insertBlock(QTextBlockFormat(), QTextCharFormat()); // start a new completely unrelated list. |
|
269 |
QTextList *list3 = cursor.createList(QTextListFormat::ListDecimal); |
|
270 |
cursor.insertText("Foo"); |
|
271 |
list3->add(cursor.block()); |
|
272 |
||
273 |
// and another block thats NOT in a list. |
|
274 |
cursor.insertBlock(QTextBlockFormat(), QTextCharFormat()); |
|
275 |
cursor.insertText("Bar"); |
|
276 |
||
277 |
odfWriter->writeFrame(*xmlWriter, document->rootFrame()); |
|
278 |
QString xml = QString::fromLatin1( |
|
279 |
"<text:list text:style-name=\"L2\">" |
|
280 |
"<text:list-item>" |
|
281 |
//"<text:numbered-paragraph text:style-name=\"L2\" text:level=\"1\">" |
|
282 |
//"<text:number>")+ QChar(0x25cf) + QString::fromLatin1("</text:number>" // 0x25cf is a bullet |
|
283 |
"<text:p text:style-name=\"p3\"><text:span text:style-name=\"c0\">Cars</text:span></text:p>" |
|
284 |
"</text:list-item>" |
|
285 |
"<text:list-item>" |
|
286 |
"<text:list text:style-name=\"L4\">" |
|
287 |
"<text:list-item>" |
|
288 |
"<text:p text:style-name=\"p5\"><text:span text:style-name=\"c0\">Model T</text:span></text:p>" |
|
289 |
"</text:list-item>" |
|
290 |
"<text:list-item>" |
|
291 |
"<text:p text:style-name=\"p5\"><text:span text:style-name=\"c0\">Kitt</text:span></text:p>" |
|
292 |
"</text:list-item>" |
|
293 |
"</text:list>" |
|
294 |
"</text:list-item>" |
|
295 |
"<text:list-item>" |
|
296 |
"<text:p text:style-name=\"p3\"><text:span text:style-name=\"c0\">Animals</text:span></text:p>" |
|
297 |
"</text:list-item>" |
|
298 |
"</text:list>" |
|
299 |
"<text:list text:style-name=\"L6\">" |
|
300 |
"<text:list-item>" |
|
301 |
"<text:p text:style-name=\"p7\"><text:span text:style-name=\"c0\">Foo</text:span></text:p>" |
|
302 |
"</text:list-item>" |
|
303 |
"</text:list>" |
|
304 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">Bar</text:span></text:p>"); |
|
305 |
||
306 |
// QString x = getContentFromXml(); |
|
307 |
// for (int i=0; i < x.length(); i+=150) qDebug() << x.mid(i, 150); |
|
308 |
QCOMPARE(getContentFromXml(), xml); |
|
309 |
} |
|
310 |
||
311 |
||
312 |
void tst_QTextOdfWriter::createArchive() |
|
313 |
{ |
|
314 |
document->setPlainText("a"); // simple doc is enough ;) |
|
315 |
QTextOdfWriter writer(*document, buffer); |
|
316 |
QCOMPARE(writer.createArchive(), true); // default |
|
317 |
writer.writeAll(); |
|
318 |
/* |
|
319 |
QFile file("createArchive-odt"); |
|
320 |
file.open(QIODevice::WriteOnly); |
|
321 |
file.write(buffer->data()); |
|
322 |
file.close(); |
|
323 |
*/ |
|
324 |
QVERIFY(buffer->data().length() > 80); |
|
325 |
QCOMPARE(buffer->data()[0], 'P'); // its a zip :) |
|
326 |
QCOMPARE(buffer->data()[1], 'K'); |
|
327 |
QString mimetype(buffer->data().mid(38, 39)); |
|
328 |
QCOMPARE(mimetype, QString::fromLatin1("application/vnd.oasis.opendocument.text")); |
|
329 |
} |
|
330 |
||
331 |
void tst_QTextOdfWriter::testWriteAll() |
|
332 |
{ |
|
333 |
document->setPlainText("a"); // simple doc is enough ;) |
|
334 |
QTextOdfWriter writer(*document, buffer); |
|
335 |
QCOMPARE(writer.createArchive(), true); |
|
336 |
writer.setCreateArchive(false); |
|
337 |
writer.writeAll(); |
|
338 |
QString result = QString(buffer->data()); |
|
339 |
// details we check elsewhere, all we have to do is check availability. |
|
340 |
QVERIFY(result.indexOf("office:automatic-styles") >= 0); |
|
341 |
QVERIFY(result.indexOf("<style:style style:name=\"p1\"") >= 0); |
|
342 |
QVERIFY(result.indexOf("<style:style style:name=\"c0\"") >= 0); |
|
343 |
QVERIFY(result.indexOf("office:body") >= 0); |
|
344 |
QVERIFY(result.indexOf("office:text") >= 0); |
|
345 |
QVERIFY(result.indexOf("style:style") >= 0); |
|
346 |
} |
|
347 |
||
348 |
void tst_QTextOdfWriter::testWriteSection() |
|
349 |
{ |
|
350 |
QTextCursor cursor(document); |
|
351 |
cursor.insertText("foo\nBar"); |
|
352 |
QTextFrameFormat ff; |
|
353 |
cursor.insertFrame(ff); |
|
354 |
cursor.insertText("baz"); |
|
355 |
||
356 |
odfWriter->writeFrame(*xmlWriter, document->rootFrame()); |
|
357 |
QString xml = QString::fromLatin1( |
|
358 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">foo</text:span></text:p>" |
|
359 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">Bar</text:span></text:p>" |
|
360 |
"<text:section>" |
|
361 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">baz</text:span></text:p>" |
|
362 |
"</text:section>" |
|
363 |
"<text:p text:style-name=\"p1\"/>"); |
|
364 |
||
365 |
QCOMPARE(getContentFromXml(), xml); |
|
366 |
} |
|
367 |
||
368 |
void tst_QTextOdfWriter::testWriteTable() |
|
369 |
{ |
|
370 |
// create table with merged cells |
|
371 |
QTextCursor cursor(document); |
|
372 |
QTextTable * table = cursor.insertTable(3, 3); |
|
373 |
table->mergeCells(1, 0, 2, 2); |
|
374 |
table->mergeCells(0, 1, 1, 2); |
|
375 |
cursor = table->cellAt(0, 0).firstCursorPosition(); |
|
376 |
cursor.insertText("a"); |
|
377 |
cursor.movePosition(QTextCursor::NextCell); |
|
378 |
cursor.insertText("b"); |
|
379 |
cursor.movePosition(QTextCursor::NextCell); |
|
380 |
cursor.insertText("c"); |
|
381 |
cursor.movePosition(QTextCursor::NextCell); |
|
382 |
cursor.insertText("d"); |
|
383 |
cursor.movePosition(QTextCursor::NextCell); |
|
384 |
cursor.insertText("e"); |
|
385 |
/* |
|
386 |
+-+---+ |
|
387 |
|a|b | |
|
388 |
+-+-+-+ |
|
389 |
|c |d| |
|
390 |
+ +-+ |
|
391 |
| |e| |
|
392 |
+-+-+-+ |
|
393 |
*/ |
|
394 |
||
395 |
odfWriter->writeFrame(*xmlWriter, document->rootFrame()); |
|
396 |
QString xml = QString::fromLatin1( |
|
397 |
"<text:p text:style-name=\"p1\"/>" |
|
398 |
"<table:table>" |
|
399 |
"<table:table-column table:number-columns-repeated=\"3\"/>" |
|
400 |
"<table:table-row>" |
|
401 |
"<table:table-cell table:style-name=\"T3\">" |
|
402 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">a</text:span></text:p>" |
|
403 |
"</table:table-cell>" |
|
404 |
"<table:table-cell table:number-columns-spanned=\"2\" table:style-name=\"T6\">" |
|
405 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c7\">b</text:span></text:p>" |
|
406 |
"</table:table-cell>" |
|
407 |
"</table:table-row>" |
|
408 |
"<table:table-row>" |
|
409 |
"<table:table-cell table:number-columns-spanned=\"2\" table:number-rows-spanned=\"2\" table:style-name=\"T5\">" |
|
410 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c8\">c</text:span></text:p>" |
|
411 |
"</table:table-cell>" |
|
412 |
"<table:table-cell table:style-name=\"T3\">" |
|
413 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">d</text:span></text:p>" |
|
414 |
"</table:table-cell>" |
|
415 |
"</table:table-row>" |
|
416 |
"<table:table-row>" |
|
417 |
"<table:table-cell table:style-name=\"T3\">" |
|
418 |
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">e</text:span></text:p>" |
|
419 |
"</table:table-cell>" |
|
420 |
"</table:table-row>" |
|
421 |
"</table:table>" |
|
422 |
"<text:p text:style-name=\"p1\"/>"); |
|
423 |
||
424 |
QCOMPARE(getContentFromXml(), xml); |
|
425 |
} |
|
426 |
||
427 |
QTEST_MAIN(tst_QTextOdfWriter) |
|
428 |
#include "tst_qtextodfwriter.moc" |