UnoApiTest: check no document is open before opening a new one

Change-Id: I8abe65f88b63446dd8bfe2465c9a8d2d4aff31ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199508
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Xisco Fauli
2026-02-17 08:34:57 +01:00
parent 238f8496f9
commit a89f887d16
+3 -9
View File
@@ -58,10 +58,7 @@ void UnoApiTest::tearDown()
}
if (mxComponent.is())
{
mxComponent->dispose();
mxComponent.clear();
}
dispose();
test::BootstrapFixture::tearDown();
}
@@ -262,11 +259,7 @@ void UnoApiTest::loadFromURL(OUString const& rURL,
if (meImportFilterName != TestFilter::NONE)
aMediaDescriptor[u"FilterName"_ustr] <<= TestFilterNames.at(meImportFilterName);
if (mxComponent.is())
{
mxComponent->dispose();
mxComponent.clear();
}
CPPUNIT_ASSERT_MESSAGE("A document is already open!", !mxComponent.is());
mxComponent = loadFromDesktop(rURL, OUString(), aMediaDescriptor.getAsConstPropertyValueList());
CPPUNIT_ASSERT(mxComponent);
@@ -359,6 +352,7 @@ void UnoApiTest::saveAndReload(TestFilter eFilter,
const char* pPassword)
{
save(eFilter, rParams, pPassword);
dispose();
loadFromURL(maTempFile.GetURL(), rParams, pPassword);
}