https://issues.apache.org/ooo/show_bug.cgi?id=121665

--- Comment #8 from Ariel Constenla-Haile <[email protected]> ---
(In reply to comment #7)
> You say you don't understand my (rather simple) program. The line which
> gives an error is clearly marked.

May be I wasn't clear while expressing myself (I'm no native English speaker).
You example isn't clear to me, as an example of the Description of the bug
(it's using storeAsURL in the wrong way).


> The line giving the error is Doc.StoreAsURL(FileURL,EmptyArray). Because the
> array is empty, the file should not be overwritten, as the default is FALSE.
> The next line fails to store (as I'd expect) because the file's already
> there.

But all this is because you are mixing store() with storeAsURL(). You're
program logic should be:

Dim oDoc as Object
oDoc = ...
If oDoc.hasLocation() Then
   oDoc.store()
Else
   oDoc.storeAsURL(sURL, aMediaDescriptor)
End If

> At the end of your explanation you say  that StoreAsURLto the original URL
> is the same as Store(). This may well be true, but it's not in the XStorable
> definition, which is what I was going on. 

It isn't explained explicitly, but it can be deduced by reading all the other
methods:

- use store() if the document has a location
- use storeAsURL() if the document has no location

> It's also not the same as the
> behaviour of OOWriter using the "Save As" menu item. Try opening a document,
> clicking "Save As", and choosing the original file name. It (quite rightly
> in my view) fails. So in this case "SAVE AS" to the original file is NOT the
> same a "Save", which (equally rightly) overwrites.

In the GUI things are different: the error box telling that the file already
exists is not triggered by an exception caused by storeAsURL(), but by the way
the Save dialog is implemented internally (if the document has a location, and
there is a file with the same location, it shows an error box, it does not even
try to save it).


> So, in my view, it's either a documentation bug or a bug in StoreAsURL.

In the case of the abstract interface description, this could be an
enhancement.

> Matters aren't helped by
> http://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/
> Handling_Documents which says under "Overwrite": "boolean. For storing only:
> overwrite existing files with the same name, default is true

In this case, this is an error, the default behavior is false: files are *not*
overwritten by default. This documentation should be corrected.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

Reply via email to