summaryrefslogtreecommitdiff
path: root/desktop/source/app/sofficemain.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/app/sofficemain.cxx')
-rw-r--r--desktop/source/app/sofficemain.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 719446e03a81..70d396d232b6 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -45,7 +45,6 @@
#include <unotools/mediadescriptor.hxx>
#if HAVE_FEATURE_BREAKPAD
-#include <fstream>
#include <desktop/crashreport.hxx>
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
@@ -81,11 +80,9 @@
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* /*context*/, bool succeeded)
{
- std::string ini_path = CrashReporter::getIniFileName();
- std::ofstream minidump_file(ini_path, std::ios_base::app);
- minidump_file << "DumpFile=" << descriptor.path() << "\n";
- minidump_file.close();
+ CrashReporter::addKeyValue("DumpFile", OStringToOUString(descriptor.path(), RTL_TEXTENCODING_UTF8), CrashReporter::Write);
SAL_WARN("desktop", "minidump generated: " << descriptor.path());
+
return succeeded;
}
#elif defined WNT
@@ -94,17 +91,14 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id,
MDRawAssertionInfo* /*assertion*/,
bool succeeded)
{
- std::string ini_path = CrashReporter::getIniFileName();
- std::ofstream minidump_file(ini_path, std::ios_base::app);
// 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";
- minidump_file << "DumpFile=" << aPath << "\n";
- minidump_file << "GDIHandles=" << ::GetGuiResources (::GetCurrentProcess(), GR_GDIOBJECTS) << "\n";
- minidump_file.close();
+ CrashReporter::addKeyValue("DumpFile", OStringToOUString(aPath.c_str(), RTL_TEXTENCODING_UTF8), CrashReporter::AddItem);
+ CrashReporter::addKeyValue("GDIHandles", OUString::number(::GetGuiResources (::GetCurrentProcess(), GR_GDIOBJECTS)), CrashReporter::Write);
SAL_WARN("desktop", "minidump generated: " << aPath);
return succeeded;
}