sw/qa/extras/ooxmlexport/data/calendar3.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 9 +++++++++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 +++++++ 3 files changed, 16 insertions(+)
New commits: commit 3f1eaebcbb39aeff0558218f0ce77f7e91424fa2 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Sat Jul 28 19:36:40 2018 +0300 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Mon Jul 30 08:00:40 2018 +0200 related tdf#72560 writerfilter: also check rPrDefaults So far I've been fixated on paragraph properties, but styles (both character and paragraph) also inherit the rPrDefaults. One enhancement could be to check the styleType and skip the paragraph stuff for character styles, but that doesn't seem necessary or valuable at this point. The unit test is pre-emptive. Change-Id: I4e898f5fa573b62be4dc70512b02cdeb7b21e7c6 Reviewed-on: https://gerrit.libreoffice.org/58257 Reviewed-by: Justin Luth <justin_l...@sil.org> Tested-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/ooxmlexport/data/calendar3.docx b/sw/qa/extras/ooxmlexport/data/calendar3.docx new file mode 100644 index 000000000000..6c720aff9ce1 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/calendar3.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 954528239dd3..b83bab3e136d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -339,6 +339,15 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar2, "calendar2.docx") assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblPr/w:tblBorders/w:insideV", "themeTint", "99"); } +DECLARE_OOXMLEXPORT_TEST(testCalendar3, "calendar3.docx") +{ + // TableStyle:firstRow (for header rows 1 and 2) color and size overrides document rPrDefault + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(0x5B9BD5, getProperty<sal_Int32>(getRun(xCell,1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(16.f, getProperty<float>(getRun(xCell,1), "CharHeight")); +} + DECLARE_OOXMLEXPORT_TEST(testTcBorders, "testTcBorders.docx") { //fdo#76635 : Table borders are not getting preserved. diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 469d8d0ce1fd..3a71b395acb7 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -731,6 +731,13 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId) if ( aProperty ) return aProperty->second; } + const PropertyMapPtr& pDefaultCharProps = GetStyleSheetTable()->GetDefaultCharProps(); + if ( pDefaultCharProps ) + { + boost::optional<PropertyMap::Property> aProperty = pDefaultCharProps->getProperty(eId); + if ( aProperty ) + return aProperty->second; + } } return uno::Any(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits