From 4ebc17755855df3a3c1f07a8f5a829d555040d34 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Wed, 17 May 2017 18:35:53 +0200 Subject: html import: Don't create HTML: postit. Change-Id: I8deea3b60d9bb86c20539be2ad23e6b07f44e51b Reviewed-on: https://gerrit.libreoffice.org/37729 Reviewed-by: Jan Holesovsky Tested-by: Jenkins --- sw/qa/extras/htmlimport/data/meta-changedby.html | 21 ++++++++++++++++++++ sw/qa/extras/htmlimport/htmlimport.cxx | 25 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 sw/qa/extras/htmlimport/data/meta-changedby.html (limited to 'sw') diff --git a/sw/qa/extras/htmlimport/data/meta-changedby.html b/sw/qa/extras/htmlimport/data/meta-changedby.html new file mode 100644 index 000000000000..b228b31073f7 --- /dev/null +++ b/sw/qa/extras/htmlimport/data/meta-changedby.html @@ -0,0 +1,21 @@ + + + + + + + + + + + + +

+Test +

+ + diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index 1e73ac89fc2b..ebc665fcdd55 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -196,6 +196,31 @@ DECLARE_HTMLIMPORT_TEST(testMetaIsoDates, "meta-ISO8601-dates.html") CPPUNIT_ASSERT_EQUAL(DateTime(Date(8, 5, 2017), tools::Time(12, 47, 0, 386000000)), aModified); } +DECLARE_HTMLIMPORT_TEST(testChangedby, "meta-changedby.html") +{ + SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDocShell* pDocShell(pTextDoc->GetDocShell()); + uno::Reference xDocProps; + + CPPUNIT_ASSERT(pDocShell); + uno::Reference xDPS(pDocShell->GetModel(), uno::UNO_QUERY); + xDocProps.set(xDPS->getDocumentProperties()); + + // get the document properties + CPPUNIT_ASSERT(xDocProps.is()); + + // the doc's property ModifiedBy is set correctly, ... + CPPUNIT_ASSERT_EQUAL(OUString("Blah"), xDocProps->getModifiedBy()); + + uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference xFields(xFieldsAccess->createEnumeration()); + + // ...but there is no comment 'HTML: ' + CPPUNIT_ASSERT(!xFields->hasMoreElements()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit