Related: tdf#105454 DOCX import: fix unwanted enabled-by-default kerning

Similar to DOC, DOCX doesn't enable kerning by default.

Change-Id: I070ff5f0d43c27107593d629a1ad681d29d2038c
Reviewed-on: https://gerrit.libreoffice.org/35890
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
Miklos Vajna
2017-03-30 09:27:45 +02:00
parent a82627aa78
commit 38b0c24fa5
3 changed files with 11 additions and 0 deletions

Binary file not shown.

View File

@@ -648,6 +648,13 @@ DECLARE_OOXMLIMPORT_TEST(testN820504, "n820504.docx")
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
}
DECLARE_OOXMLIMPORT_TEST(testKern, "kern.docx")
{
CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(1), 1), "CharAutoKerning"));
// This failed: kerning was also enabled for the second paragraph.
CPPUNIT_ASSERT(!getProperty<bool>(getRun(getParagraph(2), 1), "CharAutoKerning"));
}
DECLARE_OOXMLIMPORT_TEST(testFdo43641, "fdo43641.docx")
{
uno::Reference<container::XIndexAccess> xGroupShape(getShape(1), uno::UNO_QUERY);

View File

@@ -298,6 +298,10 @@ StyleSheetTable_Impl::StyleSheetTable_Impl(DomainMapper& rDMapper,
m_pDefaultCharProps->Insert( PROP_CHAR_HEIGHT, aVal );
m_pDefaultCharProps->Insert( PROP_CHAR_HEIGHT_ASIAN, aVal );
m_pDefaultCharProps->Insert( PROP_CHAR_HEIGHT_COMPLEX, aVal );
// See SwDoc::RemoveAllFormatLanguageDependencies(), internal filters
// disable kerning by default, do the same here.
m_pDefaultCharProps->Insert(PROP_CHAR_AUTO_KERNING, uno::Any(false));
}