[Libreoffice-commits] core.git: sw/qa writerfilter/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Thu Mar 19 09:39:04 UTC 2020
sw/qa/extras/ooxmlexport/data/tdf105215.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 14 ++++++++++++++
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 3 ++-
3 files changed, 16 insertions(+), 1 deletion(-)
New commits:
commit 5ac6f02fdc6015a5d78071570dee310febf95fc6
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Wed Mar 18 13:56:17 2020 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Thu Mar 19 10:38:31 2020 +0100
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 at numbertext.org>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf105215.docx b/sw/qa/extras/ooxmlexport/data/tdf105215.docx
new file mode 100644
index 000000000000..e464d460b2e1
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf105215.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 543e228dad45..5cdea4d7ba82 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -1171,6 +1171,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 c8095f2fa689..9e76c5259618 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1869,7 +1869,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) );
}
}
More information about the Libreoffice-commits
mailing list