diff --git a/sw/qa/extras/ooxmlexport/data/tdf136617.docx b/sw/qa/extras/ooxmlexport/data/tdf136617.docx new file mode 100644 index 000000000000..e7b35aa295cb Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf136617.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 586f36ed0c82..7bead3a2bb1f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -1874,6 +1874,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf135187) "false"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf136617) +{ + loadAndSave("tdf136617.docx"); + + // This was 2 + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:p[2]/w:pPr/w:rPr/w:sz", "val", + "16"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf121597TrackedDeletionOfMultipleParagraphs) { loadAndSave("tdf121597.odt"); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index cc9f9ada017b..2e962260c79c 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -1112,14 +1112,6 @@ void DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag OUString sPropertyName = getPropertyName(eId); - if ( bIsParaLevel && ( rParaProp.m_aParaOverrideApplied.find(sPropertyName) != rParaProp.m_aParaOverrideApplied.end() || - sPropertyName.startsWith("CharFontName") ) ) - { - // don't apply table style, if this character property was applied on paragraph level - // (or in the case of paragraph level font name settings to avoid regressions) - continue; - } - auto pCellProp = std::find_if(rCellProperties.begin(), rCellProperties.end(), [&](const beans::PropertyValue& rProp) { return rProp.Name == sPropertyName; }); // this cell applies the table style property @@ -1179,6 +1171,10 @@ void DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag uno::Reference< beans::XPropertyState > xParaProperties( xParagraph, uno::UNO_QUERY_THROW ); if ( xParaProperties->getPropertyState(sPropertyName) == css::beans::PropertyState_DEFAULT_VALUE ) { + // don't overwrite empty paragraph with table style, if it has a direct paragraph formatting + if ( bIsParaLevel && xParagraph->getString().getLength() == 0 ) + continue; + if ( eId != PROP_FILL_COLOR ) { // apply style setting when the paragraph doesn't modify it diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 191b7fec353c..dc42f0198cdf 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2462,7 +2462,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con xParaCursor->gotoStartOfParagraph(false); if (m_nTableDepth > 0) { - TableParagraph aPending{xParaCursor, xCur, pParaContext, xParaProps, std::set()}; + TableParagraph aPending{xParaCursor, xCur, pParaContext, xParaProps}; getTableManager().getCurrentParagraphs()->push_back(aPending); } diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx index 0678440810b0..701546e2fb93 100644 --- a/writerfilter/source/dmapper/PropertyMap.hxx +++ b/writerfilter/source/dmapper/PropertyMap.hxx @@ -606,7 +606,6 @@ struct TableParagraph css::uno::Reference m_rEndParagraph; PropertyMapPtr m_pPropertyMap; css::uno::Reference m_rPropertySet; - std::set m_aParaOverrideApplied; }; typedef std::shared_ptr< std::vector > TableParagraphVectorPtr;