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 d5e470882c7538716a9810d757e7481304e9724e
Author:     Justin Luth <justin_l...@sil.org>
AuthorDate: Wed Feb 2 13:56:22 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Feb 3 10:44:16 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 <jl...@mail.com>
    (cherry picked from commit 71303d77febfd51a493ce797933143cc318818cf)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129339
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 8e9830755c17c3351f074b251f30f3216b481214)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129340

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 17f05d1dcd16..a32862ac7b9a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -361,6 +361,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 ba3b0d97550e..70f36fac78d4 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -467,8 +467,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";

Reply via email to