summaryrefslogtreecommitdiff
path: root/desktop
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 /desktop
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 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 86932809328a..2ac74ba74a87 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -372,8 +372,7 @@ DesktopLOKTest::loadDocUrlImpl(const OUString& rFileURL, LibreOfficeKitDocumentT
std::unique_ptr<LibLODocument_Impl>
DesktopLOKTest::loadDocImpl(const char* pName, LibreOfficeKitDocumentType eType)
{
- OUString aFileURL;
- createFileURL(OUString::createFromAscii(pName), aFileURL);
+ OUString aFileURL = createFileURL(OUString::createFromAscii(pName));
return loadDocUrlImpl(aFileURL, eType);
}
@@ -758,8 +757,7 @@ void DesktopLOKTest::testPasteWriterJPEG()
{
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
- OUString aFileURL;
- createFileURL(u"paste.jpg", aFileURL);
+ OUString aFileURL = createFileURL(u"paste.jpg");
std::ifstream aImageStream(aFileURL.toUtf8().copy(strlen("file://")).getStr());
std::vector<char> aImageContents((std::istreambuf_iterator<char>(aImageStream)), std::istreambuf_iterator<char>());
@@ -2675,8 +2673,7 @@ void DesktopLOKTest::testExtractParameter()
void DesktopLOKTest::readFileIntoByteVector(std::u16string_view sFilename, std::vector<unsigned char> & rByteVector)
{
rByteVector.clear();
- OUString aURL;
- createFileURL(sFilename, aURL);
+ OUString aURL = createFileURL(sFilename);
SvFileStream aStream(aURL, StreamMode::READ);
rByteVector.resize(aStream.remainingSize());
aStream.ReadBytes(rByteVector.data(), aStream.remainingSize());
@@ -3053,8 +3050,7 @@ void DesktopLOKTest::testComplexSelection()
"", nullptr, nullptr));
// Paste an image.
- OUString aFileURL;
- createFileURL(u"paste.jpg", aFileURL);
+ OUString aFileURL = createFileURL(u"paste.jpg");
std::ifstream aImageStream(aFileURL.toUtf8().copy(strlen("file://")).getStr());
std::vector<char> aImageContents((std::istreambuf_iterator<char>(aImageStream)), std::istreambuf_iterator<char>());
CPPUNIT_ASSERT(pDocument->pClass->paste(pDocument, "image/jpeg", aImageContents.data(), aImageContents.size()));