diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf65724.pptx | bin | 0 -> 34421 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf65724.pptx b/sd/qa/unit/data/pptx/tdf65724.pptx Binary files differnew file mode 100644 index 000000000000..fef2d9f2dde7 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf65724.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index cbe6c061d90e..bbdc8b5a19cd 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -119,6 +119,7 @@ public: virtual void setUp() override; void testDocumentLayout(); + void testInternalHyperlink(); void testHyperlinkColor(); void testSmoketest(); void testTdf131269(); @@ -236,6 +237,7 @@ public: CPPUNIT_TEST_SUITE(SdImportTest); CPPUNIT_TEST(testDocumentLayout); + CPPUNIT_TEST(testInternalHyperlink); CPPUNIT_TEST(testHyperlinkColor); CPPUNIT_TEST(testSmoketest); CPPUNIT_TEST(testTdf131269); @@ -429,6 +431,32 @@ void SdImportTest::testDocumentLayout() } } +void SdImportTest::testInternalHyperlink() +{ + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf65724.pptx"), PPTX); + + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 1, 0, xDocShRef ) ); + + // Get first paragraph + uno::Reference<text::XTextRange> const 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("The text field is missing!", xField.is() ); + + xPropSet.set(xField, uno::UNO_QUERY); + OUString aURL; + xPropSet->getPropertyValue("URL") >>= aURL; + CPPUNIT_ASSERT_EQUAL_MESSAGE("URLs don't match", OUString("#Slide2"), aURL); + + xDocShRef->DoClose(); +} + void SdImportTest::testHyperlinkColor() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf137367.pptx"), PPTX); |