Wei Min Teo wrote:

> Thanks. However, won't setting -norestore cause openoffice not to 
> automatically start up after the crash?

Yes, that's a side effect of this. But for automation purposes I don't
see a problem here as you must re-connect anyway.

Another side effect is that autosave of documents is disable for this
session (it doesn't make sense to store recovery information that is not
used afterwards).

> Can I pass this parameter in programatically instead of running via 
> commandline? I am presently using just the simple bootstrap function for c++. 

No. You can do it differently:

create the service "com.sun.star.frame.AutoRecovery"

It has an interface XDispatchProvider and you can dispatch the command
"vnd.sun.star.autorecovery:/disableRecovery" to it. Here's some C++ code
for it:

>         try
>         {
>             css::uno::Reference< css::frame::XDispatch > xRecovery(
>                     myServiceFactory->createInstance( 
> OUSTRING(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.AutoRecovery")) ),
>                     css::uno::UNO_QUERY_THROW );
> 
>             css::uno::Reference< css::util::XURLTransformer > xParser(
>                     myFactory->createInstance( 
> OUSTRING(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ),
>                     css::uno::UNO_QUERY_THROW );
> 
>             css::util::URL aCmd;
>             aCmd.Complete = 
> ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/disableRecovery");
>             xParser->parseStrict(aCmd);
> 
>             xRecovery->dispatch(aCmd, css::uno::Sequence< 
> css::beans::PropertyValue >());
>         }
>         catch(const css::uno::Exception& e)
>         {
>         }

myServiceFactory is the factory you can get from the ComponentFactory
you have bootstrapped. Of course you can also use the ComponentFactory
directly, but I didn't find the syntax for its createComponent method in
my brain. ;-)

HTH,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[email protected]".
I use it for the OOo lists and only rarely read other mails sent to it.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to