From 62128cda92ee3355d43e959e96028b993a38162f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 11 Dec 2020 16:48:14 +0100 Subject: Strength-reduce some OUStringToOString("..."+...) ...to "..."+OUStringToOString(...), in preparation of making OUStringToOString take a std::u16string_view Change-Id: Ic01ca249d4d0eb58ac959ffdf96471308a3715dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107600 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- test/source/bootstrapfixture.cxx | 6 ++++-- test/source/screenshot_test.cxx | 6 +++--- test/source/sheet/xuniquecellformatrangessupplier.cxx | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'test/source') diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index d05ae03d39e9..c04729376b1e 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -224,8 +224,10 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor } } CPPUNIT_ASSERT_EQUAL_MESSAGE( - OUStringToOString("failed to execute: " + aCommand + "\n" + aContentOUString, - RTL_TEXTENCODING_UTF8).getStr(), 0, returnValue); + OString( + "failed to execute: " + OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8) + "\n" + + OUStringToOString(aContentOUString, RTL_TEXTENCODING_UTF8)).getStr(), + 0, returnValue); #else (void)rPath; (void)eFormat; diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index 3466886b597d..82b9cccbb8e6 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -83,14 +83,14 @@ void ScreenshotTest::implSaveScreenshot(const BitmapEx& rScreenshot, const OStri auto const e = osl::Directory::createPath(dirUrl); if (e != osl::FileBase::E_EXIST) { CPPUNIT_ASSERT_EQUAL_MESSAGE( - OUStringToOString( - "Failed to create " + dirUrl, RTL_TEXTENCODING_UTF8).getStr(), + OString("Failed to create " + OUStringToOString(dirUrl, RTL_TEXTENCODING_UTF8)) + .getStr(), osl::FileBase::E_None, e); } auto const pngUrl = OUString(dirUrl + "/" + aBasename + ".png"); SvFileStream aNew(pngUrl, StreamMode::WRITE | StreamMode::TRUNC); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString("Failed to open <" + pngUrl + ">: " + OUString::number(sal_uInt32(aNew.GetErrorCode())), RTL_TEXTENCODING_UTF8).getStr(), aNew.IsOpen()); + CPPUNIT_ASSERT_MESSAGE(OString("Failed to open <" + OUStringToOString(pngUrl, RTL_TEXTENCODING_UTF8) + ">: " + OString::number(sal_uInt32(aNew.GetErrorCode()))).getStr(), aNew.IsOpen()); std::cout << "saving " << pngUrl << ":\n"; vcl::PNGWriter aPNGWriter(rScreenshot); diff --git a/test/source/sheet/xuniquecellformatrangessupplier.cxx b/test/source/sheet/xuniquecellformatrangessupplier.cxx index 18d81eb2f8ee..14f4a29b8770 100644 --- a/test/source/sheet/xuniquecellformatrangessupplier.cxx +++ b/test/source/sheet/xuniquecellformatrangessupplier.cxx @@ -27,7 +27,7 @@ void XUniqueCellFormatRangesSupplier::testGetUniqueCellFormatRanges() auto count = xIndexAccess->getCount(); CPPUNIT_ASSERT_MESSAGE("No elements found", count); for (auto i = 0; igetByIndex(i)); } } -- cgit