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>
diff --git a/sc/qa/extras/scddelinkobj.cxx b/sc/qa/extras/scddelinkobj.cxx
index a64104e..7072626 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 c35ecd6..569a055 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 08f66de..de163fb 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 fc90c19..9b11b2f 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 3ae2c4f..bc52fce 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 d05ae03..c047293 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 3466886..82b9ccc 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 18d81eb..14f4a29 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));
    }
}