summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-08-28 10:08:02 +0200
committerAndras Timar <andras.timar@collabora.com>2014-09-15 17:07:46 +0200
commit878333bb7ee4852c3e67d2ee3f1bc812b48acf21 (patch)
tree31e298713de13409014bd2d74737bf67ed851b43 /sd
parent343c7478905f287bd1fbc8341c4d428805c890e3 (diff)
PPTX import: fix missing document metadata
Without this, the creation / modification date is lost on import. (cherry picked from commit ef2668bad976f1fbb70759887cafd35ea7833655) Signed-off-by: Andras Timar <andras.timar@collabora.com> Conflicts: sd/qa/unit/import-tests.cxx Change-Id: I0b74ac91aee7b8b3e0bc763247086a3a39816bc1
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/import-tests.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index f8b4d8e11f5f..8bb194bf126b 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -26,7 +26,9 @@
#include <svx/svdoole2.hxx>
#include <svx/xflclit.hxx>
#include <animations/animationnodehelper.hxx>
+#include <sax/tools/converter.hxx>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
@@ -62,6 +64,7 @@ public:
void testBnc870233_2();
void testBnc880763();
void testBnc862510_5();
+ void testCreationDate();
CPPUNIT_TEST_SUITE(SdFiltersTest);
CPPUNIT_TEST(testDocumentLayout);
@@ -78,6 +81,7 @@ public:
CPPUNIT_TEST(testBnc870233_2);
CPPUNIT_TEST(testBnc880763);
CPPUNIT_TEST(testBnc862510_5);
+ CPPUNIT_TEST(testCreationDate);
CPPUNIT_TEST_SUITE_END();
};
@@ -433,6 +437,18 @@ void SdFiltersTest::testBnc870237()
xDocShRef->DoClose();
}
+void SdFiltersTest::testCreationDate()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/n593612.pptx"));
+ uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(xDocShRef->GetModel(), uno::UNO_QUERY);
+ uno::Reference<document::XDocumentProperties> xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties();
+ util::DateTime aDate = xDocumentProperties->getCreationDate();
+ OUStringBuffer aBuffer;
+ sax::Converter::convertDateTime(aBuffer, aDate, 0);
+ // Metadata wasn't imported, this was 0000-00-00.
+ CPPUNIT_ASSERT_EQUAL(OUString("2008-12-10T19:12:35"), aBuffer.makeStringAndClear());
+}
+
void SdFiltersTest::testBnc870233_1()
{
::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc870233_1.pptx"));