#88981# transfer proper command args to XMain

This commit is contained in:
Daniel Boelzle
2001-06-29 07:59:01 +00:00
parent 40e46b3875
commit 824d65702a

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: unoexe.cxx,v $ * $RCSfile: unoexe.cxx,v $
* *
* $Revision: 1.12 $ * $Revision: 1.13 $
* *
* last change: $Author: kr $ $Date: 2001-05-28 15:31:06 $ * last change: $Author: dbo $ $Date: 2001-06-29 08:59:01 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -153,7 +153,7 @@ static sal_Bool readOption( OUString * pValue, const sal_Char * pOpt,
++(*pnIndex); ++(*pnIndex);
rtl_getAppCommandArg(*pnIndex, &pValue->pData); rtl_getAppCommandArg(*pnIndex, &pValue->pData);
if (*pnIndex >= rtl_getAppCommandArgCount() || pValue->copy(1).equals(dash)) if (*pnIndex >= (sal_Int32)rtl_getAppCommandArgCount() || pValue->copy(1).equals(dash))
{ {
OUStringBuffer buf( 32 ); OUStringBuffer buf( 32 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("incomplete option \"-") ); buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("incomplete option \"-") );
@@ -597,8 +597,9 @@ extern "C" int SAL_CALL main( int argc, const char * argv[] )
OUString aReadWriteRegistry; OUString aReadWriteRegistry;
sal_Int32 nPos = 0; sal_Int32 nPos = 0;
sal_Int32 nCount = (sal_Int32)rtl_getAppCommandArgCount();
// read up to arguments // read up to arguments
while (nPos < rtl_getAppCommandArgCount()) while (nPos < nCount)
{ {
OUString arg; OUString arg;
@@ -668,13 +669,13 @@ extern "C" int SAL_CALL main( int argc, const char * argv[] )
out( "\n> warning: service name given, will ignore location!" ); out( "\n> warning: service name given, will ignore location!" );
// read component params // read component params
aParams.realloc( argc - nPos ); aParams.realloc( nCount - nPos );
OUString * pParams = aParams.getArray(); OUString * pParams = aParams.getArray();
sal_Int32 nOffset = nPos; sal_Int32 nOffset = nPos;
for ( ; nPos < argc; ++nPos ) for ( ; nPos < nCount; ++nPos )
{ {
pParams[nPos -nOffset] = OUString::createFromAscii( argv[nPos] ); OSL_VERIFY( rtl_getAppCommandArg( nPos, &pParams[nPos -nOffset].pData ) == osl_Process_E_None );
} }
//#### create registry ##################################################################### //#### create registry #####################################################################
@@ -812,11 +813,6 @@ extern "C" int SAL_CALL main( int argc, const char * argv[] )
if (xComp.is()) if (xComp.is())
xComp->dispose(); xComp->dispose();
if (xRegistry.is())
{
xRegistry->close();
}
out( "\n" ); out( "\n" );
return nRet; return nRet;
} }