diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 16:48:14 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 17:33:57 +0100 |
commit | 62128cda92ee3355d43e959e96028b993a38162f (patch) | |
tree | f50169071be182abe03f4180686dab387cc46808 | |
parent | 9ef0c8b2d59105e6a9dd7d6f4ed6942bc4745ef8 (diff) |
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 <sbergman@redhat.com>
-rw-r--r-- | sc/qa/extras/scddelinkobj.cxx | 3 | ||||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 5 | ||||
-rw-r--r-- | sd/qa/unit/sdmodeltestbase.hxx | 4 | ||||
-rw-r--r-- | shell/source/sessioninstall/SyncDbusSessionHelper.cxx | 2 | ||||
-rw-r--r-- | starmath/qa/extras/mmlimport-test.cxx | 3 | ||||
-rw-r--r-- | test/source/bootstrapfixture.cxx | 6 | ||||
-rw-r--r-- | test/source/screenshot_test.cxx | 6 | ||||
-rw-r--r-- | test/source/sheet/xuniquecellformatrangessupplier.cxx | 2 |
8 files changed, 18 insertions, 13 deletions
diff --git a/sc/qa/extras/scddelinkobj.cxx b/sc/qa/extras/scddelinkobj.cxx index a64104e661f1..70726260d85b 100644 --- a/sc/qa/extras/scddelinkobj.cxx +++ b/sc/qa/extras/scddelinkobj.cxx @@ -39,7 +39,8 @@ static utl::TempFile createTempCopy(OUString const& url) tmp.EnableKillingFile(); auto const e = osl::File::copy(url, tmp.GetURL()); CPPUNIT_ASSERT_EQUAL_MESSAGE( - (OUStringToOString("<" + url + "> -> <" + tmp.GetURL() + ">", RTL_TEXTENCODING_UTF8) + (OString("<" + OUStringToOString(url, RTL_TEXTENCODING_UTF8) + "> -> <" + + OUStringToOString(tmp.GetURL(), RTL_TEXTENCODING_UTF8) + ">") .getStr()), osl::FileBase::E_None, e); return tmp; diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index c35ecd6d4563..569a0559901d 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -66,8 +66,9 @@ static void assertMotionPath(const OUString &rStr1, const OUString &rStr2, const sal_Int32 nIdx1 = 0; sal_Int32 nIdx2 = 0; - OString sMessage = OUStringToOString("Motion path values mismatch.\nExpect: " + rStr1 + - "\nActual: " + rStr2, RTL_TEXTENCODING_UTF8); + OString sMessage = "Motion path values mismatch.\nExpect: " + + OUStringToOString(rStr1, RTL_TEXTENCODING_UTF8) + + "\nActual: " + OUStringToOString(rStr2, RTL_TEXTENCODING_UTF8); while(nIdx1 != -1 && nIdx2 != -1) { diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 08f66de864f1..de163fbc38ef 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -157,7 +157,7 @@ protected: { if (xDocShRef.is()) xDocShRef->DoClose(); - CPPUNIT_ASSERT_MESSAGE( OUStringToOString( "failed to load Draw doc" + rURL, RTL_TEXTENCODING_UTF8 ).getStr(), false ); + CPPUNIT_ASSERT_MESSAGE( OString("failed to load Draw doc" + OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 )).getStr(), false ); } CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() ); return xDocShRef; @@ -182,7 +182,7 @@ protected: { if (xDocShRef.is()) xDocShRef->DoClose(); - CPPUNIT_ASSERT_MESSAGE( OUStringToOString( "failed to load " + rURL, RTL_TEXTENCODING_UTF8 ).getStr(), false ); + CPPUNIT_ASSERT_MESSAGE( OString("failed to load " + OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 )).getStr(), false ); } CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() ); return xDocShRef; diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx index fc90c19a8fca..9b11b2f6f498 100644 --- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx +++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx @@ -39,7 +39,7 @@ namespace }; GDBusProxy* lcl_GetPackageKitProxy(const OUString& sInterface) { - const OString sFullInterface = OUStringToOString("org.freedesktop.PackageKit." + sInterface, RTL_TEXTENCODING_ASCII_US); + const OString sFullInterface = "org.freedesktop.PackageKit." + OUStringToOString(sInterface, RTL_TEXTENCODING_ASCII_US); GDBusProxy* proxy = nullptr; { GErrorWrapper error; diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx index 3ae2c4f49ae8..bc52fceb3d29 100644 --- a/starmath/qa/extras/mmlimport-test.cxx +++ b/starmath/qa/extras/mmlimport-test.cxx @@ -72,7 +72,8 @@ private: pSrcMed->UseInteractionHandler(false); bool bLoaded = mxDocShell->DoLoad(pSrcMed); CPPUNIT_ASSERT_MESSAGE( - OUStringToOString("failed to load " + rURL, RTL_TEXTENCODING_UTF8).getStr(), bLoaded); + OString("failed to load " + OUStringToOString(rURL, RTL_TEXTENCODING_UTF8)).getStr(), + bLoaded); } SmDocShellRef mxDocShell; 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; i<count; i++) { - CPPUNIT_ASSERT_NO_THROW_MESSAGE(OUStringToOString("Unable to access element " + OUString::number(i), RTL_TEXTENCODING_UTF8).getStr(), + CPPUNIT_ASSERT_NO_THROW_MESSAGE(OString("Unable to access element " + OString::number(i)).getStr(), xIndexAccess->getByIndex(i)); } } |