filter/source/msfilter/svdfppt.cxx | 4 ++++ sd/qa/unit/data/ppt/tdf126761.ppt |binary sd/qa/unit/export-tests.cxx | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+)
New commits: commit 2bed8af91fc2654b9ed2432f969d32d5741a529b Author: nd101 <f...@nd.com.cn> AuthorDate: Thu Aug 8 14:53:29 2019 +0800 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Wed Aug 21 11:18:23 2019 +0200 tdf#126761 add missing underline of hyperlink when showing ppt document For ppt document opened in Impress, the familiar underline property is missing. This is to fix that. Underline property is added when ppt document is being opened and saved to exported odp document. Change-Id: I8ba02da8ffa1c8e7833645f850cddef84f0fa476 Reviewed-on: https://gerrit.libreoffice.org/77141 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index c9b2e05fd6c2..a9db1f9bfec4 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -7018,6 +7018,10 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport pCurrent->mnHylinkOrigColor = pCurrent->mpImplPPTCharPropSet->mnColor; pCurrent->mbHardHylinkOrigColor = ( ( pCurrent->mpImplPPTCharPropSet->mnAttrSet >>PPT_CharAttr_FontColor ) & 1)>0; + // add missing attribute to show underline property + pCurrent->mpImplPPTCharPropSet->mnAttrSet |= 1 << PPT_CharAttr_Underline; + pCurrent->mpImplPPTCharPropSet->mnFlags = 1 << PPT_CharAttr_Underline; + if ( pCurrent->mpFieldItem ) { pCurrent->SetColor( PPT_COLSCHEME_A_UND_HYPERLINK ); diff --git a/sd/qa/unit/data/ppt/tdf126761.ppt b/sd/qa/unit/data/ppt/tdf126761.ppt new file mode 100644 index 000000000000..186799ec5b81 Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf126761.ppt differ diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index ac99607322f5..b3ad838a21ca 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -105,6 +105,7 @@ public: void testTdf119629(); void testTdf123557(); void testTdf113822(); + void testTdf126761(); CPPUNIT_TEST_SUITE(SdExportTest); @@ -135,6 +136,7 @@ public: CPPUNIT_TEST(testTdf119629); CPPUNIT_TEST(testTdf123557); CPPUNIT_TEST(testTdf113822); + CPPUNIT_TEST(testTdf126761); CPPUNIT_TEST_SUITE_END(); @@ -1184,6 +1186,27 @@ void SdExportTest::testTdf123557() xDocShRef->DoClose(); } +void SdExportTest::testTdf126761() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf126761.ppt"), PPT); + xDocShRef = saveAndReload( xDocShRef.get(), ODP ); + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); + + // Get first paragraph of the text + uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) ); + + // Get first run of the paragraph + uno::Reference<text::XTextRange> xRun( getRunFromParagraph (0, xParagraph ) ); + uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW ); + + // Check character underline, to make sure it has been set correctly + sal_uInt32 nCharUnderline; + xPropSet->getPropertyValue( "CharUnderline" ) >>= nCharUnderline; + CPPUNIT_ASSERT_EQUAL( sal_uInt32(1), nCharUnderline ); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits