summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-05-29 12:15:18 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-05-30 08:16:38 +0000
commit7259f07deaa9f9d5ce5c5b0f8f0847c673449135 (patch)
treee50d803589b46edf21076852f1f5cd9efafa0b34 /svx
parent4d4be0c0f1fd1c9bdfe815eddd0ff6b49b5bba39 (diff)
use the existing URL to path tools
Change-Id: I20aa47556205f5efc70f8f5ea39c63009110f986 Reviewed-on: https://gerrit.libreoffice.org/25646 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/crashreportdlg.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx
index a3ac1d940670..aeb5c14fb192 100644
--- a/svx/source/dialog/crashreportdlg.cxx
+++ b/svx/source/dialog/crashreportdlg.cxx
@@ -13,6 +13,7 @@
#include <rtl/bootstrap.hxx>
#include <desktop/crashreport.hxx>
+#include <osl/file.hxx>
CrashReportDialog::CrashReportDialog(vcl::Window* pParent):
Dialog(pParent, "CrashReportDialog",
@@ -40,12 +41,12 @@ void CrashReportDialog::dispose()
namespace {
-OString getLibDir()
+OUString getLibDir()
{
OUString aOriginal = "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER;
rtl::Bootstrap::expandMacros(aOriginal);
- return rtl::OUStringToOString(aOriginal, RTL_TEXTENCODING_UTF8);
+ return aOriginal;
}
}
@@ -55,12 +56,12 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void)
if (pBtn == mpBtnSend.get())
{
std::string ini_path = CrashReporter::getIniFileName();
-#if defined WNT
- OString aCommand = getLibDir().copy(8) + "/minidump_upload.exe " + ini_path.c_str();
-#else
- OString aCommand = getLibDir().copy(7) + "/minidump_upload " + ini_path.c_str();
-#endif
- int retVal = std::system(aCommand.getStr());
+ OUString aCommand;
+ osl::FileBase::getSystemPathFromFileURL(getLibDir() + "/minidump_upload" + SAL_EXEEXTENSION, aCommand);
+
+ aCommand = aCommand;
+ OString aOStringCommand = rtl::OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8) + " " + ini_path.c_str();
+ int retVal = std::system(aOStringCommand.getStr());
SAL_WARN_IF(retVal != 0, "svx.dialog", "Failed to upload minidump. Error Code: " << retVal);
// TODO: moggi: return the id for the user to look it up
Close();