include/sal/config.h | 4 ++++ svx/source/dialog/crashreportdlg.cxx | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-)
New commits: commit 7259f07deaa9f9d5ce5c5b0f8f0847c673449135 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun May 29 12:15:18 2016 +0200 use the existing URL to path tools Change-Id: I20aa47556205f5efc70f8f5ea39c63009110f986 Reviewed-on: https://gerrit.libreoffice.org/25646 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/include/sal/config.h b/include/sal/config.h index ea3e897..29fe63b 100644 --- a/include/sal/config.h +++ b/include/sal/config.h @@ -29,6 +29,7 @@ #ifdef _WIN32 #define SAL_W32 #define SAL_DLLEXTENSION ".dll" +#define SAL_EXEEXTENSION ".exe" #define SAL_PATHSEPARATOR ';' #define SAL_PATHDELIMITER '\\' #define SAL_NEWLINE_STRING "\r\n" @@ -56,6 +57,7 @@ defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) || defined(ANDROID) #define SAL_UNX #define SAL_DLLEXTENSION ".so" +#define SAL_EXEEXTENSION "" #define SAL_DLLPREFIX "lib" #define SAL_PATHSEPARATOR ':' #define SAL_PATHDELIMITER '/' @@ -66,6 +68,7 @@ #ifdef EMSCRIPTEN #define SAL_UNX #define SAL_DLLEXTENSION ".bc" +#define SAL_EXEEXTENSION "" #define SAL_DLLPREFIX "lib" #define SAL_PATHSEPARATOR ':' #define SAL_PATHDELIMITER '/' @@ -76,6 +79,7 @@ #ifdef MACOSX #define SAL_UNX #define SAL_DLLEXTENSION ".dylib" +#define SAL_EXEEXTENSION "" #define SAL_DLLPREFIX "lib" #define SAL_PATHSEPARATOR ':' #define SAL_PATHDELIMITER '/' diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index a3ac1d9..aeb5c14 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits