diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-06-05 23:47:13 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-06-06 15:17:15 +0200 |
commit | 5471a5585cba925bb0dcb2dc41e03ad563998166 (patch) | |
tree | 88a2c88ead2b82a00a62caa238d5733054c25e53 /sw/qa/extras/ooxmlimport | |
parent | 581f748e1e8056f08eb803638a4ffb118a57e911 (diff) |
tdf#108350: Use Carlito for DOCX import by default
In OOXML (i.e. Word since 2007), the default document font is Calibri
11 pt. If a document doesn't contain font information, we should assume
our metric-compatible equivalent Carlito to provide best layout match.
A unit test included.
An existing unit test (testN766487) was corrected to match the font
size that Word uses (11; was 12 which doesn't match Word's size).
Change-Id: I3040f235696282dc7a124cd83fb34a6d95a29a17
Reviewed-on: https://gerrit.libreoffice.org/38421
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tdf108350.docx | bin | 0 -> 1271 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 10 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf108350.docx b/sw/qa/extras/ooxmlimport/data/tdf108350.docx Binary files differnew file mode 100644 index 000000000000..b62b3e127838 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/tdf108350.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 15aebdab076b..60d74ea7572a 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1287,6 +1287,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf76446, "tdf76446.docx") CPPUNIT_ASSERT_EQUAL(sal_Int64(3128), nRot); } +DECLARE_OOXMLIMPORT_TEST(testTdf108350, "tdf108350.docx") +{ + // For OOXML without explicit font information, font needs to be Carlito 11 pt, + // our bundled metrically compatible substitute for Calibri. + uno::Reference<text::XTextRange> xPara(getParagraph(1)); + uno::Reference<beans::XPropertySet> xRun(getRun(xPara, 1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Carlito"), getProperty<OUString>(xRun, "CharFontName")); + CPPUNIT_ASSERT_EQUAL(double(11), getProperty<double>(xRun, "CharHeight")); +} + // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT |