sd/qa/unit/data/ppt/tdf49561.ppt |binary sd/qa/unit/import-tests.cxx | 28 ++++++++++++++++++++++++++++ sd/source/filter/ppt/pptin.cxx | 3 ++- 3 files changed, 30 insertions(+), 1 deletion(-)
New commits: commit bd3ed061de068a03a7c75f093c9a9bd7b6f3ba57 Author: Matus Uzak <[email protected]> Date: Wed May 4 19:09:00 2016 +0200 tdf#49561: PPT import: Avoid to override formatting from StyleTextPropAtom Change-Id: Id874cb369b08eb7f8226413c6541fe6cd18eceaa Reviewed-on: https://gerrit.libreoffice.org/24662 Tested-by: Jenkins <[email protected]> Reviewed-by: Thorsten Behrens <[email protected]> diff --git a/sd/qa/unit/data/ppt/tdf49561.ppt b/sd/qa/unit/data/ppt/tdf49561.ppt new file mode 100644 index 0000000..c80bf12 Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf49561.ppt differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index e95cfec..93dca4c 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -121,6 +121,7 @@ public: void testTdf93868(); void testTdf95932(); void testTdf99030(); + void testTdf49561(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -170,6 +171,7 @@ public: CPPUNIT_TEST(testTdf93868); CPPUNIT_TEST(testTdf95932); CPPUNIT_TEST(testTdf99030); + CPPUNIT_TEST(testTdf49561); CPPUNIT_TEST_SUITE_END(); }; @@ -1378,6 +1380,32 @@ void SdImportTest::testTdf99030() xDocShRef->DoClose(); } +void SdImportTest::testTdf49561() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf49561.ppt"), PPT); + + uno::Reference< drawing::XMasterPagesSupplier > xDoc( + xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XDrawPage > xPage( + xDoc->getMasterPages()->getByIndex( 0 ), uno::UNO_QUERY_THROW ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(5), xPage->getCount() ); + + uno::Reference< beans::XPropertySet > xShape( getShape( 3, xPage ) ); + uno::Reference<text::XTextRange> xParagraph( getParagraphFromShape( 0, xShape ) ); + uno::Reference<text::XTextRange> xRun( getRunFromParagraph (0, xParagraph ) ); + uno::Reference< beans::XPropertySet > xPropSet(xRun , uno::UNO_QUERY_THROW ); + + float fCharHeight = 0; + CPPUNIT_ASSERT(xPropSet->getPropertyValue("CharHeight") >>= fCharHeight); + CPPUNIT_ASSERT_EQUAL(12.f, fCharHeight); + + OUString aCharFontName; + CPPUNIT_ASSERT(xPropSet->getPropertyValue("CharFontName") >>= aCharFontName); + CPPUNIT_ASSERT_EQUAL(OUString("Stencil"), aCharFontName); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 2d77024..8eac912 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2287,7 +2287,9 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj break; default: break; } + pText = static_cast<SdrTextObj*>(SdrPowerPointImport::ApplyTextObj( pTextObj, pText, pPageCapsule, pSheet, ppStyleSheetAry )); + if ( pPlaceHolder && pPlaceHolder->nPlaceholderId != PptPlaceholder::NONE ) { if ( eAktPageKind == PPT_MASTERPAGE ) @@ -2330,7 +2332,6 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj rItemSet.Put( pText->GetMergedItemSet() ); } } - pText->NbcSetStyleSheet( pSheet2, false ); } SfxItemSet aTempAttr( mpDoc->GetPool() ); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
