sw/qa/extras/ooxmlexport/data/tdf130494.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 13 +++++++++++++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 19 +++++++++++++++---- 3 files changed, 28 insertions(+), 4 deletions(-)
New commits: commit 5b82cff0e5b353b46c24aa3ab42dee514d296f98 Author: László Németh <nem...@numbertext.org> AuthorDate: Fri Feb 7 15:06:50 2020 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Tue May 19 09:11:35 2020 +0200 tdf#130494: DOCX import: limit paragraph-level character property expansion for the whole table paragraph based on the last character context. regression from 2ab481b038b62b1ff576ac4d49d03c1798cd7f84 (tdf#90069 DOCX: fix character style of new table rows) (cherry picked from commit abb9c7db8bcc06f907d39a7811711882161d5803) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx Change-Id: I49da23c268436488ff1537771869c38108113c12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94317 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/qa/extras/ooxmlexport/data/tdf130494.docx b/sw/qa/extras/ooxmlexport/data/tdf130494.docx new file mode 100644 index 000000000000..bc2050feaa55 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf130494.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 7af3a9ff3b06..c4bab88580ad 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -1001,6 +1001,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak4, "tdf123636_newlinePage assertXPath(pDump, "/root/page[2]/body/txt[1]/Text", 0); } +DECLARE_OOXMLEXPORT_TEST(testTdf130494, "tdf130494.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + { + return; + } + + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:highlight", "val", "yellow"); + // keep direct formatting of table cell paragraph with removed highlighting + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r/w:rPr/w:highlight", 0); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index bcfd5a152887..f2c26fae9672 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1571,14 +1571,25 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con // fix table paragraph properties if ( xParaProps && m_nTableDepth > 0 ) { - uno::Sequence< beans::PropertyValue > aValues = pParaContext->GetPropertyValues(false); + uno::Sequence< beans::PropertyValue > aParaProps = pParaContext->GetPropertyValues(false); // tdf#90069 in tables, apply paragraph level character style also on // paragraph level to support its copy during insertion of new table rows - for( const auto& rProp : aValues ) + for( const auto& rParaProp : aParaProps ) { - if ( rProp.Name.startsWith("Char") && rProp.Name != "CharStyleName" && rProp.Name != "CharInteropGrabBag" ) - xParaProps->setPropertyValue( rProp.Name, rProp.Value ); + if ( m_pLastCharacterContext.get() && rParaProp.Name.startsWith("Char") && rParaProp.Name != "CharStyleName" && rParaProp.Name != "CharInteropGrabBag" ) + { + const uno::Sequence< beans::PropertyValue > aLastCharProps = m_pLastCharacterContext->GetPropertyValues( ); + + for( const auto& rLastCharProp : aLastCharProps ) + { + if ( rLastCharProp == rParaProp ) + { + xParaProps->setPropertyValue( rParaProp.Name, rParaProp.Value ); + break; + } + } + } } // tdf#128959 table paragraphs haven't got window and orphan controls _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits