summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-02-25 10:35:32 +0600
committerMike Kaganski <mike.kaganski@collabora.com>2024-02-25 06:48:45 +0100
commitf894670c2cb654a1e21fb34f440977af74e8a560 (patch)
tree7e5e57de885d7ce294792f544c8607bdb5e0aff8 /desktop/source
parent1cdf33d7485ec45c9ddcfcf7d1445f5b0a69dfec (diff)
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/crashreport.cxx11
1 files changed, 3 insertions, 8 deletions
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<std::codecvt_utf8<wchar_t>> 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
}