summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-08-11 16:36:41 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-09-05 15:56:39 +0200
commitada87712ebc00b547e29fe31052e56f3495ea226 (patch)
tree5e9189ae7cbc88fc95bbd27d5146624efeac2c9c
parentUse LanguageTag::getBcp47MS() to write MS malformed tags to OOXML, tdf#83190 (diff)
downloadcore-ada87712ebc00b547e29fe31052e56f3495ea226.tar.gz
core-ada87712ebc00b547e29fe31052e56f3495ea226.zip
tdf#109202: Convert images via command line parameter, CLI support
Change-Id: Iea65bc24ed9a76ca35f7f91e0867a0853ced93e6 Reviewed-on: https://gerrit.libreoffice.org/41136 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--desktop/source/app/app.cxx1
-rw-r--r--desktop/source/app/cmdlineargs.cxx8
-rw-r--r--desktop/source/app/cmdlineargs.hxx2
-rw-r--r--desktop/source/app/officeipcthread.cxx1
-rw-r--r--desktop/source/app/officeipcthread.hxx1
5 files changed, 13 insertions, 0 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 209c0d7d8ed2..b08e928dd32c 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -2167,6 +2167,7 @@ void Desktop::OpenClients()
aRequest.aConversionList = rArgs.GetConversionList();
aRequest.aConversionParams = rArgs.GetConversionParams();
aRequest.aConversionOut = rArgs.GetConversionOut();
+ aRequest.aImageConversionType = rArgs.GetImageConversionType();
aRequest.aInFilter = rArgs.GetInFilter();
aRequest.bTextCat = rArgs.IsTextCat();
aRequest.bScriptCat = rArgs.IsScriptCat();
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 1a9bac2a1a2d..d4bacfb2c33f 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -580,6 +580,14 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
else if (m_unknown.isEmpty())
m_unknown = "--outdir must be followed by output directory path";
}
+ else if ( eCurrentEvent == CommandLineEvent::Conversion
+ && oArg == "convert-images-to" )
+ {
+ if (supplier.next(&aArg))
+ m_convertimages = aArg;
+ else if (m_unknown.isEmpty())
+ m_unknown = "--convert-images-to must be followed by an image type";
+ }
else if ( aArg.startsWith("-") )
{
// because it's impossible to filter these options that
diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx
index 78c5057a3d54..6bf2e0e1c6af 100644
--- a/desktop/source/app/cmdlineargs.hxx
+++ b/desktop/source/app/cmdlineargs.hxx
@@ -115,6 +115,7 @@ class CommandLineArgs
std::vector< OUString > GetConversionList() const;
const OUString& GetConversionParams() const { return m_conversionparams;}
OUString GetConversionOut() const;
+ OUString GetImageConversionType() const { return m_convertimages; }
const OUString& GetPidfileName() const { return m_pidfile;}
// Special analyzed states (does not match directly to a command line parameter!)
@@ -178,6 +179,7 @@ class CommandLineArgs
std::vector< OUString > m_conversionlist; // contains external URIs
OUString m_conversionparams;
OUString m_conversionout; // contains external URIs
+ OUString m_convertimages; // The format in which images should be converted
std::vector< OUString > m_infilter;
OUString m_language;
OUString m_pidfile;
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 2907e86ac76d..4abd35437868 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -1049,6 +1049,7 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) {
pRequest->aConversionList = aCmdLineArgs->GetConversionList();
pRequest->aConversionParams = aCmdLineArgs->GetConversionParams();
pRequest->aConversionOut = aCmdLineArgs->GetConversionOut();
+ pRequest->aImageConversionType = aCmdLineArgs->GetImageConversionType();
pRequest->aInFilter = aCmdLineArgs->GetInFilter();
pRequest->bTextCat = aCmdLineArgs->IsTextCat();
pRequest->bScriptCat = aCmdLineArgs->IsScriptCat();
diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx
index fd25195a6e8a..4450e98aebdb 100644
--- a/desktop/source/app/officeipcthread.hxx
+++ b/desktop/source/app/officeipcthread.hxx
@@ -61,6 +61,7 @@ struct ProcessDocumentsRequest
std::vector< OUString > aConversionList;
OUString aConversionParams;
OUString aConversionOut;
+ OUString aImageConversionType;
std::vector< OUString > aInFilter;
::osl::Condition *pcProcessed; // pointer condition to be set when the request has been processed
bool bTextCat; // boolean flag indicating whether to dump text content to console