sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 5 +++++ writerfilter/source/dmapper/StyleSheetTable.cxx | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-)
New commits: commit 71303d77febfd51a493ce797933143cc318818cf Author: Justin Luth <[email protected]> AuthorDate: Wed Feb 2 13:56:22 2022 +0200 Commit: Justin Luth <[email protected]> CommitDate: Thu Feb 3 07:20:26 2022 +0100 tdf#147115 writerfilter: style is only default if default=true This was a dumb mistake in LO 2018 (so perhaps LO 6.2). Regression from commit 6b7f12f6108f136d60bd77e3787ef6a2632038cd Change-Id: I2adc642ffe9c2af1037fcc0a5d2b83c993511258 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129386 Tested-by: Jenkins Reviewed-by: Justin Luth <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx new file mode 100644 index 000000000000..e75099c6aa9e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 6c465f4ead00..6e5de25b3169 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -359,6 +359,11 @@ DECLARE_OOXMLEXPORT_TEST(testDefaultStyle, "defaultStyle.docx") CPPUNIT_ASSERT_EQUAL(2, getPages()); } +DECLARE_OOXMLEXPORT_TEST(testTdf147115_defaultStyle, "tdf147115_defaultStyle.docx") +{ + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Default Style", OUString("Standard"), getProperty<OUString>(getParagraph(1), "ParaStyleName") ); +} + DECLARE_OOXMLEXPORT_TEST(testTdf117988, "tdf117988.docx") { CPPUNIT_ASSERT_EQUAL(1, getPages()); diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 5f45672fe915..fe5d718827f0 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -464,8 +464,12 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val) if (m_pImpl->m_pCurrentEntry->nStyleTypeCode != STYLE_TYPE_UNKNOWN) { // "If this attribute is specified by multiple styles, then the last instance shall be used." - if ( m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_PARA && !m_pImpl->m_pCurrentEntry->sStyleIdentifierD.isEmpty() ) + if (m_pImpl->m_pCurrentEntry->bIsDefaultStyle + && m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_PARA + && !m_pImpl->m_pCurrentEntry->sStyleIdentifierD.isEmpty()) + { m_pImpl->m_sDefaultParaStyleName = m_pImpl->m_pCurrentEntry->sStyleIdentifierD; + } beans::PropertyValue aValue; aValue.Name = "default";
