summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-07-28 19:36:40 +0300
committerJustin Luth <justin_luth@sil.org>2018-07-30 08:00:40 +0200
commit3f1eaebcbb39aeff0558218f0ce77f7e91424fa2 (patch)
treebdac6d76ccab7492f5c44ea7e487e278b2028f16
parent1b21ff86effe58ae368457de8fec654ba4c8edd9 (diff)
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_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/qa/extras/ooxmlexport/data/calendar3.docxbin0 -> 9235 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx9
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx7
3 files changed, 16 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/calendar3.docx
Binary files 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();
}