diff options
author | Adam Co <rattles2013@gmail.com> | 2014-05-08 14:30:24 +0300 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-05-08 22:19:03 +0200 |
commit | 76bd128ff887b017a481f434c7ac9b1130826341 (patch) | |
tree | 2d8bf4385199fd9963f4eb557a66c2d94bc9c273 /sw/qa/extras/inc | |
parent | a4e028447e6f06e4d6660dbe95e15dca8cb5cbf2 (diff) |
Fix 'outset' and 'inset' table border type import in DOCX and RTF
In the past, LO did not support 'outset' and 'inset' border types
for tables, so when encountering them - LO converted them to other
types of border. Now that LO supports it - DOCX and RTF filters
were changed to import these border types correctly.
DOC filter was not changed, because creating a proper DOC sample
file that has these border types (needed for the 'bordertest.hxx'
file) was not possible right now. So at least DOCX and RTF filters
are fixed.
Change-Id: Ida2449d45a0ac138388f3cbfeb41657db1d4cda9
Signed-off-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/qa/extras/inc')
-rw-r--r-- | sw/qa/extras/inc/bordertest.hxx | 69 |
1 files changed, 51 insertions, 18 deletions
diff --git a/sw/qa/extras/inc/bordertest.hxx b/sw/qa/extras/inc/bordertest.hxx index 125662165dbe..07ad11ca8e7b 100644 --- a/sw/qa/extras/inc/bordertest.hxx +++ b/sw/qa/extras/inc/bordertest.hxx @@ -26,7 +26,7 @@ public: { } - void testTheBorders(uno::Reference<lang::XComponent> mxComponent) + void testTheBorders(uno::Reference<lang::XComponent> mxComponent, bool isBinaryDoc) { uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(textDocument->getText(), uno::UNO_QUERY); @@ -69,25 +69,58 @@ public: map3.insert(StringBorderPair(OUString("H1"), table::BorderLine(0, 53, 26, 159))); map3.insert(StringBorderPair(OUString("I1"), table::BorderLine(0, 53, 26, 212))); map3.insert(StringBorderPair(OUString("A1"), table::BorderLine(0, 53, 26, 9))); + + // Binary-DOC importer changes 'inset' and 'outset' border styles to other styles + // during import, so for now - leaving binary-doc results as they were. BorderLineMap map4; - map4.insert(StringBorderPair(OUString("B1"), table::BorderLine(0, 53, 26, 18))); - map4.insert(StringBorderPair(OUString("C1"), table::BorderLine(0, 53, 26, 26))); - map4.insert(StringBorderPair(OUString("D1"), table::BorderLine(0, 53, 26, 35))); - map4.insert(StringBorderPair(OUString("E1"), table::BorderLine(0, 53, 26, 35))); - map4.insert(StringBorderPair(OUString("F1"), table::BorderLine(0, 53, 26, 79))); - map4.insert(StringBorderPair(OUString("G1"), table::BorderLine(0, 53, 26, 106))); - map4.insert(StringBorderPair(OUString("H1"), table::BorderLine(0, 53, 26, 159))); - map4.insert(StringBorderPair(OUString("I1"), table::BorderLine(0, 53, 26, 212))); + if (isBinaryDoc) + { + map4.insert(StringBorderPair(OUString("B1"), table::BorderLine(0, 53, 26, 18))); + map4.insert(StringBorderPair(OUString("C1"), table::BorderLine(0, 53, 26, 26))); + map4.insert(StringBorderPair(OUString("D1"), table::BorderLine(0, 53, 26, 35))); + map4.insert(StringBorderPair(OUString("E1"), table::BorderLine(0, 53, 26, 35))); + map4.insert(StringBorderPair(OUString("F1"), table::BorderLine(0, 53, 26, 79))); + map4.insert(StringBorderPair(OUString("G1"), table::BorderLine(0, 53, 26, 106))); + map4.insert(StringBorderPair(OUString("H1"), table::BorderLine(0, 53, 26, 159))); + map4.insert(StringBorderPair(OUString("I1"), table::BorderLine(0, 53, 26, 212))); + } + else + { + map4.insert(StringBorderPair(OUString("A1"), table::BorderLine(0, 0, 26, 4))); + map4.insert(StringBorderPair(OUString("B1"), table::BorderLine(0, 5, 26, 5))); + map4.insert(StringBorderPair(OUString("C1"), table::BorderLine(0, 14, 26, 14))); + map4.insert(StringBorderPair(OUString("D1"), table::BorderLine(0, 23, 26, 23))); + map4.insert(StringBorderPair(OUString("E1"), table::BorderLine(0, 41, 26, 41))); + map4.insert(StringBorderPair(OUString("F1"), table::BorderLine(0, 67, 26, 67))); + map4.insert(StringBorderPair(OUString("G1"), table::BorderLine(0, 93, 26, 93))); + map4.insert(StringBorderPair(OUString("H1"), table::BorderLine(0, 146, 26, 146))); + map4.insert(StringBorderPair(OUString("I1"), table::BorderLine(0, 199, 26, 199))); + } BorderLineMap map5; - map5.insert(StringBorderPair(OUString("A1"), table::BorderLine(0, 26, 53, 9))); - map5.insert(StringBorderPair(OUString("B1"), table::BorderLine(0, 26, 53, 18))); - map5.insert(StringBorderPair(OUString("C1"), table::BorderLine(0, 26, 53, 26))); - map5.insert(StringBorderPair(OUString("D1"), table::BorderLine(0, 26, 53, 35))); - map5.insert(StringBorderPair(OUString("E1"), table::BorderLine(0, 26, 53, 53))); - map5.insert(StringBorderPair(OUString("F1"), table::BorderLine(0, 26, 53, 79))); - map5.insert(StringBorderPair(OUString("G1"), table::BorderLine(0, 26, 53, 106))); - map5.insert(StringBorderPair(OUString("H1"), table::BorderLine(0, 26, 53, 159))); - map5.insert(StringBorderPair(OUString("I1"), table::BorderLine(0, 26, 53, 212))); + if (isBinaryDoc) + { + map5.insert(StringBorderPair(OUString("A1"), table::BorderLine(0, 26, 53, 9))); + map5.insert(StringBorderPair(OUString("B1"), table::BorderLine(0, 26, 53, 18))); + map5.insert(StringBorderPair(OUString("C1"), table::BorderLine(0, 26, 53, 26))); + map5.insert(StringBorderPair(OUString("D1"), table::BorderLine(0, 26, 53, 35))); + map5.insert(StringBorderPair(OUString("E1"), table::BorderLine(0, 26, 53, 53))); + map5.insert(StringBorderPair(OUString("F1"), table::BorderLine(0, 26, 53, 79))); + map5.insert(StringBorderPair(OUString("G1"), table::BorderLine(0, 26, 53, 106))); + map5.insert(StringBorderPair(OUString("H1"), table::BorderLine(0, 26, 53, 159))); + map5.insert(StringBorderPair(OUString("I1"), table::BorderLine(0, 26, 53, 212))); + } + else + { + map5.insert(StringBorderPair(OUString("A1"), table::BorderLine(0, 26, 2, 4))); + map5.insert(StringBorderPair(OUString("B1"), table::BorderLine(0, 26, 5, 5))); + map5.insert(StringBorderPair(OUString("C1"), table::BorderLine(0, 26, 14, 14))); + map5.insert(StringBorderPair(OUString("D1"), table::BorderLine(0, 26, 23, 23))); + map5.insert(StringBorderPair(OUString("E1"), table::BorderLine(0, 26, 41, 41))); + map5.insert(StringBorderPair(OUString("F1"), table::BorderLine(0, 26, 67, 67))); + map5.insert(StringBorderPair(OUString("G1"), table::BorderLine(0, 26, 93, 93))); + map5.insert(StringBorderPair(OUString("H1"), table::BorderLine(0, 26, 146, 146))); + map5.insert(StringBorderPair(OUString("I1"), table::BorderLine(0, 26, 199, 199))); + } BorderLineMap map6; map6.insert(StringBorderPair(OUString("A1"), table::BorderLine(0, 14, 14, 26))); map6.insert(StringBorderPair(OUString("B1"), table::BorderLine(0, 26, 26, 53))); |