diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-27 21:19:46 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-28 09:55:03 +0000 |
commit | 74534364f9ce285079467aab11bfde8620f6d2f2 (patch) | |
tree | 18186e0c87694054128f74d8ab98f7501e69939c /svx/source/dialog | |
parent | is there any point to aSrcLine and "rsc" directive in idl? (diff) | |
download | core-74534364f9ce285079467aab11bfde8620f6d2f2.tar.gz core-74534364f9ce285079467aab11bfde8620f6d2f2.zip |
getenv/putenv->osl_setEnvironment
Diffstat (limited to 'svx/source/dialog')
-rw-r--r-- | svx/source/dialog/sendreportunx.cxx | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/svx/source/dialog/sendreportunx.cxx b/svx/source/dialog/sendreportunx.cxx index 8586d497ca75..35a5cb556d27 100644 --- a/svx/source/dialog/sendreportunx.cxx +++ b/svx/source/dialog/sendreportunx.cxx @@ -29,6 +29,7 @@ #include "docrecovery.hxx" #include "osl/file.hxx" +#include "osl/process.h" #include "rtl/bootstrap.hxx" #include "rtl/strbuf.hxx" #include "tools/appendunixshellword.hxx" @@ -209,16 +210,9 @@ namespace svx{ bool ErrorRepSendDialog::SendReport() { - rtl::OString strSubject(rtl::OUStringToOString(GetDocType(), RTL_TEXTENCODING_UTF8)); - -#if defined( LINUX ) || defined (MACOSX ) - setenv( "ERRORREPORT_SUBJECT", strSubject.getStr(), 1 ); -#else - static ::rtl::OString strEnvSubject = "ERRORREPORT_SUBJECT"; - strEnvSubject += "="; - strEnvSubject += strSubject; - putenv( (char *)strEnvSubject.getStr() ); -#endif + rtl::OUString sSubEnvVar(RTL_CONSTASCII_USTRINGPARAM("ERRORREPORT_SUBJECT")); + rtl::OUString strSubject(GetDocType()); + osl_setEnvironment(sSubEnvVar.pData, strSubject.pData); char szBodyFile[L_tmpnam] = ""; FILE *fp = fopen( tmpnam( szBodyFile ), "w" ); @@ -230,14 +224,11 @@ namespace svx{ size_t nWritten = fwrite(strUTF8.getStr(), 1, strUTF8.getLength(), fp); OSL_VERIFY(nWritten == static_cast<size_t>(strUTF8.getLength())); fclose( fp ); -#if defined( LINUX ) || defined (MACOSX) - setenv("ERRORREPORT_BODYFILE", szBodyFile, 1); -#else - static ::rtl::OString strEnvBodyFile = "ERRORREPORT_BODYFILE"; - strEnvBodyFile += "="; - strEnvBodyFile += szBodyFile; - putenv((char *)strEnvBodyFile.getStr()); -#endif + + rtl::OUString sBodyEnvVar(RTL_CONSTASCII_USTRINGPARAM("ERRORREPORT_BODYFILE")); + rtl::OUString strBodyFile(rtl::OStringToOUString(rtl::OString(szBodyFile), + osl_getThreadTextEncoding())); + osl_setEnvironment(sBodyEnvVar.pData, strBodyFile.pData); } int ret = -1; |