Kaydet (Commit) c071e5f6 authored tarafından Justin Luth's avatar Justin Luth

tdf#108765 DOCX: after import, allow default styles again

During import, we don't want LO's style defaults to intermingle
with those of MSO [1]. However, if any styles are NOT defined by
the document itself, then we want to use that new style with
appropriate defaults.

For example, if footnotes were never used, that style might not be
defined in the .docx file. Later, if a user inserts a footnote
for the first time, we certainly don't want the "default paragraph"
settings. Instead, we want the default "Footnote" settings.

[1]: see commit b95d203b

Change-Id: Ia71490e795885d3c16f764d0f716f6499765cb67
Reviewed-on: https://gerrit.libreoffice.org/41546Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
üst b55d8661
......@@ -359,6 +359,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104713_undefinedStyles, "tdf104713_undefinedStyl
// Normal paragraph style was not defined, so don't replace conflicting styles
uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Heading 1"), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(212), getProperty<sal_Int32>(xStyle, "ParaBottomMargin"));
// tdf108765: once importing is finished, use default values for any styles not yet defined.
xStyle.set( getStyles("ParagraphStyles")->getByName("Footnote"), uno::UNO_QUERY );
CPPUNIT_ASSERT_EQUAL_MESSAGE("Font size", 10.f, getProperty<float>(xStyle, "CharHeight"));
}
DECLARE_OOXMLEXPORT_TEST(testDrawingmlFlipv, "drawingml-flipv.docx")
......
......@@ -201,6 +201,9 @@ DomainMapper::~DomainMapper()
// Apply the document settings after everything else
m_pImpl->GetSettingsTable()->ApplyProperties( m_pImpl->GetTextDocument( ) );
// now that importing is finished, re-enable default styles for any that were never defined/imported.
m_pImpl->SetDocumentSettingsProperty("StylesNoDefault", uno::makeAny(false));
// Grab-bag handling
comphelper::SequenceAsHashMap aProperties;
// Add the saved w:themeFontLang setting
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment