summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/data/odp/extfile_field.odpbin0 -> 10918 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx46
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
new file mode 100644
index 000000000000..e5425beade3f
--- /dev/null
+++ b/sd/qa/unit/data/odp/extfile_field.odp
Binary files differ
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();