Kaydet (Commit) ada87712 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt Kaydeden (comit) Thorsten Behrens

tdf#109202: Convert images via command line parameter, CLI support

Change-Id: Iea65bc24ed9a76ca35f7f91e0867a0853ced93e6
Reviewed-on: https://gerrit.libreoffice.org/41136Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 49f1f04c
......@@ -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();
......
......@@ -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
......
......@@ -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;
......
......@@ -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();
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment