1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
33 #include <osl/process.h>
34 #include "odma_provider.hxx"
37 #define SOFFICE "soffice.exe"
39 #define SOFFICE "soffice"
42 /** our main program to convert ODMAIDs to ODMA URLs
46 void main( int argc
, char * argv
[] )
49 int _cdecl
main( int argc
, char * argv
[] )
51 void _cdecl
main( int argc
, char * argv
[] )
55 static ::rtl::OUString
sProcess(RTL_CONSTASCII_USTRINGPARAM(SOFFICE
));
58 ::rtl::OUString
* pArguments
= new ::rtl::OUString
[argc
-1];
59 for(int i
= 0; i
< argc
-1; ++i
)
61 pArguments
[i
] = ::rtl::OUString::createFromAscii(argv
[i
+1]);
62 if( pArguments
[i
].matchIgnoreAsciiCaseAsciiL(
63 RTL_CONSTASCII_STRINGPARAM(ODMA_URL_ODMAID
)))
65 ::rtl::OUString sArgument
67 RTL_CONSTASCII_USTRINGPARAM(
68 ODMA_URL_SCHEME ODMA_URL_SHORT
"/"));
69 sArgument
+= pArguments
[i
];
70 pArguments
[i
] = sArgument
;
74 rtl_uString
** ustrArgumentList
= new rtl_uString
* [argc
-1];
75 for (int i
= 0; i
< argc
-1; i
++)
76 ustrArgumentList
[i
] = pArguments
[i
].pData
;
80 if ( osl_Process_E_None
== osl_executeProcess(
91 osl_freeProcessHandle( aProcess
);
93 delete [] ustrArgumentList
;
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */