diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index ed264e22e500..18b28627058d 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -16,13 +16,37 @@
#include
#include
+#include
+#include
+
class Test : public SwModelTestBase
{
+private:
+ FieldUnit m_eUnit;
+
public:
- Test()
- : SwModelTestBase("/sw/qa/extras/htmlexport/data/", "HTML (StarWriter)"),
+ Test() :
+ SwModelTestBase("/sw/qa/extras/htmlexport/data/", "HTML (StarWriter)"),
m_eUnit(FUNIT_NONE)
+ {}
+
+protected:
+ htmlDocPtr parseHtml()
{
+ SvFileStream aFileStream(m_aTempFile.GetURL(), STREAM_READ);
+ aFileStream.Seek(STREAM_SEEK_TO_END);
+ sal_Size nSize = aFileStream.Tell();
+ aFileStream.Seek(STREAM_SEEK_TO_BEGIN);
+ OStringBuffer aDocument(nSize);
+
+ char cCharacter;
+ for (sal_Size i = 0; iSetMetric(m_eUnit);
}
}
-
- FieldUnit m_eUnit;
};
-#define DECLARE_HTMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
+#define DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
-DECLARE_HTMLEXPORT_TEST(testFdo62336, "fdo62336.docx")
+DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo62336, "fdo62336.docx")
{
// The problem was essentially a crash during table export as docx/rtf/html
// If either of no-calc-layout or no-test-import is enabled, the crash does not occur
}
-DECLARE_HTMLEXPORT_TEST(testCharacterBorder, "charborder.odt")
+DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testCharacterBorder, "charborder.odt")
{
uno::Reference xRun(getRun(getParagraph(1),1), uno::UNO_QUERY);
@@ -90,6 +117,28 @@ DECLARE_HTMLEXPORT_TEST(testCharacterBorder, "charborder.odt")
// No shadow
}
+#define DECLARE_HTMLEXPORT_TEST(TestName, filename) DECLARE_SW_EXPORT_TEST(TestName, filename, Test)
+
+DECLARE_HTMLEXPORT_TEST(testExportOfImages, "textAndImage.docx")
+{
+ htmlDocPtr pDoc = parseHtml();
+ if (pDoc)
+ {
+ assertXPath(pDoc, "/html/body", 1);
+ assertXPath(pDoc, "/html/body/p/img", 1);
+ }
+}
+
+DECLARE_HTMLEXPORT_TEST(testExportOfImagesWithSkipImageEnabled, "textAndImage.docx")
+{
+ htmlDocPtr pDoc = parseHtml();
+ if (pDoc)
+ {
+ assertXPath(pDoc, "/html/body", 1);
+ assertXPath(pDoc, "/html/body/p/img", 0);
+ }
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();