summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-05-18 16:59:09 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-05-19 09:16:35 +0200
commit8a01fc2f505acc6ed9af5ba18049131225baad30 (patch)
treef8b29fdc371d561d1078fcb1ee3f7befae7ba049 /sw/qa
parentba9b44270b56dfc6c416a55686d855a5b3c3c866 (diff)
tdf#107931 ww8import: kern marker MAY indicate disabled kerning.
The simple presence of a FontKern SPRM was assumed to mean that kerning was enabled instead of reading the value passed by the parameter. However, if the style's default is to enable kerning, then SPRMs must indicate zero in order to disable it in non-default formatting. This commit will be food for reporting false regressions. Just because text no longer fits in the space that it used to doesn’t make this a regression. Don’t blame this commit UNLESS the character or style’s “Position” “Pair Kerning” setting is incorrect. In MSWord this is a “Font” “Advanced” Kerning setting. This kern bug will have hidden lots of other spacing related problems that are unrelated to this commit. Related to tdf#105454 which did something similar for .docx. Change-Id: Ie27b5a342ffc1431e1c5ee0a7b057fdb11e4e4e3 Reviewed-on: https://gerrit.libreoffice.org/37781 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ww8export/data/testTdf107931_KERN_DocEnabled_disabledDefStyle.docbin0 -> 10240 bytes
-rw-r--r--sw/qa/extras/ww8export/data/testTdf107931_KERN_enabledDefStyle.docbin0 -> 22528 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx28
3 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/testTdf107931_KERN_DocEnabled_disabledDefStyle.doc b/sw/qa/extras/ww8export/data/testTdf107931_KERN_DocEnabled_disabledDefStyle.doc
new file mode 100644
index 000000000000..101b02a0b679
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/testTdf107931_KERN_DocEnabled_disabledDefStyle.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/testTdf107931_KERN_enabledDefStyle.doc b/sw/qa/extras/ww8export/data/testTdf107931_KERN_enabledDefStyle.doc
new file mode 100644
index 000000000000..35f6371fbc54
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/testTdf107931_KERN_enabledDefStyle.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index bb70ccff0be0..98116014f8d4 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -47,6 +47,34 @@ DECLARE_WW8EXPORT_TEST(testTdf49102_mergedCellNumbering, "tdf49102_mergedCellNum
CPPUNIT_ASSERT_EQUAL( OUString("2."), parseDump("/root/page/body/tab/row[4]/cell/txt/Special[@nType='POR_NUMBER']", "rText") );
}
+DECLARE_WW8EXPORT_TEST(testTdf107931_KERN_DocEnabled_disabledDefStyle, "testTdf107931_KERN_DocEnabled_disabledDefStyle.doc")
+{
+ // Paragraph 3: the default style has kerning disabled
+ CPPUNIT_ASSERT(!getProperty<bool>(getRun(getParagraph(3), 1), "CharAutoKerning"));
+ // Paragraph 4: style with kerning disabled
+ CPPUNIT_ASSERT(!getProperty<bool>(getRun(getParagraph(4), 1), "CharAutoKerning"));
+ // Paragraph 5: style with kerning enabled
+ CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(5), 1), "CharAutoKerning"));
+ // Paragraph 6: directly applied character properties: kerning disabled
+ CPPUNIT_ASSERT(!getProperty<bool>(getRun(getParagraph(6), 1), "CharAutoKerning"));
+ // Paragraph 7: directly applied character properties: kerning enabled
+ CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(7), 1), "CharAutoKerning"));
+}
+
+DECLARE_WW8EXPORT_TEST(testTdf107931_KERN_enabledDefStyle, "testTdf107931_KERN_enabledDefStyle.doc")
+{
+ // Paragraph 3: the default style has kerning enabled
+ CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(3), 1), "CharAutoKerning"));
+ // Paragraph 4: style with kerning disabled
+ CPPUNIT_ASSERT(!getProperty<bool>(getRun(getParagraph(4), 1), "CharAutoKerning"));
+ // Paragraph 5: style with kerning enabled
+ CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(5), 1), "CharAutoKerning"));
+ // Paragraph 6: directly applied character properties: kerning disabled
+ CPPUNIT_ASSERT(!getProperty<bool>(getRun(getParagraph(6), 1), "CharAutoKerning"));
+ // Paragraph 7: directly applied character properties: kerning enabled
+ CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(7), 1), "CharAutoKerning"));
+}
+
DECLARE_WW8EXPORT_TEST(testTdf89377, "tdf89377_tableWithBreakBeforeParaStyle.doc")
{
// the paragraph style should set table's text-flow break-before-page