Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


On 28/03/14 11:39, Cley Faye wrote:
2014-03-27 23:52 GMT+01:00 rmg <permail@dick.georgeson.me.uk>:

​​
if HasUnoInterfaces(doc, "com.sun.star.util.Xcloseable")
     doc.close(TRUE)
else
     doc.dispose()
End if

  as I said lifted straight from the macro examples; the Libreoffice API
reference seems to say that's right.


​I'm not very fluent in LO API, but according to the documentation (
http://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1util_1_1XCloseable.html)​
XCloseable.close() must be called before XComponent.dispose(), so maybe you
can try this:


​
if HasUnoInterfaces(doc, "com.sun.star.util.XCloseable")
     doc.close(TRUE)
End if
doc.dispose()
Had a fiddle with that. doc.close and doc.dispose are alternatives, calling doc.dispose after doc.close gives an error.

To reduce the possible unknowns I simplified the [Goodbye] routine to do just

   doc=thiscomponent
   doc.close(TRUE)
end sub

without testing for hasunointerfaces - because we know this one has. Still gives '...../soffice not responding'.

Which I think definitely ties the problem to the doc.close(). I'm being forced to the conclusion it's a 'feature' and you get to live with it.
​Also note that it's XCloseable with a capital C. I don't know however if
it's case-sensitive (the doc seems to say it's not) but it wouldn't hurt to
check this too :)​​

Yes, the book also says it's not case sensitive and I have to admit I've played fast and loose with case elsewhere without ill effect. And anyway the minimalist Goodbye without that still gives the problem.

--
Dick Georgeson


--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.