diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-14 07:47:17 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-14 13:06:21 +0200 |
commit | 1c85b047b6cfdbae010f0967e9c9f99f7a101d32 (patch) | |
tree | f266520338c506b9fecc4435828b1108635569eb /filter | |
parent | Resolves: tdf#128132 language page not opened (diff) | |
download | core-1c85b047b6cfdbae010f0967e9c9f99f7a101d32.tar.gz core-1c85b047b6cfdbae010f0967e9c9f99f7a101d32.zip |
tdf#94117: try gswin64c if gswin32c failed
Change-Id: I3c29ef72525aa25ee8606122f01b7b611ecb2091
Reviewed-on: https://gerrit.libreoffice.org/80748
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/ieps/ieps.cxx | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 2ce4fd01b022..39c2d1fe784d 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -296,15 +296,21 @@ static void WriteFileInThread(void *wData) } static bool RenderAsBMPThroughHelper(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, - Graphic &rGraphic, const OUString &rProgName, rtl_uString *pArgs[], size_t nArgs) + Graphic& rGraphic, + std::initializer_list<OUStringLiteral> aProgNames, + rtl_uString* pArgs[], size_t nArgs) { - oslProcess aProcess; + oslProcess aProcess = nullptr; oslFileHandle pIn = nullptr; oslFileHandle pOut = nullptr; oslFileHandle pErr = nullptr; - oslProcessError eErr = runProcessWithPathSearch(rProgName, - pArgs, nArgs, - &aProcess, &pIn, &pOut, &pErr); + oslProcessError eErr = osl_Process_E_Unknown; + for (const auto& rProgName : aProgNames) + { + eErr = runProcessWithPathSearch(rProgName, pArgs, nArgs, &aProcess, &pIn, &pOut, &pErr); + if (eErr == osl_Process_E_None) + break; + } if (eErr!=osl_Process_E_None) return false; @@ -362,7 +368,7 @@ static bool RenderAsBMPThroughConvert(const sal_uInt8* pBuf, sal_uInt32 nBytesRe arg1.pData, arg2.pData, arg3.pData, arg4.pData }; return RenderAsBMPThroughHelper(pBuf, nBytesRead, rGraphic, - ("convert" EXESUFFIX), + { "convert" EXESUFFIX }, args, SAL_N_ELEMENTS(args)); } @@ -389,9 +395,13 @@ static bool RenderAsBMPThroughGS(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, }; return RenderAsBMPThroughHelper(pBuf, nBytesRead, rGraphic, #ifdef _WIN32 - "gswin32c" EXESUFFIX, + // Try both 32-bit and 64-bit ghostscript executable name + { + "gswin32c" EXESUFFIX, + "gswin64c" EXESUFFIX, + }, #else - "gs" EXESUFFIX, + { "gs" EXESUFFIX }, #endif args, SAL_N_ELEMENTS(args)); |