From 5de40734af30a8b897c6c5b7f681759e36a25557 Mon Sep 17 00:00:00 2001 From: Rosemary Sebastian Date: Wed, 25 Jan 2017 12:56:47 +0530 Subject: Implement export and import of author field in fixed format Change-Id: I1975bfcdc8436f2b05e2fab2a4c9c09838330b30 Reviewed-on: https://gerrit.libreoffice.org/33520 Tested-by: Jenkins Reviewed-by: Rosemary Sebastian --- sd/qa/unit/data/odp/author_fixed.odp | Bin 0 -> 10680 bytes sd/qa/unit/export-tests.cxx | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 sd/qa/unit/data/odp/author_fixed.odp (limited to 'sd/qa') diff --git a/sd/qa/unit/data/odp/author_fixed.odp b/sd/qa/unit/data/odp/author_fixed.odp new file mode 100644 index 000000000000..2e666ad17fee Binary files /dev/null and b/sd/qa/unit/data/odp/author_fixed.odp differ diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 797bf36d6192..dd57ec01bf3d 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -92,6 +92,7 @@ public: void testTdf62176(); void testTransparentBackground(); void testEmbeddedPdf(); + void testAuthorField(); CPPUNIT_TEST_SUITE(SdExportTest); @@ -106,6 +107,7 @@ public: CPPUNIT_TEST(testTdf62176); CPPUNIT_TEST(testTransparentBackground); CPPUNIT_TEST(testEmbeddedPdf); + CPPUNIT_TEST(testAuthorField); CPPUNIT_TEST_SUITE_END(); @@ -552,6 +554,23 @@ void SdExportTest::testEmbeddedPdf() #endif } +void SdExportTest::testAuthorField() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/author_fixed.odp"), ODP); + + xDocShRef = saveAndReload( xDocShRef.get(), ODP ); + + uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef); + CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() ); + + uno::Reference< beans::XPropertySet > xPropSet( xField, uno::UNO_QUERY_THROW ); + bool bFixed = false; + xPropSet->getPropertyValue("IsFixed") >>= bFixed; + CPPUNIT_ASSERT_MESSAGE("Author field is not fixed", bFixed); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit