• Stephan Bergmann's avatar
    Avoid using O[U]StringConcat lvalues containing dangling refs to temporaries · 1fc79c34
    Stephan Bergmann yazdı
    ...in code accidentally using auto like
    > auto const aURL = uri->getUriReference() + "/"
    >     + INetURLObject::encode(
    >         m_sEmbeddedName, INetURLObject::PART_FPATH,
    >         INetURLObject::EncodeMechanism::All);
    > uno::Reference<uno::XInterface> xDataSource(xDatabaseContext->getByName(aURL), uno::UNO_QUERY);
    in <https://gerrit.libreoffice.org/#/c/44569/1> "Properly construct
    vnd.sun.star.pkg URL" did (causing hard to debug test failures there).
    So make functions taking O[U]StringConcat take those by rvalue reference.
    Unfortunately, that also needed adaption of various functions that just forward
    their arguments.  And some code in sc/qa/unit/ucalc_formula.cxx used
    CPPUNIT_ASSERT_EQUAL on OUStringConcat arguments in cases where that happened to
    actually compile (because the structure of the two OUStringConcats was
    identical), which needed adaption too (but which would arguably better use
    Change-Id: I8994d932aaedb2a491c7c81c167e93379d4fb6e3
    Reviewed-on: https://gerrit.libreoffice.org/44608Tested-by: 's avatarJenkins <ci@libreoffice.org>
    Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
ustrbuf.hxx 54.3 KB