From f894670c2cb654a1e21fb34f440977af74e8a560 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 25 Feb 2024 10:35:32 +0600 Subject: Avoid UTF-16->UTF-8->UTF-16 conversion Change-Id: I82e45643b3543d924fda025aa47ef2fabb7f914e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163897 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- desktop/source/app/crashreport.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'desktop/source') diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index b90a04907f69..18db12d07b38 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -68,15 +68,10 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id, MDRawAssertionInfo* /*assertion*/, bool succeeded) { - // TODO: moggi: can we avoid this conversion -#ifdef _MSC_VER -#pragma warning (disable: 4996) -#endif - std::wstring_convert> conv1; - std::string aPath = conv1.to_bytes(std::wstring(path)) + conv1.to_bytes(std::wstring(id)) + ".dmp"; + OUString aPath(OUString::Concat(o3tl::toU(path)) + o3tl::toU(id) + ".dmp"); CrashReporter::addKeyValue("Active-SfxObject",CrashReporter::getActiveSfxObjectName(),CrashReporter::AddItem); CrashReporter::addKeyValue("Last-4-Uno-Commands",CrashReporter::getLoggedUnoCommands(),CrashReporter::AddItem); - CrashReporter::addKeyValue("DumpFile", OStringToOUString(aPath, RTL_TEXTENCODING_UTF8), CrashReporter::AddItem); + CrashReporter::addKeyValue("DumpFile", aPath, CrashReporter::AddItem); CrashReporter::addKeyValue("GDIHandles", OUString::number(::GetGuiResources(::GetCurrentProcess(), GR_GDIOBJECTS)), CrashReporter::Write); SAL_WARN("desktop", "minidump generated: " << aPath); return succeeded; @@ -238,7 +233,7 @@ void CrashReporter::updateMinidumpLocation() mpExceptionHandler->set_minidump_descriptor(descriptor); #elif defined _WIN32 OUString aURL = getCrashDirectory(); - mpExceptionHandler->set_dump_path(o3tl::toW(aURL.getStr())); + mpExceptionHandler->set_dump_path(std::wstring(o3tl::toW(aURL))); #endif } -- cgit