diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-12-16 21:10:55 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-12-16 21:23:37 +0100 |
commit | 298e144f8235bb4fe48e204764ec0ba936f3b0c0 (patch) | |
tree | bc8598f9b99f5f19619f1367cc59a48735c7d6bd /sw/qa | |
parent | 1c32b8747e0a2051b9abcb1e681c3ca08c039269 (diff) |
fdo#86857: sw: fix HTML export of page style background color
SwPageDesc no longer contains RES_BACKGROUND but XATTR_FOO.
Change-Id: Ie722b0279f9d9831338f6613a4722010afd1543e
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/htmlexport/data/fdo86857.html | 29 | ||||
-rw-r--r-- | sw/qa/extras/htmlexport/htmlexport.cxx | 15 |
2 files changed, 44 insertions, 0 deletions
diff --git a/sw/qa/extras/htmlexport/data/fdo86857.html b/sw/qa/extras/htmlexport/data/fdo86857.html new file mode 100644 index 000000000000..dc1fd888666a --- /dev/null +++ b/sw/qa/extras/htmlexport/data/fdo86857.html @@ -0,0 +1,29 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"/> + <title></title> + <meta name="generator" content="LibreOfficeDev 4.3.6.0.0 (Linux)"/> + <style type="text/css"> + @page { margin: 2cm } + p { margin-bottom: 0.25cm; line-height: 120% } + td p { margin-bottom: 0cm } + a:link { so-language: zxx } + </style> +</head> +<body lang="de-DE" bgcolor="#ff0000" dir="ltr" style="background: #ff0000"> +<table width="100%" cellpadding="4" cellspacing="0"> + <col width="256*"> + <tr> + <td width="100%" valign="top" bgcolor="#66ffff" style="border: 1px solid #000000; padding: 0.1cm"> + <p><br/> + + </p> + </td> + </tr> +</table> +<p style="margin-bottom: 0cm; line-height: 100%"><br/> + +</p> +</body> +</html> diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index fd07c75ffe8d..d8c673c2e4ee 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -89,6 +89,21 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo62336, "fdo62336.docx") // If either of no-calc-layout or no-test-import is enabled, the crash does not occur } +DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo86857, "fdo86857.html") +{ + // problem was that background color on page style was not exported + uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles")); + uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("HTML"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), getProperty<sal_Int32>(xStyle, "BackColor")); + // check that table background color works, which still uses RES_BACKGROUND + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x66ffff), getProperty<sal_Int32>(xCell, "BackColor")); +} + DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testCharacterBorder, "charborder.odt") { |