From 224790d82aa2b2d2fe94ba455631f101218ea16b Mon Sep 17 00:00:00 2001 From: Eliot Kimber Date: Fri, 23 Aug 2019 14:58:43 -0500 Subject: [PATCH 1/2] Additional samples to test with --- sample-data/column-widths/test.swpx | 2142 +++++++++++++++++++++++++++ 1 file changed, 2142 insertions(+) create mode 100755 sample-data/column-widths/test.swpx diff --git a/sample-data/column-widths/test.swpx b/sample-data/column-widths/test.swpx new file mode 100755 index 0000000..59e5d40 --- /dev/null +++ b/sample-data/column-widths/test.swpx @@ -0,0 +1,2142 @@ + + + + +
+

+ + + + + + + IFRS 13 +

+
+
+

+ IFRS 13 +

+
+
+

+ + + + © IFRS Foundation + + + + +

+
+
+

+ + + + + © IFRS Foundation +

+
+
+
+ +
+ +

+ Example 15—Assets measured at fair value +

+
+ +

+ IE60 + + + + For assets and liabilities measured at fair value at the end of the reporting period, the IFRS requires quantitative disclosures about the fair value measurements for each class of assets and liabilities. An entity might disclose the following for assets to comply with paragraph 93(a) and (b) of the IFRS: +

+

+ + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ (CU in millions) +

+
+

+

+

+

+

+

+

+ Fair value measurements at the end of the reporting period using +

+
+

+

+

+

+

+

+

+ Description +

+
+

+

+

+ 31/12/X9 +

+
+

+

+

+ Quoted prices in active markets for identical assets (Level 1) +

+
+

+

+

+ Significant other observable inputs (Level 2) +

+
+

+

+

+ Significant unobservable inputs (Level 3) +

+
+

+

+

+ Total gains (losses) +

+
+

+

+

+ Recurring fair value measurements + +

+
+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+ + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ (CU in millions) +

+
+

+

+

+

+

+

+

+ Fair value measurements at the end of the reporting period using +

+
+

+

+

+

+

+

+

+ Description +

+
+

+

+

+ 31/12/X9 +

+
+

+

+

+ Quoted prices in active markets for identical assets (Level 1) +

+
+

+

+

+ Significant other observable inputs (Level 2) +

+
+

+

+

+ Significant unobservable inputs (Level 3) +

+
+

+

+

+ Total gains (losses) +

+
+

+

+

+ Recurring fair value measurements + +

+
+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+ + + +

+ +
+ +
+ +
From 8e58c447d7248b30a8c8e1652db1a6e7e265d006 Mon Sep 17 00:00:00 2001 From: Eliot Kimber Date: Fri, 23 Aug 2019 15:05:14 -0500 Subject: [PATCH 2/2] Fixes #8 Bad value for paragraph alignment enum. Provides correct mapping for all @align values --- .../wordinator/xml2docx/generator/DocxGenerator.java | 7 +++++++ src/test/resources/simplewp/simplewpml-test-01.swpx | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/wordinator/xml2docx/generator/DocxGenerator.java b/src/main/java/org/wordinator/xml2docx/generator/DocxGenerator.java index 04d5e9d..2183986 100644 --- a/src/main/java/org/wordinator/xml2docx/generator/DocxGenerator.java +++ b/src/main/java/org/wordinator/xml2docx/generator/DocxGenerator.java @@ -2042,6 +2042,13 @@ private XWPFTableRow makeTableRow( XWPFParagraph p = cell.addParagraph(); makeParagraph(p, cursor); if (null != align) { + if ("JUSTIFY".equalsIgnoreCase(align)) { + align = "DISTRIBUTE"; // Slight mistmatch between markup and model + } + if ("CHAR".equalsIgnoreCase(align)) { + // I'm not sure this is the best mapping but it seemed close enough + align = "NUM_TAB"; // Slight mistmatch between markup and model + } ParagraphAlignment alignment = ParagraphAlignment.valueOf(align.toUpperCase()); p.setAlignment(alignment); } diff --git a/src/test/resources/simplewp/simplewpml-test-01.swpx b/src/test/resources/simplewp/simplewpml-test-01.swpx index 3820ce2..f2f4223 100644 --- a/src/test/resources/simplewp/simplewpml-test-01.swpx +++ b/src/test/resources/simplewp/simplewpml-test-01.swpx @@ -95,13 +95,13 @@ -

R1 C1

-

R1 C2

-

R1 C3

+

R1 C1 Left align

+

R1 C2 center align

+

R1 C3 right align

-

R2 C1

-

R2 C2

+

R2 C1 "char" align

+

R2 C2 justify align

R2 C3