A small refactor

Change-Id: I299cc7c2850a71ee563824c6361707d894f5ddcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165773
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2024-04-04 10:50:56 +05:00
parent 9e47e21712
commit 65a57e5c7c

View File

@@ -61,6 +61,7 @@
#include <memory> #include <memory>
#include <string_view> #include <string_view>
#include <unordered_map> #include <unordered_map>
#include <vector>
#include <string.h> #include <string.h>
using namespace com::sun::star; using namespace com::sun::star;
@@ -1081,10 +1082,13 @@ bool xpdf_ImportFromFile(const OUString& rURL,
// spawn separate process to keep LGPL/GPL code apart. // spawn separate process to keep LGPL/GPL code apart.
OUString aOptFlag("-o"); constexpr OUString aOptFlag(u"-o"_ustr);
rtl_uString* args[] = { aSysUPath.pData, std::vector<rtl_uString*> args({ aSysUPath.pData });
aOptFlag.pData, rFilterOptions.pData }; if (!rFilterOptions.isEmpty())
sal_Int32 nArgs = rFilterOptions.isEmpty() ? std::size(args) - 2 : std::size(args); {
args.push_back(aOptFlag.pData);
args.push_back(rFilterOptions.pData);
}
oslProcess aProcess; oslProcess aProcess;
oslFileHandle pIn = nullptr; oslFileHandle pIn = nullptr;
@@ -1093,8 +1097,8 @@ bool xpdf_ImportFromFile(const OUString& rURL,
oslSecurity pSecurity = osl_getCurrentSecurity (); oslSecurity pSecurity = osl_getCurrentSecurity ();
oslProcessError eErr = oslProcessError eErr =
osl_executeProcess_WithRedirectedIO(converterURL.pData, osl_executeProcess_WithRedirectedIO(converterURL.pData,
args, args.data(),
nArgs, args.size(),
osl_Process_SEARCHPATH|osl_Process_HIDDEN, osl_Process_SEARCHPATH|osl_Process_HIDDEN,
pSecurity, pSecurity,
nullptr, nullptr, 0, nullptr, nullptr, 0,