From b3291a3c0e64fd759184c29848d4323e1384965e Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 1 Dec 2022 13:46:49 +0100 Subject: sd: check files are loaded without any warning error Change-Id: I76b4d657ab3c5606b137ab745f789156dfb9af44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143523 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sd/qa/unit/import-tests2.cxx | 2 +- sd/qa/unit/sdmodeltestbase.hxx | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'sd') diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 46d1966a2e1a..e704f0bcd783 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -229,7 +229,7 @@ public: void SdImportTest2::testTdf152186() { - loadFromURL(u"pptx/tdf152186.pptx"); + createSdImpressDoc("pptx/tdf152186.pptx"); saveAndReload("Impress MS PowerPoint 2007 XML"); bool bHasShadow; diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 189bdda09718..08e3a8e7fbc3 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -56,6 +56,8 @@ public: uno::Reference xServiceInfo(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT( xServiceInfo->supportsService("com.sun.star.presentation.PresentationDocument")); + + CPPUNIT_ASSERT(!getSdDocShell()->GetMedium()->GetWarningError()); } void createSdDrawDoc(const char* pName = nullptr, const char* pPassword = nullptr) @@ -67,6 +69,15 @@ public: uno::Reference xServiceInfo(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.DrawingDocument")); + + CPPUNIT_ASSERT(!getSdDocShell()->GetMedium()->GetWarningError()); + } + + sd::DrawDocShell* getSdDocShell() + { + SdXImpressDocument* pImpressDocument = dynamic_cast(mxComponent.get()); + CPPUNIT_ASSERT(pImpressDocument); + return pImpressDocument->GetDocShell(); } uno::Reference getPage(int nPage) -- cgit v1.2.3