diff options
author | Henry Castro <hcastro@collabora.com> | 2023-09-21 07:11:13 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2023-10-06 15:27:35 +0200 |
commit | df9f94a1b37d26b74d981dc4514255c46477c8ac (patch) | |
tree | ad98824223046af019e0acfd68e95325aebb7798 /test | |
parent | d852e411b52cda24f2d79070798a2fa662bb71f1 (diff) |
sc: qa: add loadWithParams and SaveWithParams
Add option to load and save with optional parameters.
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I2d735443da11634d072742f1bf6f38f90bced2c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157141
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157569
Tested-by: Jenkins
Diffstat (limited to 'test')
-rw-r--r-- | test/source/unoapi_test.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
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<beans::PropertyValue>& 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<beans::PropertyValue>& rParams) +{ + css::uno::Reference<frame::XStorable> xStorable(mxComponent, css::uno::UNO_QUERY_THROW); + xStorable->storeToURL(maTempFile.GetURL(), rParams); +} + void UnoApiTest::saveAndReload(const OUString& rFilter, const char* pPassword) { save(rFilter, pPassword); |