Martin Gallwey wrote: >>Could be seen as a bug. Some API calls in the model set the flag. >>Because we know this ;-) usually we clear the modified flag after >>successful loading. Need to check why it doesn't work here. >> >> > If I save the document it (obviously) gets rid of the modified flag, and > I am then able to reload once. If I reload a second time, it comes in > read-only. If I use a macro to get rid of the modified flag and then > reload it comes in read-only.
The saving process closes the stream that you still keep alive (see below), the read-only problem IMHO is not related to the modified flag. >>You could have become a victim of the garbage collection. >>You have got a reference to a stream in the MediaDescriptor. As long as >>this reference is kept you can't open the document in read/write mode. >>In a C++ based filter the reference is cleared automatically when the >>filter service is released, but the Java garbage collection has its own >>will so it might be possible that while you reload the file the >>So please clear the reference explicitly after successful loading and >>report back if this makes any difference. > > Yeah, that was my theory as well, but I can't definitely be sure that > the proxy object is being deleted which would result in the ref count of > the XInputStream decrementing, due to the asynchronous nature of Java's > garbage collection. I've tried getting medieval on it with code like this: > > xInputStream = null; > aDescriptor[nInputStreamIndex] = null; > aDescriptor = null; > System.gc(); > System.runFinalization(); > > But it doesn't help! Sorry, I was wrong, of course you can't get rid of the proxy, but closing the stream should help. Try a xInputStream.closeInput() after you finished loading. If it works I have to discuss with my colleagues if this might have any side effects. :-) Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]