From ada87712ebc00b547e29fe31052e56f3495ea226 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Fri, 11 Aug 2017 16:36:41 +0200 Subject: tdf#109202: Convert images via command line parameter, CLI support Change-Id: Iea65bc24ed9a76ca35f7f91e0867a0853ced93e6 Reviewed-on: https://gerrit.libreoffice.org/41136 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens --- desktop/source/app/app.cxx | 1 + desktop/source/app/cmdlineargs.cxx | 8 ++++++++ desktop/source/app/cmdlineargs.hxx | 2 ++ desktop/source/app/officeipcthread.cxx | 1 + desktop/source/app/officeipcthread.hxx | 1 + 5 files changed, 13 insertions(+) (limited to 'desktop') 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 -- cgit