summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-09-01 00:04:09 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-09-05 16:09:06 +0200
commita897c5ed86c6d8981305bf725e83c76e4e3a36d0 (patch)
tree138df502db98ac6b5a14ffc5dfbc7e0ab1309fc2 /desktop
parentada87712ebc00b547e29fe31052e56f3495ea226 (diff)
tdf#109202: pass arg of --convert-images-to to (f)odt filter
Tunelling 1 piece of information through 20 layers of abstraction Advanced tunelling all the way to sfx2 Exhausted beyond recognition arrived to [Flat]ODF filter Change-Id: I0597c20c28f5cf8e2c60c4398622b36bda83abd0 Reviewed-on: https://gerrit.libreoffice.org/41777 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/dispatchwatcher.cxx26
-rw-r--r--desktop/source/app/officeipcthread.cxx7
2 files changed, 30 insertions, 3 deletions
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 4f31d226b4bf..c33dcaf61c8d 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -583,9 +583,12 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
OUString aParam = aDispatchRequest.aPrinterName;
sal_Int32 nPathIndex = aParam.lastIndexOf( ';' );
sal_Int32 nFilterIndex = aParam.indexOf( ':' );
+ sal_Int32 nImgFilterIndex = aParam.lastIndexOf( '|' );
if( nPathIndex < nFilterIndex )
nFilterIndex = -1;
- OUString aFilterOut=aParam.copy( nPathIndex+1 );
+
+ OUString aFilterOut;
+ OUString aImgOut;
OUString aFilter;
OUString aFilterExt;
bool bGuess = false;
@@ -601,6 +604,15 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
bGuess = true;
aFilterExt = aParam.copy( 0, nPathIndex );
}
+
+ if( nImgFilterIndex >= 0 )
+ {
+ aImgOut = aParam.copy( nImgFilterIndex+1 );
+ aFilterOut = aParam.copy( nPathIndex+1, nImgFilterIndex-nPathIndex-1 );
+ }
+ else
+ aFilterOut = aParam.copy( nPathIndex+1 );
+
INetURLObject aOutFilename( aObj );
aOutFilename.SetExtension( aFilterExt );
FileBase::getFileURLFromSystemPath( aFilterOut, aFilterOut );
@@ -633,7 +645,11 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
else
{
sal_Int32 nFilterOptionsIndex = aFilter.indexOf(':');
- Sequence<PropertyValue> conversionProperties( 0 < nFilterOptionsIndex ? 3 : 2 );
+ sal_Int32 nProps = ( 0 < nFilterOptionsIndex ) ? 3 : 2;
+
+ if ( !aImgOut.isEmpty() )
+ nProps +=1;
+ Sequence<PropertyValue> conversionProperties( nProps );
conversionProperties[0].Name = "Overwrite";
conversionProperties[0].Value <<= true;
@@ -650,6 +666,12 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
conversionProperties[1].Value <<= aFilter;
}
+ if ( !aImgOut.isEmpty() )
+ {
+ conversionProperties[nProps-1].Name = "ImageFilter";
+ conversionProperties[nProps-1].Value <<= aImgOut;
+ }
+
OUString aTempName;
FileBase::getSystemPathFromFileURL(aName, aTempName);
OString aSource8 = OUStringToOString(aTempName, osl_getThreadTextEncoding());
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 4abd35437868..01abf03b9a6f 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -1291,6 +1291,7 @@ static void AddConversionsToDispatchList(
const OUString& rPrinterName,
const OUString& rFactory,
const OUString& rParamOut,
+ const OUString& rImgOut,
const bool isTextCat,
const bool isScriptCat )
{
@@ -1317,6 +1318,7 @@ static void AddConversionsToDispatchList(
}
OUString aOutDir( rParamOut.trim() );
+ OUString aImgOut( rImgOut.trim() );
OUString aPWD;
if (cwdUrl)
{
@@ -1341,6 +1343,9 @@ static void AddConversionsToDispatchList(
aParam += ";" + aPWD;
}
+ if( !rImgOut.trim().isEmpty() )
+ aParam += "|" + aImgOut;
+
for (std::vector< OUString >::const_iterator i(rRequestList.begin());
i != rRequestList.end(); ++i)
{
@@ -1366,7 +1371,7 @@ bool RequestHandler::ExecuteCmdLineRequests(
AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aPrintToList, DispatchWatcher::REQUEST_PRINTTO, aRequest.aPrinterName, aRequest.aModule );
AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aForceOpenList, DispatchWatcher::REQUEST_FORCEOPEN, "", aRequest.aModule );
AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aForceNewList, DispatchWatcher::REQUEST_FORCENEW, "", aRequest.aModule );
- AddConversionsToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aConversionList, aRequest.aConversionParams, aRequest.aPrinterName, aRequest.aModule, aRequest.aConversionOut, aRequest.bTextCat, aRequest.bScriptCat );
+ AddConversionsToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aConversionList, aRequest.aConversionParams, aRequest.aPrinterName, aRequest.aModule, aRequest.aConversionOut, aRequest.aImageConversionType, aRequest.bTextCat, aRequest.bScriptCat );
bool bShutdown( false );
if ( pGlobal.is() )