l10ntools/source/uimerge.cxx | 7 +++++++ sal/osl/w32/process.cxx | 4 +++- shell/source/win32/SysShExec.cxx | 23 +++++++++++++---------- 3 files changed, 23 insertions(+), 11 deletions(-)
New commits: commit 6a25955d5d4b963463e10485e039fb4d466da12b Author: Thorsten Behrens <[email protected]> AuthorDate: Sat Nov 21 21:04:41 2020 +0100 Commit: Thorsten Behrens <[email protected]> CommitDate: Sat Nov 21 21:43:21 2020 +0100 Fix Windows build Change-Id: Iddc6a40743fde3142c121b2b2dfafb3f12753977 diff --git a/l10ntools/source/uimerge.cxx b/l10ntools/source/uimerge.cxx index 91a0283f0b4e..3e93a8ca32ae 100644 --- a/l10ntools/source/uimerge.cxx +++ b/l10ntools/source/uimerge.cxx @@ -7,6 +7,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifdef _WIN32 +#if !defined WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#include <windows.h> +#endif + #include <sal/main.h> #include <osl/file.hxx> diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index 44b66a89b846..5f053ec5d319 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -283,7 +283,9 @@ static rtl_uString ** osl_createCommandArgs_Impl (int & argc, char **) /* Ensure absolute path */ ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH ); DWORD dwResult - = GetModuleFileNameW(nullptr, o3tl::toW(aBuffer), aBuffer.getBufSizeInSymbols()); + = GetModuleFileNameW(nullptr, + reinterpret_cast<wchar_t *>(static_cast<sal_Unicode*>(aBuffer)), + aBuffer.getBufSizeInSymbols()); if ((0 < dwResult) && (dwResult < aBuffer.getBufSizeInSymbols())) { /* Replace argv[0] with it's absolute path */ diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 6f3b0d578323..e265788d0d52 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -321,7 +321,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa throw css::lang::IllegalArgumentException( ("XSystemShellExecute.execute, getSystemPathFromFileURL <" + aCommand + "> failed with " + OUString::number(e1)), - {}, 0); + static_cast< XSystemShellExecute* >( this ), 0); } for (int i = 0;; ++i) { SHFILEINFOW info; @@ -330,14 +330,16 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa != 0) { throw css::lang::IllegalArgumentException( - "XSystemShellExecute.execute, cannot process <" + aCommand + ">", {}, 0); + "XSystemShellExecute.execute, cannot process <" + aCommand + ">", + static_cast< XSystemShellExecute* >( this ), 0); } if (SHGetFileInfoW( pathname.getStr(), 0, &info, sizeof info, SHGFI_ATTRIBUTES) == 0) { throw css::lang::IllegalArgumentException( - "XSystemShellExecute.execute, SHGetFileInfoW(" + pathname + ") failed", {}, + "XSystemShellExecute.execute, SHGetFileInfoW(" + pathname + ") failed", + static_cast< XSystemShellExecute* >( this ), 0); } if ((info.dwAttributes & SFGAO_LINK) == 0) { @@ -351,7 +353,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa throw css::lang::IllegalArgumentException( ("XSystemShellExecute.execute, CoCreateInstance failed with " + OUString::number(e2)), - {}, 0); + static_cast< XSystemShellExecute* >( this ), 0); } sal::systools::COMReference<IPersistFile> file; try { @@ -360,21 +362,21 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa throw css::lang::IllegalArgumentException( ("XSystemShellExecute.execute, QueryInterface failed with: " + o3tl::runtimeToOUString(e3.what())), - {}, 0); + static_cast< XSystemShellExecute* >( this ), 0); } e2 = file->Load(pathname.getStr(), STGM_READ); if (FAILED(e2)) { throw css::lang::IllegalArgumentException( ("XSystemShellExecute.execute, IPersistFile.Load failed with " + OUString::number(e2)), - {}, 0); + static_cast< XSystemShellExecute* >( this ), 0); } e2 = link->Resolve(nullptr, SLR_UPDATE | SLR_NO_UI); if (FAILED(e2)) { throw css::lang::IllegalArgumentException( ("XSystemShellExecute.execute, IShellLink.Resolve failed with " + OUString::number(e2)), - {}, 0); + static_cast< XSystemShellExecute* >( this ), 0); } wchar_t path[MAX_PATH]; WIN32_FIND_DATAW wfd; @@ -383,14 +385,14 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa throw css::lang::IllegalArgumentException( ("XSystemShellExecute.execute, IShellLink.GetPath failed with " + OUString::number(e2)), - {}, 0); + static_cast< XSystemShellExecute* >( this ), 0); } pathname = path; // Fail at some arbitrary nesting depth, to avoid an infinite loop: if (i == 30) { throw css::lang::IllegalArgumentException( "XSystemShellExecute.execute, link depth exceeded for <" + aCommand + ">", - {}, 0); + static_cast< XSystemShellExecute* >( this ), 0); } } auto const n = pathname.lastIndexOf('.'); @@ -406,7 +408,8 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa ext, ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY"))) { throw css::lang::IllegalArgumentException( - "XSystemShellExecute.execute, cannot process <" + aCommand + ">", {}, 0); + "XSystemShellExecute.execute, cannot process <" + aCommand + ">", + static_cast< XSystemShellExecute* >( this ), 0); } } } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
