sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 4 ++++ writerfilter/source/dmapper/DomainMapper.cxx | 3 +++ 2 files changed, 7 insertions(+)
New commits: commit c071e5f6858661881065cbb4e644c37c8e94ccc6 Author: Justin Luth <justin_l...@sil.org> Date: Thu Aug 24 22:17:18 2017 -0400 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 b95d203bc17c83ec0fe5139f519d53ed1d842d3a Change-Id: Ia71490e795885d3c16f764d0f716f6499765cb67 Reviewed-on: https://gerrit.libreoffice.org/41546 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 686b4d2a506d..57b41c224b84 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -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") diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 5b52d1c5348f..41decae20717 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits