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 <jluth@mail.com>
(cherry picked from commit 71303d77febfd51a493ce797933143cc318818cf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129339
Reviewed-by: Xisco Fauli <xiscofauli@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 0000000..e75099c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 17f05d1..a32862a 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 ba3b0d9..70f36fa 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";