diff options
author | László Németh <nemeth@numbertext.org> | 2020-03-18 13:56:17 +0100 |
---|---|---|
committer | Gabor Kelemen <kelemen.gabor2@nisz.hu> | 2020-09-23 19:44:56 +0200 |
commit | 8f8c71f4633bab43b2a2b3251b0c6ab69ab8b21a (patch) | |
tree | 483bfc2eaeb332e230031d01f0b26a5b0a6b06b1 | |
parent | 67f9f9f379089481c1d1ecabc0f5b59f1f736fb8 (diff) |
tdf#105215 DOCX import: fix paragraph-length direct formatting
in table cells.
Paragraph-level direct character formatting (w:p/w:pPr/w:rPr)
overwrote portion formatting (w:r/w:rPr), if the same
formatting was applied on all portions of the paragraph.
Note: with this fix, portion level direct character formatting
overwrites the paragraph-level direct formatting also in the
table row inserted below the actual row, like MSO does.
Regression from commit 2ab481b038b62b1ff576ac4d49d03c1798cd7f84
(tdf#90069 DOCX: fix character style of new table rows)
See also commit 0045b6f36e5e1445d699f87a0f6597d665b4cfe4
(tdf#130690: DOCX import: fix lost text formatting in cells)
Change-Id: Ice47b93e73aed28b09334eda2f26283c68bd0bd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90700
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit 5ac6f02fdc6015a5d78071570dee310febf95fc6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103200
Tested-by: Gabor Kelemen <kelemen.gabor2@nisz.hu>
Reviewed-by: Gabor Kelemen <kelemen.gabor2@nisz.hu>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf105215.docx | bin | 0 -> 5654 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 14 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 3 |
3 files changed, 16 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf105215.docx b/sw/qa/extras/ooxmlexport/data/tdf105215.docx Binary files differnew file mode 100644 index 000000000000..e464d460b2e1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf105215.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 6c596b7d1ca3..a10d253c287f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -1150,6 +1150,20 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf130690, "tdf130690.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:highlight", 0); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf105215, "tdf105215.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:pPr/w:rPr/w:rFonts", "ascii", "Linux Libertine G"); + + // These were "Linux Libertine G" + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/w:rPr", 5); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[1]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[2]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[3]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[4]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r[5]/w:rPr/w:rFonts", "ascii", "Lohit Devanagari"); +} + DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121597TrackedDeletionOfMultipleParagraphs, "tdf121597.odt") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 10f587bb750c..96dfd3d0bee5 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1812,7 +1812,8 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con // all text portions contain the same value, so next setPropertyValue() won't overwrite part of them xRunProperties->getPropertyState(rParaProp.Name) == css::beans::PropertyState_DIRECT_VALUE ) { - xParaProps->setPropertyValue( rParaProp.Name, rParaProp.Value ); + uno::Reference<beans::XPropertySet> xRunPropertySet(xCur, uno::UNO_QUERY); + xParaProps->setPropertyValue( rParaProp.Name, xRunPropertySet->getPropertyValue(rParaProp.Name) ); } } |