diff options
author | Rosemary Sebastian <rosemaryseb8@gmail.com> | 2016-01-29 19:15:08 +0530 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-02-02 09:10:43 +0000 |
commit | 04eba5f599b8ac2accfc1d6abc74a91c38616691 (patch) | |
tree | 395e782ae9db48cd14c304011e294b75d8fc0dd8 /sd/qa | |
parent | 90dfa7cbcaf32aab6005b94b393c7c409ff1af8f (diff) |
Export and import of file name field
Change-Id: Ic2c8ce0ff2a54079ef81f6ce2770497a9d22c7b6
Reviewed-on: https://gerrit.libreoffice.org/21902
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/odp/extfile_field.odp | bin | 0 -> 10918 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 46 |
2 files changed, 46 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/extfile_field.odp b/sd/qa/unit/data/odp/extfile_field.odp Binary files differnew file mode 100644 index 000000000000..e5425beade3f --- /dev/null +++ b/sd/qa/unit/data/odp/extfile_field.odp diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 17ecbd2f91f0..18919f24cdc6 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -139,6 +139,7 @@ public: void testExportTransitionsPPTX(); void testDatetimeFieldNumberFormat(); void testDatetimeFieldNumberFormatPPTX(); + void testExtFileField(); void testFdo90607(); void testTdf91378(); @@ -192,6 +193,7 @@ public: CPPUNIT_TEST(testTdf92527); CPPUNIT_TEST(testDatetimeFieldNumberFormat); CPPUNIT_TEST(testDatetimeFieldNumberFormatPPTX); + CPPUNIT_TEST(testExtFileField); CPPUNIT_TEST_SUITE_END(); @@ -1589,6 +1591,50 @@ void SdExportTest::testDatetimeFieldNumberFormatPPTX() xDocShRef->DoClose(); } +void SdExportTest::testExtFileField() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/extfile_field.odp"), ODP); + + xDocShRef = saveAndReload( xDocShRef, PPTX ); + + for(sal_uInt16 i = 0; i <= 3; ++i) + { + // get TextShape i + 1 from the first page + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( i, 0, xDocShRef ) ); + + // Get first paragraph + uno::Reference<text::XTextRange> xParagraph( getParagraphFromShape( 0, xShape ) ); + + // first chunk of text + uno::Reference<text::XTextRange> xRun( getRunFromParagraph( 0, xParagraph ) ); + uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW ); + + uno::Reference<text::XTextField> xField; + xPropSet->getPropertyValue("TextField") >>= xField; + CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() ); + + xPropSet.set(xField, uno::UNO_QUERY); + sal_Int32 nNumFmt; + xPropSet->getPropertyValue("FileFormat") >>= nNumFmt; + switch( i ) + { + case 0: // Path/File name + CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(0), nNumFmt); + break; + case 1: // Path + CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(1), nNumFmt); + break; + case 2: // File name without extension + CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(2), nNumFmt); + break; + case 3: // File name with extension + CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(3), nNumFmt); + } + } + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |