diff --git a/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl b/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl
index 2d6cd7285037..60b47be753ca 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl
@@ -196,7 +196,10 @@
-
+
+
+
+
diff --git a/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl b/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
index 7a04bee074a8..0f36b36486de 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
@@ -93,7 +93,10 @@
-
+
+
+
+
@@ -317,7 +320,10 @@ Scenarios unmatched:
-
+
+
+
+
@@ -341,7 +347,10 @@ Scenarios unmatched:
-
+
+
+
+
@@ -358,7 +367,10 @@ Scenarios unmatched:
-
+
+
+
+
@@ -382,7 +394,10 @@ Scenarios unmatched:
-
+
+
+
+
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 9706c1df0615..7b3c7e4d3b17 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -19,7 +19,7 @@
-
+
@@ -1207,7 +1207,10 @@
NOTE: Should be handled as CSS style in style header -->
-
+
+
+
+
@@ -2847,29 +2850,329 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ chart
+
+
+
+ page
+
+
+
+ graphic
+
+
+
+ paragraph
+
+
+
+ presentation
+
+
+
+ ruby
+
+
+
+ section
+
+
+
+ table
+
+
+
+ cell
+
+
+
+ col
+
+
+
+ row
+
+
+
+ text
+
+
+ WARNING: No style family found for
+ unknown-family
+
+
+
+
+
+
+
+
+
+
+
+
+
+ chart
+
+
+
+ drawing-page
+
+
+
+ graphic
+
+
+
+ paragraph
+
+
+
+ presentation
+
+
+
+ ruby
+
+
+
+ section
+
+
+
+ table
+
+
+
+ table-cell
+
+
+
+ table-column
+
+
+
+ table-row
+
+
+
+ text
+
+
+ WARNING: No style family found for parent element
+ unknown-family-parent
+
+
+
+
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
index 8ee38796ebdf..bdd2d05b0925 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
@@ -129,7 +129,12 @@
- . { }
+ .
+
+
+
+
+ { }
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl
index 8448665d20b3..0788b2bf52a9 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl
@@ -206,8 +206,10 @@
-
+
+
+
+
-
diff --git a/sc/CppunitTest_sc_html_export_test.mk b/sc/CppunitTest_sc_html_export_test.mk
index f9da77710a29..bc64eb5b7803 100644
--- a/sc/CppunitTest_sc_html_export_test.mk
+++ b/sc/CppunitTest_sc_html_export_test.mk
@@ -67,6 +67,11 @@ $(eval $(call gb_CppunitTest_use_api,sc_html_export_test,\
oovbaapi \
))
+$(eval $(call gb_CppunitTest_use_packages,sc_html_export_test, \
+ filter_xhtml \
+ filter_xslt \
+))
+
$(eval $(call gb_CppunitTest_use_ure,sc_html_export_test))
$(eval $(call gb_CppunitTest_use_vcl,sc_html_export_test))
diff --git a/sc/qa/extras/htmlexporttest.cxx b/sc/qa/extras/htmlexporttest.cxx
index f65e027ae62e..6e28d791fbb3 100644
--- a/sc/qa/extras/htmlexporttest.cxx
+++ b/sc/qa/extras/htmlexporttest.cxx
@@ -50,8 +50,26 @@ public:
assertXPath(pDoc, "/html/body/table/tr/td/img", 0);
}
+ void testTdf155244()
+ {
+ loadFromURL(u"default-styles.ods");
+ save("XHTML Calc File");
+
+ xmlDocUniquePtr pXmlDoc = parseXml(maTempFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPath(pXmlDoc, "/xhtml:html", 1);
+ // the problem was that there were 2 CSS styles named "Default"
+ assertXPath(pXmlDoc, "/xhtml:html/xhtml:body/xhtml:table/xhtml:tr/xhtml:td", "class", "cell-Default");
+ OUString const styles = getXPathContent(pXmlDoc, "/xhtml:html/xhtml:head/xhtml:style");
+ CPPUNIT_ASSERT(styles.indexOf(".graphic-Default{ background-color:#729fcf;") != -1);
+ CPPUNIT_ASSERT(styles.indexOf(".cell-Default{ font-size:10pt; font-family:'Liberation Sans'; }") != -1);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), styles.indexOf(".Default"));
+ }
+
CPPUNIT_TEST_SUITE(ScHTMLExportTest);
CPPUNIT_TEST(testHtmlSkipImage);
+ CPPUNIT_TEST(testTdf155244);
CPPUNIT_TEST_SUITE_END();
};
diff --git a/sc/qa/extras/testdocuments/default-styles.ods b/sc/qa/extras/testdocuments/default-styles.ods
new file mode 100644
index 000000000000..d2167ed2023b
Binary files /dev/null and b/sc/qa/extras/testdocuments/default-styles.ods differ
diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx b/sw/qa/extras/htmlexport/xhtmlexport.cxx
index 923c3fecda8a..299b5ff6b5c8 100644
--- a/sw/qa/extras/htmlexport/xhtmlexport.cxx
+++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx
@@ -49,7 +49,7 @@ DECLARE_HTMLEXPORT_TEST(testTdf131812, "tdf131812.odt")
sal_uInt64 nLength = pStream->TellEnd();
OString aStream(read_uInt8s_ToOString(*pStream, nLength));
CPPUNIT_ASSERT(
- aStream.indexOf(".P1 { font-size:12pt; font-family:\'Liberation Serif\'; "
+ aStream.indexOf(".paragraph-P1{ font-size:12pt; font-family:\'Liberation Serif\'; "
"writing-mode:horizontal-tb; direction:rtl; text-align:right ! important;}")
!= -1);
}
@@ -138,18 +138,20 @@ DECLARE_HTMLEXPORT_TEST(testTdf107696, "tdf107696.odt")
CPPUNIT_ASSERT(aStream.indexOf("span.heading_numbering { margin-right: 0.8rem; }* { margin:0;}")
!= -1);
CPPUNIT_ASSERT(
- aStream.indexOf("Level 2 without number
")
!= -1);
CPPUNIT_ASSERT(
- aStream.indexOf("3.1Level 2, number 3.1
")
+ aStream.indexOf(
+ "3.1Level 2, number 3.1
")
!= -1);
CPPUNIT_ASSERT(
- aStream.indexOf("3.2Level 2, number 3.2
")
+ aStream.indexOf(
+ "3.2Level 2, number 3.2
")
!= -1);
}
@@ -160,8 +162,9 @@ DECLARE_HTMLEXPORT_TEST(testTdf66305, "tdf66305.odt")
sal_uInt64 nLength = pStream->TellEnd();
OString aStream(read_uInt8s_ToOString(*pStream, nLength));
CPPUNIT_ASSERT(
- aStream.indexOf("Introduction
")
+ aStream.indexOf("Introduction
")
!= -1);
}