Kaydet (Commit) eb00a332 authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS startcenterfix02 (1.35.30); FILE MERGED

2008/04/11 15:28:49 pl 1.35.30.2: #i87649# better solution: filter all env commands by using specialize rtl command line API
2008/04/10 17:40:52 pl 1.35.30.1: #i87649# new command line parameter to ignore
üst f6e2aa09
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite * OpenOffice.org - a multi-platform office productivity suite
* *
* $RCSfile: cmdlineargs.cxx,v $ * $RCSfile: cmdlineargs.cxx,v $
* $Revision: 1.37 $ * $Revision: 1.38 $
* *
* This file is part of OpenOffice.org. * This file is part of OpenOffice.org.
* *
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <rtl/uri.hxx> #include <rtl/uri.hxx>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include "rtl/process.h"
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp> #include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
...@@ -53,8 +54,8 @@ namespace { ...@@ -53,8 +54,8 @@ namespace {
class ExtCommandLineSupplier: public CommandLineArgs::Supplier { class ExtCommandLineSupplier: public CommandLineArgs::Supplier {
public: public:
explicit ExtCommandLineSupplier(vos::OExtCommandLine & commandLine): explicit ExtCommandLineSupplier():
m_commandLine(commandLine), m_count(commandLine.getCommandArgCount()), m_count(rtl_getAppCommandArgCount()),
m_index(0) {} m_index(0) {}
virtual ~ExtCommandLineSupplier() {} virtual ~ExtCommandLineSupplier() {}
...@@ -62,7 +63,7 @@ public: ...@@ -62,7 +63,7 @@ public:
virtual bool next(rtl::OUString * argument) { virtual bool next(rtl::OUString * argument) {
OSL_ASSERT(argument != NULL); OSL_ASSERT(argument != NULL);
if (m_index < m_count) { if (m_index < m_count) {
if (!m_commandLine.getCommandArg(m_index++, *argument)) { if (!rtl_getAppCommandArg(m_index++, &argument->pData )) {
OSL_ASSERT(false); OSL_ASSERT(false);
} }
return true; return true;
...@@ -72,7 +73,6 @@ public: ...@@ -72,7 +73,6 @@ public:
} }
private: private:
vos::OExtCommandLine & m_commandLine;
sal_uInt32 m_count; sal_uInt32 m_count;
sal_uInt32 m_index; sal_uInt32 m_index;
}; };
...@@ -114,11 +114,11 @@ CommandLineArgs::CommandLineArgs() ...@@ -114,11 +114,11 @@ CommandLineArgs::CommandLineArgs()
} }
// intialize class with command line parameters from process environment // intialize class with command line parameters from process environment
CommandLineArgs::CommandLineArgs( ::vos::OExtCommandLine& aExtCmdLine ) CommandLineArgs::CommandLineArgs( bool bConvert )
{ {
ResetParamValues(); ResetParamValues();
ExtCommandLineSupplier s( aExtCmdLine ); ExtCommandLineSupplier s;
ParseCommandLine_Impl( s, true ); ParseCommandLine_Impl( s, bConvert );
} }
CommandLineArgs::CommandLineArgs( Supplier& supplier ) CommandLineArgs::CommandLineArgs( Supplier& supplier )
...@@ -160,6 +160,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier, bool convert ) ...@@ -160,6 +160,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier, bool convert )
{ {
break; break;
} }
if ( convert ) if ( convert )
{ {
// convert file URLs to internal form #112849# // convert file URLs to internal form #112849#
...@@ -924,7 +925,7 @@ sal_Bool CommandLineArgs::IsEmptyOrAcceptOnly() const ...@@ -924,7 +925,7 @@ sal_Bool CommandLineArgs::IsEmptyOrAcceptOnly() const
return m_eArgumentCount == NONE || return m_eArgumentCount == NONE ||
( ( m_eArgumentCount == ONE ) && ( m_aStrParams[ CMD_STRINGPARAM_ACCEPT ].getLength() )) || ( ( m_eArgumentCount == ONE ) && ( m_aStrParams[ CMD_STRINGPARAM_ACCEPT ].getLength() )) ||
( ( m_eArgumentCount == ONE ) && ( m_aBoolParams[ CMD_BOOLPARAM_PSN ] )); ( ( m_eArgumentCount == ONE ) && m_aBoolParams[ CMD_BOOLPARAM_PSN ] );
} }
} // namespace desktop } // namespace desktop
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