summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2022-02-02 13:56:22 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-02-03 10:44:16 +0100
commitd5e470882c7538716a9810d757e7481304e9724e (patch)
treefe461bc038b933e7cd156a29265071e31b0f81c0
parentb8b4dd7e909a46fe1777a64124d5fa0187a1ad70 (diff)
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
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf147115_defaultStyle.docxbin0 -> 12060 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx5
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx6
3 files changed, 10 insertions, 1 deletions
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
--- /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 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";