From df9f94a1b37d26b74d981dc4514255c46477c8ac Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Thu, 21 Sep 2023 07:11:13 -0400 Subject: sc: qa: add loadWithParams and SaveWithParams Add option to load and save with optional parameters. Signed-off-by: Henry Castro Change-Id: I2d735443da11634d072742f1bf6f38f90bced2c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157141 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157569 Tested-by: Jenkins --- test/source/unoapi_test.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index 5c689bfe5354..464f374201bd 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -121,6 +121,18 @@ void UnoApiTest::load(OUString const& rURL, const char* pPassword) } } +void UnoApiTest::loadWithParams(OUString const& rURL, + const uno::Sequence& rParams) +{ + if (mxComponent.is()) + { + mxComponent->dispose(); + mxComponent.clear(); + } + + mxComponent = loadFromDesktop(rURL, OUString(), rParams); +} + OUString UnoApiTest::loadFromURL(std::u16string_view aFileBase, const char* pPassword) { OUString aFileName = createFileURL(aFileBase); @@ -203,6 +215,12 @@ void UnoApiTest::save(const OUString& rFilter, const char* pPassword) } } +void UnoApiTest::saveWithParams(const uno::Sequence& rParams) +{ + css::uno::Reference xStorable(mxComponent, css::uno::UNO_QUERY_THROW); + xStorable->storeToURL(maTempFile.GetURL(), rParams); +} + void UnoApiTest::saveAndReload(const OUString& rFilter, const char* pPassword) { save(rFilter, pPassword); -- cgit