summaryrefslogtreecommitdiff
path: root/filter/source/graphicfilter/ieps/ieps.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-06 09:23:33 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-09 08:34:40 +0000
commit6c80a8fe89fadf9a2c7260a09c037a09462f53d1 (patch)
treed36da9ee2a5fdc579d2a57ff6ba02deaddfa785a /filter/source/graphicfilter/ieps/ieps.cxx
parente1fc599eb764186e5d511ace9785463eebbc7028 (diff)
new loplugin: oncevar
Change-Id: If57390510dde4d166be3141b9f658a7453755d3f Reviewed-on: https://gerrit.libreoffice.org/19815 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'filter/source/graphicfilter/ieps/ieps.cxx')
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index ca7b30a58e6e..67554054531e 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -208,7 +208,6 @@ static bool RenderAsEMF(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r
sal_uInt64 nCount = pInputStream->Write(pBuf, nBytesRead);
aTempInput.CloseStream();
- OUString fileName("pstoedit" EXESUFFIX);
//fdo#64161 pstoedit under non-windows uses libEMF to output the EMF, but
//libEMF cannot calculate the bounding box of text, so the overall bounding
//box is not increased to include that of any text in the eps
@@ -231,7 +230,8 @@ static bool RenderAsEMF(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r
oslFileHandle pIn = NULL;
oslFileHandle pOut = NULL;
oslFileHandle pErr = NULL;
- oslProcessError eErr = runProcessWithPathSearch(fileName,
+ oslProcessError eErr = runProcessWithPathSearch(
+ "pstoedit" EXESUFFIX,
args, sizeof(args)/sizeof(rtl_uString *),
&aProcess, &pIn, &pOut, &pErr);
@@ -292,7 +292,7 @@ static void WriteFileInThread(void *wData)
}
static bool RenderAsBMPThroughHelper(const sal_uInt8* pBuf, sal_uInt32 nBytesRead,
- Graphic &rGraphic, OUString &rProgName, rtl_uString *pArgs[], size_t nArgs)
+ Graphic &rGraphic, const OUString &rProgName, rtl_uString *pArgs[], size_t nArgs)
{
oslProcess aProcess;
oslFileHandle pIn = NULL;
@@ -344,7 +344,6 @@ static bool RenderAsBMPThroughHelper(const sal_uInt8* pBuf, sal_uInt32 nBytesRea
static bool RenderAsBMPThroughConvert(const sal_uInt8* pBuf, sal_uInt32 nBytesRead,
Graphic &rGraphic)
{
- OUString fileName("convert" EXESUFFIX);
// density in pixel/inch
OUString arg1("-density");
// since the preview is also used for PDF-Export & printing on non-PS-printers,
@@ -358,18 +357,15 @@ static bool RenderAsBMPThroughConvert(const sal_uInt8* pBuf, sal_uInt32 nBytesRe
{
arg1.pData, arg2.pData, arg3.pData, arg4.pData
};
- return RenderAsBMPThroughHelper(pBuf, nBytesRead, rGraphic, fileName, args,
+ return RenderAsBMPThroughHelper(pBuf, nBytesRead, rGraphic,
+ ("convert" EXESUFFIX),
+ args,
sizeof(args)/sizeof(rtl_uString *));
}
static bool RenderAsBMPThroughGS(const sal_uInt8* pBuf, sal_uInt32 nBytesRead,
Graphic &rGraphic)
{
-#ifdef WNT
- OUString fileName("gswin32c" EXESUFFIX);
-#else
- OUString fileName("gs" EXESUFFIX);
-#endif
OUString arg1("-q");
OUString arg2("-dBATCH");
OUString arg3("-dNOPAUSE");
@@ -387,7 +383,13 @@ static bool RenderAsBMPThroughGS(const sal_uInt8* pBuf, sal_uInt32 nBytesRead,
arg6.pData, arg7.pData, arg8.pData, arg9.pData, arg10.pData,
arg11.pData
};
- return RenderAsBMPThroughHelper(pBuf, nBytesRead, rGraphic, fileName, args,
+ return RenderAsBMPThroughHelper(pBuf, nBytesRead, rGraphic,
+#ifdef WNT
+ "gswin32c" EXESUFFIX,
+#else
+ "gs" EXESUFFIX,
+#endif
+ args,
sizeof(args)/sizeof(rtl_uString *));
}