2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2001-07-16 11:55:47 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 02:36:51 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-07-16 11:55:47 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-07-16 11:55:47 +00:00
|
|
|
*
|
2008-04-11 02:36:51 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-07-16 11:55:47 +00:00
|
|
|
*
|
2008-04-11 02:36:51 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-07-16 11:55:47 +00:00
|
|
|
*
|
2008-04-11 02:36:51 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2001-07-16 11:55:47 +00:00
|
|
|
*
|
2008-04-11 02:36:51 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2001-07-16 11:55:47 +00:00
|
|
|
*
|
2008-04-11 02:36:51 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2001-07-16 11:55:47 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#include <cmdlineargs.hxx>
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
#include <rtl/uri.hxx>
|
2005-03-11 09:47:18 +00:00
|
|
|
#include <rtl/ustring.hxx>
|
2008-04-17 07:11:24 +00:00
|
|
|
#include "rtl/process.h"
|
2005-03-11 09:47:18 +00:00
|
|
|
#include <comphelper/processfactory.hxx>
|
|
|
|
#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
2008-06-09 12:31:39 +00:00
|
|
|
#include "tools/getprocessworkingdir.hxx"
|
2005-03-11 09:47:18 +00:00
|
|
|
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/documentlockfile.hxx>
|
2008-04-15 13:30:24 +00:00
|
|
|
|
2011-01-11 12:46:33 -05:00
|
|
|
#include <cstdio>
|
|
|
|
|
2005-03-11 09:47:18 +00:00
|
|
|
using namespace com::sun::star::lang;
|
|
|
|
using namespace com::sun::star::uri;
|
|
|
|
using namespace com::sun::star::uno;
|
2001-07-16 11:55:47 +00:00
|
|
|
|
2011-02-26 15:34:48 +01:00
|
|
|
using ::rtl::OUString;
|
|
|
|
|
2001-07-16 11:55:47 +00:00
|
|
|
namespace desktop
|
|
|
|
{
|
|
|
|
|
2007-10-26 10:55:47 +00:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
class ExtCommandLineSupplier: public CommandLineArgs::Supplier {
|
|
|
|
public:
|
2008-04-17 07:11:24 +00:00
|
|
|
explicit ExtCommandLineSupplier():
|
|
|
|
m_count(rtl_getAppCommandArgCount()),
|
2008-06-09 12:31:39 +00:00
|
|
|
m_index(0)
|
|
|
|
{
|
|
|
|
rtl::OUString url;
|
2010-12-16 09:42:43 +00:00
|
|
|
if (tools::getProcessWorkingDir(url)) {
|
2008-06-09 12:31:39 +00:00
|
|
|
m_cwdUrl.reset(url);
|
|
|
|
}
|
|
|
|
}
|
2007-10-26 10:55:47 +00:00
|
|
|
|
|
|
|
virtual ~ExtCommandLineSupplier() {}
|
|
|
|
|
2008-06-09 12:31:39 +00:00
|
|
|
virtual boost::optional< rtl::OUString > getCwdUrl() { return m_cwdUrl; }
|
|
|
|
|
2007-10-26 10:55:47 +00:00
|
|
|
virtual bool next(rtl::OUString * argument) {
|
|
|
|
OSL_ASSERT(argument != NULL);
|
|
|
|
if (m_index < m_count) {
|
2008-12-30 13:32:01 +00:00
|
|
|
rtl_getAppCommandArg(m_index++, &argument->pData);
|
2007-10-26 10:55:47 +00:00
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2008-06-09 12:31:39 +00:00
|
|
|
boost::optional< rtl::OUString > m_cwdUrl;
|
2007-10-26 10:55:47 +00:00
|
|
|
sal_uInt32 m_count;
|
|
|
|
sal_uInt32 m_index;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2002-10-24 14:39:22 +00:00
|
|
|
static CommandLineArgs::BoolParam aModuleGroupDefinition[] =
|
|
|
|
{
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_WRITER,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_CALC,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_DRAW,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_IMPRESS,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_GLOBAL,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_MATH,
|
2004-08-02 13:39:15 +00:00
|
|
|
CommandLineArgs::CMD_BOOLPARAM_WEB,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_BASE
|
2002-10-24 14:39:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
CommandLineArgs::GroupDefinition CommandLineArgs::m_pGroupDefinitions[ CommandLineArgs::CMD_GRPID_COUNT ] =
|
|
|
|
{
|
2004-08-02 13:39:15 +00:00
|
|
|
{ 8, aModuleGroupDefinition }
|
2002-10-24 14:39:22 +00:00
|
|
|
};
|
|
|
|
|
2007-10-26 10:55:47 +00:00
|
|
|
CommandLineArgs::Supplier::Exception::Exception() {}
|
|
|
|
|
|
|
|
CommandLineArgs::Supplier::Exception::Exception(Exception const &) {}
|
|
|
|
|
|
|
|
CommandLineArgs::Supplier::Exception::~Exception() {}
|
|
|
|
|
|
|
|
CommandLineArgs::Supplier::Exception &
|
|
|
|
CommandLineArgs::Supplier::Exception::operator =(Exception const &)
|
|
|
|
{ return *this; }
|
|
|
|
|
|
|
|
CommandLineArgs::Supplier::~Supplier() {}
|
|
|
|
|
2001-07-20 08:37:43 +00:00
|
|
|
// intialize class with command line parameters from process environment
|
2008-06-09 12:31:39 +00:00
|
|
|
CommandLineArgs::CommandLineArgs()
|
2001-07-16 11:55:47 +00:00
|
|
|
{
|
2001-07-20 08:37:43 +00:00
|
|
|
ResetParamValues();
|
2008-04-17 07:11:24 +00:00
|
|
|
ExtCommandLineSupplier s;
|
2008-06-09 12:31:39 +00:00
|
|
|
ParseCommandLine_Impl( s );
|
2001-07-16 11:55:47 +00:00
|
|
|
}
|
|
|
|
|
2007-10-26 10:55:47 +00:00
|
|
|
CommandLineArgs::CommandLineArgs( Supplier& supplier )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
|
|
|
ResetParamValues();
|
2008-06-09 12:31:39 +00:00
|
|
|
ParseCommandLine_Impl( supplier );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2001-07-16 11:55:47 +00:00
|
|
|
|
2008-06-09 12:31:39 +00:00
|
|
|
void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
|
2001-07-16 11:55:47 +00:00
|
|
|
{
|
2008-06-09 12:31:39 +00:00
|
|
|
m_cwdUrl = supplier.getCwdUrl();
|
2005-04-22 10:28:59 +00:00
|
|
|
Reference<XMultiServiceFactory> xMS(comphelper::getProcessServiceFactory(), UNO_QUERY);
|
|
|
|
OSL_ENSURE(xMS.is(), "CommandLineArgs: no ProcessServiceFactory.");
|
|
|
|
|
2005-03-11 09:47:18 +00:00
|
|
|
Reference< XExternalUriReferenceTranslator > xTranslator(
|
|
|
|
xMS->createInstance(
|
2010-11-08 15:14:32 +00:00
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM(
|
|
|
|
"com.sun.star.uri.ExternalUriReferenceTranslator"))),
|
2005-03-11 09:47:18 +00:00
|
|
|
UNO_QUERY);
|
|
|
|
|
2001-07-20 08:37:43 +00:00
|
|
|
// parse command line arguments
|
2010-10-22 13:00:24 +02:00
|
|
|
bool bOpenEvent(true);
|
|
|
|
bool bPrintEvent(false);
|
|
|
|
bool bViewEvent(false);
|
|
|
|
bool bStartEvent(false);
|
|
|
|
bool bPrintToEvent(false);
|
|
|
|
bool bPrinterName(false);
|
|
|
|
bool bForceOpenEvent(false);
|
|
|
|
bool bForceNewEvent(false);
|
|
|
|
bool bDisplaySpec(false);
|
|
|
|
bool bOpenDoc(false);
|
2011-03-12 02:42:58 +01:00
|
|
|
bool bConversionEvent(false);
|
|
|
|
bool bConversionParamsEvent(false);
|
|
|
|
bool bBatchPrintEvent(false);
|
|
|
|
bool bBatchPrinterNameEvent(false);
|
|
|
|
bool bConversionOutEvent(false);
|
2001-07-20 08:37:43 +00:00
|
|
|
|
2007-10-26 10:55:47 +00:00
|
|
|
m_eArgumentCount = NONE;
|
2003-04-24 12:35:12 +00:00
|
|
|
|
2007-10-26 10:55:47 +00:00
|
|
|
for (;;)
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2007-10-26 10:55:47 +00:00
|
|
|
::rtl::OUString aArg;
|
|
|
|
if ( !supplier.next( &aArg ) )
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2011-03-25 20:48:19 +01:00
|
|
|
// convert file URLs to internal form
|
2010-12-13 22:54:24 +09:00
|
|
|
if (aArg.indexOfAsciiL(RTL_CONSTASCII_STRINGPARAM("file:"))==0 &&
|
2008-06-09 12:31:39 +00:00
|
|
|
xTranslator.is())
|
2007-10-26 10:55:47 +00:00
|
|
|
{
|
2008-06-09 12:31:39 +00:00
|
|
|
OUString tmp(xTranslator->translateToInternal(aArg));
|
2011-12-20 19:01:12 -02:00
|
|
|
if (!tmp.isEmpty())
|
2008-06-09 12:31:39 +00:00
|
|
|
aArg = tmp;
|
2007-10-26 10:55:47 +00:00
|
|
|
}
|
2001-07-20 08:37:43 +00:00
|
|
|
|
2011-12-20 19:01:12 -02:00
|
|
|
if ( !aArg.isEmpty() )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2007-10-26 10:55:47 +00:00
|
|
|
m_eArgumentCount = m_eArgumentCount == NONE ? ONE : MANY;
|
2010-12-31 12:57:31 +09:00
|
|
|
::rtl::OUString oArg;
|
|
|
|
if ( !InterpretCommandLineParameter( aArg, oArg ))
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
if ( aArg.toChar() == '-' )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
|
|
|
// handle this argument as an option
|
2010-12-13 22:54:24 +09:00
|
|
|
if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("-n")))
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2002-02-26 07:18:25 +00:00
|
|
|
// force new documents based on the following documents
|
2010-10-22 13:00:24 +02:00
|
|
|
bForceNewEvent = true;
|
|
|
|
bOpenEvent = false;
|
|
|
|
bForceOpenEvent = false;
|
|
|
|
bPrintToEvent = false;
|
|
|
|
bPrintEvent = false;
|
|
|
|
bViewEvent = false;
|
|
|
|
bStartEvent = false;
|
|
|
|
bDisplaySpec = false;
|
|
|
|
}
|
2011-03-12 02:42:58 +01:00
|
|
|
else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-o" )))
|
2001-12-04 15:05:32 +00:00
|
|
|
{
|
2010-10-22 13:00:24 +02:00
|
|
|
// force open documents regardless if they are templates or not
|
|
|
|
bForceOpenEvent = true;
|
|
|
|
bOpenEvent = false;
|
|
|
|
bForceNewEvent = false;
|
|
|
|
bPrintToEvent = false;
|
|
|
|
bPrintEvent = false;
|
|
|
|
bViewEvent = false;
|
|
|
|
bStartEvent = false;
|
|
|
|
bDisplaySpec = false;
|
2001-12-04 15:05:32 +00:00
|
|
|
}
|
2011-03-12 02:42:58 +01:00
|
|
|
else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-pt" )))
|
2002-02-26 07:18:25 +00:00
|
|
|
{
|
|
|
|
// Print to special printer
|
2010-10-22 13:00:24 +02:00
|
|
|
bPrintToEvent = true;
|
|
|
|
bPrinterName = true;
|
|
|
|
bPrintEvent = false;
|
|
|
|
bOpenEvent = false;
|
|
|
|
bForceNewEvent = false;
|
|
|
|
bViewEvent = false;
|
|
|
|
bStartEvent = false;
|
|
|
|
bDisplaySpec = false;
|
|
|
|
bForceOpenEvent = false;
|
|
|
|
}
|
2011-03-12 02:42:58 +01:00
|
|
|
else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-p" )))
|
2010-10-22 13:00:24 +02:00
|
|
|
{
|
2002-02-26 07:18:25 +00:00
|
|
|
// Print to default printer
|
2010-10-22 13:00:24 +02:00
|
|
|
bPrintEvent = true;
|
|
|
|
bPrintToEvent = false;
|
|
|
|
bOpenEvent = false;
|
|
|
|
bForceNewEvent = false;
|
|
|
|
bForceOpenEvent = false;
|
|
|
|
bViewEvent = false;
|
|
|
|
bStartEvent = false;
|
|
|
|
bDisplaySpec = false;
|
|
|
|
}
|
2011-03-12 02:42:58 +01:00
|
|
|
else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-view" )))
|
2010-10-22 13:00:24 +02:00
|
|
|
{
|
2003-03-25 12:52:54 +00:00
|
|
|
// open in viewmode
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenEvent = false;
|
|
|
|
bPrintEvent = false;
|
|
|
|
bPrintToEvent = false;
|
|
|
|
bForceNewEvent = false;
|
|
|
|
bForceOpenEvent = false;
|
|
|
|
bViewEvent = true;
|
|
|
|
bStartEvent = false;
|
|
|
|
bDisplaySpec = false;
|
2011-03-12 02:42:58 +01:00
|
|
|
}
|
|
|
|
else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-show" )))
|
|
|
|
{
|
2010-03-29 11:28:28 +02:00
|
|
|
// open in viewmode
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenEvent = false;
|
|
|
|
bViewEvent = false;
|
|
|
|
bStartEvent = true;
|
|
|
|
bPrintEvent = false;
|
|
|
|
bPrintToEvent = false;
|
|
|
|
bForceNewEvent = false;
|
|
|
|
bForceOpenEvent = false;
|
|
|
|
bDisplaySpec = false;
|
2003-06-10 08:12:23 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("display")))
|
2003-06-10 08:12:23 +00:00
|
|
|
{
|
2010-03-29 11:28:28 +02:00
|
|
|
// set display
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenEvent = false;
|
|
|
|
bPrintEvent = false;
|
|
|
|
bForceOpenEvent = false;
|
|
|
|
bPrintToEvent = false;
|
|
|
|
bForceNewEvent = false;
|
|
|
|
bViewEvent = false;
|
|
|
|
bStartEvent = false;
|
|
|
|
bDisplaySpec = true;
|
2010-03-29 11:28:28 +02:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("language")))
|
2010-03-29 11:28:28 +02:00
|
|
|
{
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenEvent = false;
|
|
|
|
bPrintEvent = false;
|
|
|
|
bForceOpenEvent = false;
|
|
|
|
bPrintToEvent = false;
|
|
|
|
bForceNewEvent = false;
|
|
|
|
bViewEvent = false;
|
|
|
|
bStartEvent = false;
|
|
|
|
bDisplaySpec = false;
|
2003-05-16 13:21:09 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("convert-to")))
|
2010-08-25 23:37:30 +02:00
|
|
|
{
|
2011-03-12 02:42:58 +01:00
|
|
|
bOpenEvent = false;
|
|
|
|
bConversionEvent = true;
|
|
|
|
bConversionParamsEvent = true;
|
2010-08-25 23:37:30 +02:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("print-to-file")))
|
2010-08-25 23:37:30 +02:00
|
|
|
{
|
2011-03-12 02:42:58 +01:00
|
|
|
bOpenEvent = false;
|
|
|
|
bBatchPrintEvent = true;
|
2010-08-25 23:37:30 +02:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("printer-name")) &&
|
2010-08-25 23:37:30 +02:00
|
|
|
bBatchPrintEvent )
|
|
|
|
{
|
2011-03-12 02:42:58 +01:00
|
|
|
bBatchPrinterNameEvent = true;
|
2010-08-25 23:37:30 +02:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("outdir")) &&
|
2010-08-25 23:37:30 +02:00
|
|
|
(bConversionEvent || bBatchPrintEvent) )
|
|
|
|
{
|
2011-03-12 02:42:58 +01:00
|
|
|
bConversionOutEvent = true;
|
2010-08-25 23:37:30 +02:00
|
|
|
}
|
2012-03-06 15:49:20 +00:00
|
|
|
#if defined UNX
|
|
|
|
else
|
2012-03-08 15:49:52 +01:00
|
|
|
// because it's impossible to filter these options that
|
|
|
|
// are handled in the soffice shell script with the
|
|
|
|
// primitive tools that /bin/sh offers, ignore them here
|
|
|
|
if (!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("backtrace")) &&
|
|
|
|
!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("strace")) &&
|
2012-03-27 15:21:57 +01:00
|
|
|
!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("valgrind")) &&
|
|
|
|
//ignore additional legacy options that don't do anything anymore
|
|
|
|
!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("nocrashreport")))
|
2012-03-06 15:49:20 +00:00
|
|
|
{
|
2012-03-08 15:49:52 +01:00
|
|
|
fprintf(stderr, "Unknown option %s\n",
|
2012-03-06 15:49:20 +00:00
|
|
|
rtl::OUStringToOString(aArg, osl_getThreadTextEncoding()).getStr());
|
2012-03-08 15:49:52 +01:00
|
|
|
fprintf(stderr, "Run 'soffice --help' to see a full list of available command line options.\n");
|
2012-03-06 15:49:20 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_UNKNOWN, sal_True );
|
|
|
|
}
|
|
|
|
#endif
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-12-04 15:05:32 +00:00
|
|
|
if ( bPrinterName && bPrintToEvent )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2001-12-04 15:05:32 +00:00
|
|
|
// first argument after "-pt" this must be the printer name
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_PRINTERNAME, aArg );
|
2011-03-12 02:42:58 +01:00
|
|
|
bPrinterName = false;
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-08-25 23:37:30 +02:00
|
|
|
else if ( bConversionParamsEvent && bConversionEvent )
|
|
|
|
{
|
|
|
|
// first argument must be the the params
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_CONVERSIONPARAMS, aArg );
|
2011-03-12 02:42:58 +01:00
|
|
|
bConversionParamsEvent = false;
|
2010-08-25 23:37:30 +02:00
|
|
|
}
|
|
|
|
else if ( bBatchPrinterNameEvent && bBatchPrintEvent )
|
|
|
|
{
|
|
|
|
// first argument is the printer name
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_PRINTERNAME, aArg );
|
2011-03-12 02:42:58 +01:00
|
|
|
bBatchPrinterNameEvent = false;
|
2010-08-25 23:37:30 +02:00
|
|
|
}
|
|
|
|
else if ( (bConversionEvent || bBatchPrintEvent) && bConversionOutEvent )
|
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_CONVERSIONOUT, aArg );
|
2011-03-12 02:42:58 +01:00
|
|
|
bConversionOutEvent = false;
|
2010-08-25 23:37:30 +02:00
|
|
|
}
|
2001-12-04 15:05:32 +00:00
|
|
|
else
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2010-08-25 22:28:03 +02:00
|
|
|
if( bOpenEvent || bViewEvent || bForceNewEvent || bForceOpenEvent )
|
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
if( aArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("::ODMA")) )
|
2010-08-25 22:28:03 +02:00
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
::rtl::OUString sArg(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.odma:/"));
|
|
|
|
sArg += aArg;
|
|
|
|
aArg = sArg;
|
2010-08-25 22:28:03 +02:00
|
|
|
}
|
|
|
|
}
|
2001-12-04 15:05:32 +00:00
|
|
|
// handle this argument as a filename
|
|
|
|
if ( bOpenEvent )
|
2010-10-22 13:00:24 +02:00
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_OPENLIST, aArg );
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenDoc = true;
|
|
|
|
}
|
2003-03-25 12:52:54 +00:00
|
|
|
else if ( bViewEvent )
|
2011-03-12 02:42:58 +01:00
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_VIEWLIST, aArg );
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenDoc = true;
|
|
|
|
}
|
2003-05-16 13:21:09 +00:00
|
|
|
else if ( bStartEvent )
|
2010-10-22 13:00:24 +02:00
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_STARTLIST, aArg );
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenDoc = true;
|
|
|
|
}
|
2001-12-04 15:05:32 +00:00
|
|
|
else if ( bPrintEvent )
|
2010-10-22 13:00:24 +02:00
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_PRINTLIST, aArg );
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenDoc = true;
|
|
|
|
}
|
2002-02-26 07:18:25 +00:00
|
|
|
else if ( bPrintToEvent )
|
2010-10-22 13:00:24 +02:00
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_PRINTTOLIST, aArg );
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenDoc = true;
|
|
|
|
}
|
2002-02-26 07:18:25 +00:00
|
|
|
else if ( bForceNewEvent )
|
2010-10-22 13:00:24 +02:00
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_FORCENEWLIST, aArg );
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenDoc = true;
|
|
|
|
}
|
2002-02-26 07:18:25 +00:00
|
|
|
else if ( bForceOpenEvent )
|
2010-10-22 13:00:24 +02:00
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_FORCEOPENLIST, aArg );
|
2010-10-22 13:00:24 +02:00
|
|
|
bOpenDoc = true;
|
|
|
|
}
|
|
|
|
else if ( bDisplaySpec )
|
|
|
|
{
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_DISPLAY, aArg );
|
2010-10-22 13:00:24 +02:00
|
|
|
bDisplaySpec = false; // only one display, not a lsit
|
|
|
|
bOpenEvent = true; // set back to standard
|
2003-06-10 08:12:23 +00:00
|
|
|
}
|
2010-08-25 23:37:30 +02:00
|
|
|
else if ( bConversionEvent || bBatchPrintEvent )
|
2010-12-13 22:54:24 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_CONVERSIONLIST, aArg );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-10-22 13:00:24 +02:00
|
|
|
|
|
|
|
if ( bOpenDoc )
|
|
|
|
m_bDocumentArgs = true;
|
2007-10-26 10:55:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CommandLineArgs::AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam )
|
|
|
|
{
|
|
|
|
OSL_ASSERT( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT );
|
2011-11-03 17:45:47 +01:00
|
|
|
::rtl::OUStringBuffer aParamBuf(m_aStrParams[eParam]);
|
2011-11-03 16:50:24 +01:00
|
|
|
if ( aParamBuf.getLength() )
|
|
|
|
aParamBuf.append('\n');
|
|
|
|
aParamBuf.append(aParam);
|
|
|
|
m_aStrParams[eParam] = aParamBuf.makeStringAndClear();
|
2007-10-26 10:55:47 +00:00
|
|
|
m_aStrSetParams[eParam] = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CommandLineArgs::SetBoolParam_Impl( BoolParam eParam, sal_Bool bValue )
|
|
|
|
{
|
|
|
|
OSL_ASSERT( eParam >= 0 && eParam < CMD_BOOLPARAM_COUNT );
|
|
|
|
m_aBoolParams[eParam] = bValue;
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
|
|
|
|
2010-12-31 12:57:31 +09:00
|
|
|
sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& aArg, ::rtl::OUString& oArg )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2011-01-11 12:55:05 -05:00
|
|
|
bool bDeprecated = false;
|
2011-01-03 22:05:41 -05:00
|
|
|
if (aArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("--")))
|
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
oArg = ::rtl::OUString(aArg.getStr()+2, aArg.getLength()-2);
|
2011-01-03 22:05:41 -05:00
|
|
|
}
|
|
|
|
else if (aArg.toChar() == '-')
|
|
|
|
{
|
2012-01-09 16:43:06 +01:00
|
|
|
if ( aArg.getLength() > 2 ) // -h, -o, -n, -? are still valid
|
|
|
|
bDeprecated = true;
|
2010-12-31 12:57:31 +09:00
|
|
|
oArg = ::rtl::OUString(aArg.getStr()+1, aArg.getLength()-1);
|
2011-01-03 22:05:41 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "minimized" )) == sal_True )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2002-09-23 11:44:00 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_MINIMIZED, sal_True );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "invisible" )) == sal_True )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2002-09-23 11:44:00 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, sal_True );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "norestore" )) == sal_True )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2002-09-23 11:44:00 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NORESTORE, sal_True );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "nodefault" )) == sal_True )
|
2003-03-25 12:52:54 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NODEFAULT, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "server" )) == sal_True )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2002-09-23 11:44:00 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_SERVER, sal_True );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "headless" )) == sal_True )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2002-10-15 07:12:30 +00:00
|
|
|
// Headless means also invisibile, so set this parameter to true!
|
2002-09-23 11:44:00 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HEADLESS, sal_True );
|
2002-10-15 07:12:30 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, sal_True );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "quickstart" )) == sal_True )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2010-10-11 16:47:39 +01:00
|
|
|
#if defined(ENABLE_QUICKSTART_APPLET)
|
2002-09-23 11:44:00 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
|
2005-03-11 09:47:18 +00:00
|
|
|
#endif
|
2010-01-13 17:16:16 +01:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False );
|
|
|
|
}
|
2012-04-06 14:28:18 +02:00
|
|
|
else if ( oArg == "quickstart=no" )
|
2010-01-13 17:16:16 +01:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_True );
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_False );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "terminate_after_init" )) == sal_True )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2002-09-23 11:44:00 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_TERMINATEAFTERINIT, sal_True );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "nofirststartwizard" )) == sal_True )
|
2006-08-04 10:13:05 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NOFIRSTSTARTWIZARD, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "nologo" )) == sal_True )
|
2002-07-09 04:21:23 +00:00
|
|
|
{
|
2002-09-23 11:44:00 +00:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NOLOGO, sal_True );
|
2002-07-09 04:21:23 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "nolockcheck" )) == sal_True )
|
2002-10-24 12:15:14 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NOLOCKCHECK, sal_True );
|
2008-04-15 13:30:24 +00:00
|
|
|
// Workaround for automated testing
|
|
|
|
::svt::DocumentLockFile::AllowInteraction( sal_False );
|
2002-10-24 12:15:14 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "help" ))
|
2003-03-25 12:52:54 +00:00
|
|
|
|| aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" ))
|
|
|
|
|| aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-?" )))
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELP, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpwriter" )) == sal_True )
|
2003-06-27 08:42:22 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPWRITER, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpcalc" )) == sal_True )
|
2003-06-27 08:42:22 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPCALC, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpdraw" )) == sal_True )
|
2003-06-27 08:42:22 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPDRAW, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpimpress" )) == sal_True )
|
2003-06-27 08:42:22 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPIMPRESS, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpbase" )) == sal_True )
|
2004-08-02 13:39:15 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPBASE, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpbasic" )) == sal_True )
|
2003-06-27 08:42:22 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPBASIC, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpmath" )) == sal_True )
|
2003-06-27 08:42:22 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPMATH, sal_True );
|
|
|
|
}
|
2011-01-11 12:04:28 -05:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "version" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_VERSION, sal_True );
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("splash-pipe=")) )
|
2010-10-12 15:32:09 +01:00
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_SPLASHPIPE, oArg.copy(RTL_CONSTASCII_LENGTH("splash-pipe=")) );
|
2010-10-12 15:32:09 +01:00
|
|
|
}
|
2010-10-22 13:00:24 +02:00
|
|
|
#ifdef MACOSX
|
2008-01-14 15:26:40 +00:00
|
|
|
/* #i84053# ignore -psn on Mac
|
|
|
|
Platform dependent #ifdef here is ugly, however this is currently
|
|
|
|
the only platform dependent parameter. Should more appear
|
|
|
|
we should find a better solution
|
|
|
|
*/
|
2010-12-16 22:13:00 -08:00
|
|
|
else if ( aArg.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("-psn")) )
|
2008-01-14 15:26:40 +00:00
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_PSN, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2010-10-22 13:00:24 +02:00
|
|
|
#endif
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("infilter=")))
|
2010-08-25 23:38:54 +02:00
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_INFILTER, oArg.copy(RTL_CONSTASCII_LENGTH("infilter=")) );
|
2010-08-25 23:38:54 +02:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("accept=")))
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_ACCEPT, oArg.copy(RTL_CONSTASCII_LENGTH("accept=")) );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("unaccept=")))
|
2003-03-25 12:52:54 +00:00
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_UNACCEPT, oArg.copy(RTL_CONSTASCII_LENGTH("unaccept=")) );
|
2003-03-25 12:52:54 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("portal,")))
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_PORTAL, oArg.copy(RTL_CONSTASCII_LENGTH("portal,")) );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("userid")))
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
if ( oArg.getLength() > RTL_CONSTASCII_LENGTH("userid")+1 )
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2002-09-23 11:44:00 +00:00
|
|
|
AddStringListParam_Impl(
|
|
|
|
CMD_STRINGPARAM_USERDIR,
|
2010-12-31 12:57:31 +09:00
|
|
|
::rtl::Uri::decode( oArg.copy(RTL_CONSTASCII_LENGTH("userid")+1),
|
2002-09-23 11:44:00 +00:00
|
|
|
rtl_UriDecodeWithCharset,
|
|
|
|
RTL_TEXTENCODING_UTF8 ) );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("clientdisplay=")))
|
2001-07-20 08:37:43 +00:00
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_CLIENTDISPLAY, oArg.copy(RTL_CONSTASCII_LENGTH("clientdisplay=")) );
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("version=")))
|
2001-09-26 08:16:22 +00:00
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_VERSION, oArg.copy(RTL_CONSTASCII_LENGTH("version=")) );
|
2010-03-29 11:28:28 +02:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("language=")))
|
2010-03-29 11:28:28 +02:00
|
|
|
{
|
2010-12-31 12:57:31 +09:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_LANGUAGE, oArg.copy(RTL_CONSTASCII_LENGTH("language=")) );
|
2001-09-26 08:16:22 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "writer" )) == sal_True )
|
2002-10-24 14:39:22 +00:00
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WRITER );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_WRITER, sal_True );
|
2010-10-22 13:00:24 +02:00
|
|
|
m_bDocumentArgs = true;
|
2002-10-24 14:39:22 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "calc" )) == sal_True )
|
2002-10-24 14:39:22 +00:00
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_CALC );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_CALC, sal_True );
|
2010-10-22 13:00:24 +02:00
|
|
|
m_bDocumentArgs = true;
|
2002-10-24 14:39:22 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "draw" )) == sal_True )
|
2002-10-24 14:39:22 +00:00
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_DRAW );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_DRAW, sal_True );
|
2010-10-22 13:00:24 +02:00
|
|
|
m_bDocumentArgs = true;
|
2002-10-24 14:39:22 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "impress" )) == sal_True )
|
2002-10-24 14:39:22 +00:00
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_IMPRESS );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_IMPRESS, sal_True );
|
2010-10-22 13:00:24 +02:00
|
|
|
m_bDocumentArgs = true;
|
2002-10-24 14:39:22 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "base" )) == sal_True )
|
2004-08-02 13:39:15 +00:00
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_BASE );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_BASE, sal_True );
|
2010-10-22 13:00:24 +02:00
|
|
|
m_bDocumentArgs = true;
|
2004-08-02 13:39:15 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "global" )) == sal_True )
|
2002-10-24 14:39:22 +00:00
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_GLOBAL );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_GLOBAL, sal_True );
|
2010-10-22 13:00:24 +02:00
|
|
|
m_bDocumentArgs = true;
|
2002-10-24 14:39:22 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "math" )) == sal_True )
|
2002-10-24 14:39:22 +00:00
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_MATH );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_MATH, sal_True );
|
2010-10-22 13:00:24 +02:00
|
|
|
m_bDocumentArgs = true;
|
2002-10-24 14:39:22 +00:00
|
|
|
}
|
2010-12-31 12:57:31 +09:00
|
|
|
else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "web" )) == sal_True )
|
2002-10-24 14:39:22 +00:00
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WEB );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_WEB, sal_True );
|
2010-10-22 13:00:24 +02:00
|
|
|
m_bDocumentArgs = true;
|
2002-10-24 14:39:22 +00:00
|
|
|
}
|
2011-01-11 12:55:05 -05:00
|
|
|
else
|
|
|
|
return sal_False;
|
2002-10-24 14:39:22 +00:00
|
|
|
|
2011-01-11 12:55:05 -05:00
|
|
|
if (bDeprecated)
|
|
|
|
{
|
2012-03-06 15:49:20 +00:00
|
|
|
rtl::OString sArg(rtl::OUStringToOString(aArg, osl_getThreadTextEncoding()));
|
2011-01-26 12:49:13 +00:00
|
|
|
fprintf(stderr, "Warning: %s is deprecated. Use -%s instead.\n", sArg.getStr(), sArg.getStr());
|
2011-01-11 12:55:05 -05:00
|
|
|
}
|
|
|
|
return sal_True;
|
2002-10-24 14:39:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::CheckGroupMembers( GroupParamId nGroupId, BoolParam nExcludeMember ) const
|
|
|
|
{
|
|
|
|
// Check if at least one bool param out of a group is set. An exclude member can be provided.
|
|
|
|
for ( int i = 0; i < m_pGroupDefinitions[nGroupId].nCount; i++ )
|
|
|
|
{
|
|
|
|
BoolParam nParam = m_pGroupDefinitions[nGroupId].pGroupMembers[i];
|
|
|
|
if ( nParam != nExcludeMember && m_aBoolParams[nParam] )
|
|
|
|
return sal_True;
|
|
|
|
}
|
2001-07-20 08:37:43 +00:00
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CommandLineArgs::ResetParamValues()
|
|
|
|
{
|
2003-12-01 17:05:33 +00:00
|
|
|
int i;
|
|
|
|
for ( i = 0; i < CMD_BOOLPARAM_COUNT; i++ )
|
2002-09-23 11:44:00 +00:00
|
|
|
m_aBoolParams[i] = sal_False;
|
2002-10-15 07:12:30 +00:00
|
|
|
for ( i = 0; i < CMD_STRINGPARAM_COUNT; i++ )
|
|
|
|
m_aStrSetParams[i] = sal_False;
|
2007-10-26 10:55:47 +00:00
|
|
|
m_eArgumentCount = NONE;
|
2010-10-22 13:00:24 +02:00
|
|
|
m_bDocumentArgs = false;
|
2002-09-23 11:44:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CommandLineArgs::SetBoolParam( BoolParam eParam, sal_Bool bNewValue )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
|
|
|
|
OSL_ASSERT( ( eParam >= 0 && eParam < CMD_BOOLPARAM_COUNT ) );
|
|
|
|
m_aBoolParams[eParam] = bNewValue;
|
|
|
|
}
|
|
|
|
|
2010-10-12 15:32:09 +01:00
|
|
|
const rtl::OUString& CommandLineArgs::GetStringParam( StringParam eParam ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
|
|
|
|
OSL_ASSERT( ( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT ) );
|
|
|
|
return m_aStrParams[eParam];
|
|
|
|
}
|
|
|
|
|
2002-09-23 11:44:00 +00:00
|
|
|
sal_Bool CommandLineArgs::IsMinimized() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_MINIMIZED ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsInvisible() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_INVISIBLE ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsNoRestore() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NORESTORE ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 12:52:54 +00:00
|
|
|
sal_Bool CommandLineArgs::IsNoDefault() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NODEFAULT ];
|
|
|
|
}
|
|
|
|
|
2002-09-23 11:44:00 +00:00
|
|
|
sal_Bool CommandLineArgs::IsServer() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_SERVER ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHeadless() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HEADLESS ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsQuickstart() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_QUICKSTART ];
|
|
|
|
}
|
|
|
|
|
2010-01-13 17:16:16 +01:00
|
|
|
sal_Bool CommandLineArgs::IsNoQuickstart() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NOQUICKSTART ];
|
|
|
|
}
|
|
|
|
|
2002-09-23 11:44:00 +00:00
|
|
|
sal_Bool CommandLineArgs::IsTerminateAfterInit() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_TERMINATEAFTERINIT ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsNoLogo() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NOLOGO ];
|
|
|
|
}
|
|
|
|
|
2002-10-24 12:15:14 +00:00
|
|
|
sal_Bool CommandLineArgs::IsNoLockcheck() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NOLOCKCHECK ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 12:52:54 +00:00
|
|
|
sal_Bool CommandLineArgs::IsHelp() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELP ];
|
|
|
|
}
|
2003-06-27 08:42:22 +00:00
|
|
|
sal_Bool CommandLineArgs::IsHelpWriter() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPWRITER ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHelpCalc() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPCALC ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHelpDraw() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPDRAW ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHelpImpress() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPIMPRESS ];
|
|
|
|
}
|
2004-08-02 13:39:15 +00:00
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHelpBase() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPBASE ];
|
|
|
|
}
|
2003-06-27 08:42:22 +00:00
|
|
|
sal_Bool CommandLineArgs::IsHelpMath() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPMATH ];
|
|
|
|
}
|
|
|
|
sal_Bool CommandLineArgs::IsHelpBasic() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPBASIC ];
|
|
|
|
}
|
2003-03-25 12:52:54 +00:00
|
|
|
|
2002-10-24 14:39:22 +00:00
|
|
|
sal_Bool CommandLineArgs::IsWriter() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_WRITER ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsCalc() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_CALC ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsDraw() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_DRAW ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsImpress() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_IMPRESS ];
|
|
|
|
}
|
|
|
|
|
2004-08-02 13:39:15 +00:00
|
|
|
sal_Bool CommandLineArgs::IsBase() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_BASE ];
|
|
|
|
}
|
|
|
|
|
2002-10-24 14:39:22 +00:00
|
|
|
sal_Bool CommandLineArgs::IsGlobal() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_GLOBAL ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsMath() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_MATH ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsWeb() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_WEB ];
|
|
|
|
}
|
|
|
|
|
2011-01-11 12:04:28 -05:00
|
|
|
sal_Bool CommandLineArgs::IsVersion() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_VERSION ];
|
|
|
|
}
|
|
|
|
|
2012-03-06 15:49:20 +00:00
|
|
|
sal_Bool CommandLineArgs::HasUnknown() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_UNKNOWN ];
|
|
|
|
}
|
|
|
|
|
2002-10-24 14:39:22 +00:00
|
|
|
sal_Bool CommandLineArgs::HasModuleParam() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_COUNT );
|
|
|
|
}
|
|
|
|
|
2002-09-23 11:44:00 +00:00
|
|
|
sal_Bool CommandLineArgs::GetPortalConnectString( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_PORTAL ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_PORTAL ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetAcceptString( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_ACCEPT ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_ACCEPT ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 12:52:54 +00:00
|
|
|
sal_Bool CommandLineArgs::GetUnAcceptString( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_UNACCEPT ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_UNACCEPT ];
|
|
|
|
}
|
|
|
|
|
2002-09-23 11:44:00 +00:00
|
|
|
sal_Bool CommandLineArgs::GetOpenList( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_OPENLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_OPENLIST ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 12:52:54 +00:00
|
|
|
sal_Bool CommandLineArgs::GetViewList( ::rtl::OUString& rPara) const
|
2002-09-23 11:44:00 +00:00
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
2003-03-25 12:52:54 +00:00
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_VIEWLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_VIEWLIST ];
|
2002-09-23 11:44:00 +00:00
|
|
|
}
|
|
|
|
|
2003-05-16 13:21:09 +00:00
|
|
|
sal_Bool CommandLineArgs::GetStartList( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_STARTLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_STARTLIST ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 12:52:54 +00:00
|
|
|
sal_Bool CommandLineArgs::GetForceOpenList( ::rtl::OUString& rPara) const
|
2002-10-17 09:46:33 +00:00
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
2003-03-25 12:52:54 +00:00
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_FORCEOPENLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_FORCEOPENLIST ];
|
2002-10-17 09:46:33 +00:00
|
|
|
}
|
|
|
|
|
2002-09-23 11:44:00 +00:00
|
|
|
sal_Bool CommandLineArgs::GetForceNewList( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_FORCENEWLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_FORCENEWLIST ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetPrintList( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_PRINTLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_PRINTLIST ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetPrintToList( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_PRINTTOLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_PRINTTOLIST ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetPrinterName( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_PRINTERNAME ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_PRINTERNAME ];
|
2001-07-20 08:37:43 +00:00
|
|
|
}
|
|
|
|
|
2010-03-29 11:28:28 +02:00
|
|
|
sal_Bool CommandLineArgs::GetLanguage( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_LANGUAGE ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_LANGUAGE ];
|
|
|
|
}
|
|
|
|
|
2010-08-25 23:38:54 +02:00
|
|
|
sal_Bool CommandLineArgs::GetInFilter( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_INFILTER ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_INFILTER ];
|
|
|
|
}
|
|
|
|
|
2010-08-25 23:37:30 +02:00
|
|
|
sal_Bool CommandLineArgs::GetConversionList( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_CONVERSIONLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_CONVERSIONLIST ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetConversionParams( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_CONVERSIONPARAMS ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_CONVERSIONPARAMS ];
|
|
|
|
}
|
|
|
|
sal_Bool CommandLineArgs::GetConversionOut( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_CONVERSIONOUT ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_CONVERSIONOUT ];
|
|
|
|
}
|
|
|
|
|
2003-04-24 12:35:12 +00:00
|
|
|
sal_Bool CommandLineArgs::IsEmpty() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
2007-10-26 10:55:47 +00:00
|
|
|
return m_eArgumentCount == NONE;
|
2003-04-24 12:35:12 +00:00
|
|
|
}
|
|
|
|
|
2010-10-22 13:00:24 +02:00
|
|
|
sal_Bool CommandLineArgs::WantsToLoadDocument() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_bDocumentArgs;
|
|
|
|
}
|
|
|
|
|
2001-07-16 11:55:47 +00:00
|
|
|
} // namespace desktop
|
2010-10-12 15:53:47 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|