[Libreoffice-commits] core.git: shell/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 24 18:54:18 UTC 2021


 shell/source/sessioninstall/SyncDbusSessionHelper.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit a93c3f2eb07fc15d1ebb0fd70ab58ecea27bd4f1
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Sep 24 16:54:48 2021 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Sep 24 20:53:42 2021 +0200

    GError::message is UTF-8
    
    This caused CppunitTest_sw_dialogs_test to fail for LO_TEST_LOCALE=or hitting
    
    > sal/rtl/ustring.cxx:530: void rtl_uString_newFromAscii(rtl_uString**, const char*): Assertion `static_cast<unsigned char>(*pCharStr) < 0x80' failed.
    
    at
    
    > #4  0x00007fd18a844f74 in rtl_uString_newFromAscii(rtl_uString**, char const*) (ppThis=0x7ffcb73e6e90, pCharStr=0x6191180 "ସମୟ ସୀମା ପହଞ୍ଚିଯାଇଛି") at sal/rtl/ustring.cxx:530
    > #5  0x00007fd1525af9c1 in rtl::OUString::createFromAscii(char const*) (value=0x6191180 "ସମୟ ସୀମା ପହଞ୍ଚିଯାଇଛି") at include/rtl/ustring.hxx:3328
    > #6  0x00007fd1525ad026 in (anonymous namespace)::GErrorWrapper::~GErrorWrapper() (this=0x7ffcb73e6f38, __in_chrg=<optimized out>) at shell/source/sessioninstall/SyncDbusSessionHelper.cxx:35
    > #7  0x00007fd1525ad6a5 in (anonymous namespace)::request(char const*, com::sun::star::uno::Sequence<rtl::OUString> const&, std::u16string_view) (method=0x7fd1525b481d "InstallFontconfigResources", resources=uno::Sequence of length 1 = {...}, interaction=u"hide-finished") at shell/source/sessioninstall/SyncDbusSessionHelper.cxx:91
    > #8  0x00007fd1525ada9d in shell::sessioninstall::SyncDbusSessionHelper::InstallFontconfigResources(com::sun::star::uno::Sequence<rtl::OUString> const&, rtl::OUString const&) (this=0x5d22380, resources=uno::Sequence of length 1 = {...}, interaction="hide-finished") at shell/source/sessioninstall/SyncDbusSessionHelper.cxx:158
    > #9  0x00007fd178670daa in psp::PrintFontManager::autoInstallFontLangSupport(Timer*) (this=0x2e3ed90) at vcl/unx/generic/fontmanager/fontconfig.cxx:962
    > #10 0x00007fd178670cd9 in psp::PrintFontManager::LinkStubautoInstallFontLangSupport(void*, Timer*) (instance=0x2e3ed90, data=0x2e3efa0) at vcl/unx/generic/fontmanager/fontconfig.cxx:956
    > #11 0x00007fd178341e03 in Link<Timer*, void>::Call(Timer*) const (this=0x2e3efc0, data=0x2e3efa0) at include/tools/link.hxx:111
    [...]
    
    (But probably better to use the lenient OUString-from-rtl_TextEncoding ctor
    rather than OUString::fromUtf8, in case GError::message happens to not contain
    proper UTF-8 after all, which would make the latter assert.)
    
    Change-Id: I61fede4576988c5f7f35bb071ab3f2c0e7a15aa1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122599
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index df2ef3529145..606eeb8fef03 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -11,6 +11,7 @@
 
 #include <cppuhelper/supportsservice.hxx>
 #include <gio/gio.h>
+#include <cstring>
 #include <memory>
 #include <string_view>
 #include <vector>
@@ -32,7 +33,8 @@ namespace
             {
                 if(!m_pError)
                     return;
-                OUString sMsg = OUString::createFromAscii(m_pError->message);
+                OUString sMsg(
+                    m_pError->message, std::strlen(m_pError->message), RTL_TEXTENCODING_UTF8);
                 g_error_free(m_pError);
                 throw RuntimeException(sMsg);
             }


More information about the Libreoffice-commits mailing list