summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-10-24 11:37:59 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-10-24 18:05:04 +0200
commit331a013ee3dffd39c1999ab56f3a18160e76f50a (patch)
tree8cf5507cb86d90408092d992b9e47da6919e1caf /test
parent60b9008d20641b4e454431c148fa8d77c98a75c8 (diff)
UnoApiTest: factor out common code
Change-Id: Ia8874d65ea8d7eb26d10b18e37ba2bac1a7d756b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141730 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'test')
-rw-r--r--test/source/sheet/xspreadsheets2.cxx5
-rw-r--r--test/source/unoapi_test.cxx11
2 files changed, 10 insertions, 6 deletions
diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx
index f88de2a43055..780e806b4deb 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -319,10 +319,7 @@ void XSpreadsheets2::testLastAfterInsertCopy()
uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const OUString& aFileBase)
{
- OUString aFileURL;
- createFileURL(aFileBase, aFileURL);
-
- uno::Reference< lang::XComponent > xComp = loadFromDesktop(aFileURL);
+ uno::Reference< lang::XComponent > xComp = loadFromDesktop(aFileBase);
uno::Reference< sheet::XSpreadsheetDocument > xDoc(xComp, UNO_QUERY_THROW);
return xDoc;
}
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index 2241db77599e..4d06c47a9697 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -47,9 +47,16 @@ void UnoApiTest::tearDown()
test::BootstrapFixture::tearDown();
}
-void UnoApiTest::createFileURL(std::u16string_view aFileBase, OUString& rFilePath)
+OUString UnoApiTest::createFileURL(std::u16string_view aFileBase)
{
- rFilePath = m_directories.getSrcRootURL() + m_aBaseString + "/" + aFileBase;
+ return m_directories.getSrcRootURL() + m_aBaseString + "/" + aFileBase;
+}
+
+OUString UnoApiTest::loadFromURL(std::u16string_view aFileBase)
+{
+ OUString aFileName = createFileURL(aFileBase);
+ mxComponent = loadFromDesktop(aFileName);
+ return aFileName;
}
uno::Any UnoApiTest::executeMacro(const OUString& rScriptURL,