diff options
author | Daniel Savi <public@gaess.ch> | 2017-10-04 18:10:48 +0200 |
---|---|---|
committer | Daniel Savi <public@gaess.ch> | 2018-04-11 18:44:31 +0000 |
commit | 6a4b6971f478400d22be7d9e2299862ba453ffc1 (patch) | |
tree | ac1c16842a7fc8f9002d58ad356bd22be6cd2105 /tests/auto/gui/text/qtextodfwriter | |
parent | f8e551cf088bff08de95132ed40d5850f8547fef (diff) |
Add more formatting to QTextDocumentWriter when writing ODF files
QTextDocumentWriter only supports a small subset of table formatting
when exporting to ODF-format. This patch adds more formatting
capabilities to the ODF exporter:
- table border support
- table alignment
- table width
- respect column constraints (column widths)
- add a tab before soft line breaks. This will avoid causing the last
line to stretch all over the cell in justified paragraphs.
With this patch, line height settings are now exported, too.
[ChangeLog][QtGui][QDocumentWriter] QDocumentWriter now supports table
borders, table alignment, table width, column widths, line height and
image resolution when exporting QTextDocuments to ODF files.
Task-number: QTBUG-63581
Change-Id: I2d269ef0f842e73af64d48bfef531d5fa3078088
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/gui/text/qtextodfwriter')
-rw-r--r-- | tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp index fb92b5a20f..bbb90ec82a 100644 --- a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp +++ b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp @@ -131,7 +131,7 @@ void tst_QTextOdfWriter::testWriteParagraph_data() QTest::newRow("misc2") << "\t \tFoo" << "<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>"; QTest::newRow("linefeed") << (QStringLiteral("line1") + QChar(0x2028) + QStringLiteral("line2")) << - "<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">line1<text:line-break/>line2</text:span></text:p>"; + "<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">line1<text:tab/><text:line-break/>line2</text:span></text:p>"; QTest::newRow("spaces") << "The quick brown fox jumped over the lazy dog" << "<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>"; } @@ -378,7 +378,7 @@ void tst_QTextOdfWriter::testWriteTable() odfWriter->writeFrame(*xmlWriter, document->rootFrame()); QString xml = QString::fromLatin1( "<text:p text:style-name=\"p1\"/>" - "<table:table>" + "<table:table table:style-name=\"Table2\">" "<table:table-column table:number-columns-repeated=\"3\"/>" "<table:table-row>" "<table:table-cell table:style-name=\"T3\">" |