tdf#152717: ScDdeLink::DataChanged may get OUString directly

... after commit 94df17f58fe6269452b7252b712a89978c444bec
(tdf#151429: don't convert OUStrings to system encoding, 2022-10-08)

Change-Id: Ie9d6eb2a4465a576eefe0840a30636e898fa9028
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144810
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 37723413115baafdc7d13ad26d11aa5f917c2036)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144812
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index 95591dd..775c718 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -130,7 +130,8 @@ sfx2::SvBaseLink::UpdateResult ScDdeLink::DataChanged(
        return SUCCESS;

    OUString aLinkStr;
    ScByteSequenceToString::GetString( aLinkStr, rValue, osl_getThreadTextEncoding() );
    if (!(rValue >>= aLinkStr))
        ScByteSequenceToString::GetString( aLinkStr, rValue, osl_getThreadTextEncoding() );
    aLinkStr = convertLineEnd(aLinkStr, LINEEND_LF);

    //  if string ends with line end, discard: