Issue 48689 - The Opendocument macro in the tools library does not work properly
Summary: The Opendocument macro in the tools library does not work properly
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P4 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2005-05-04 11:10 UTC by faltrion
Modified: 2017-05-20 11:27 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description faltrion 2005-05-04 11:10:54 UTC
The Opendocument macro in the tools library does not work properly, the problem
I had was that I was trying to open a document using this macro function and
nothing happened. when I used the debugging of the macro (added an breakpoint)
it was however working properly. this was strange, however I think I have found
the culprit.
--- from the script ---
...
	If Not IsMissing(bDisposable) Then
		bDisposable = True
	End If
	OpenDocument() = StarDesktop.LoadComponentFromURL(DocPath,"_default",0,Args())
End Function
--- end ---
The problem is that StarDesktop.LoadComponentFromURL is using a deprecated value
for the searchflags (0) it looks liek the flag should be set to
com.sun.star.frame.FrameSearchFlag.ALL+com.sun.star.frame.FrameSearchFlag.CREATE
instead of the 0 (com.sun.star.frame.FrameSearchFlag.AUTO) that it is using now.
Comment 1 stephan.wunderlich 2005-05-04 12:45:26 UTC
opendocument works properly for me ... which arguments did you pass as it failed
in your case ? I used ...

	opendocument("private:factory/sdraw",dimarray(),false)
	opendocument("private:factory/swriter",dimarray(),false)
Comment 2 faltrion 2005-05-04 15:32:01 UTC
the url i used was for an existing document and not a new document that you used
below, so the url was of type  "file:///home/user/testdocument.odt"
it might have mattered also that i had abasic dialog opened at the same time
(the code to load the document was triggered from the basic dialog)
Comment 3 faltrion 2005-05-04 16:03:33 UTC
I've tried to create a test document here now for this, but i cannot reproduce
it with the test document, however in my sollution that I did get the error I
can reproduce it.

my setup is as follows.
I have created my own extensions that add a menu to openoffice, clicking on one
of these menu-entries I open up a dialog, when clicking on a button in this
dialog an document is to be opened, this fails for me (I'm using OpenDocuemnt)
using the StarDesktop.LoadComponentFromURL(DocPath,"_default",0,Args()) manually
instead of calling Opendocument it still fails unless I change "_default" to
"_blank" OR add the FrameSearchFlag.ALL+FrameSearchFlag.CREATE instead of the 0..
Comment 4 stephan.wunderlich 2005-05-11 09:27:24 UTC
sw->bc: changing the SearchFlag to something not deprecated seems to be a good
idea anyway.
Comment 5 christianjunker 2005-07-20 17:14:18 UTC
accepted. started.
Comment 6 berend.cornelius 2006-01-09 12:53:27 UTC
bc->ih: Basic macros are yours now
Comment 7 nospam 2006-03-29 10:29:57 UTC
IH->faltrion: please tell me in detail what I have to change in the tools
library, thanks.
Comment 8 faltrion 2006-10-18 12:04:17 UTC
you should probably change it from 0 to
com.sun.star.frame.FrameSearchFlag.ALL+com.sun.star.frame.FrameSearchFlag.CREATE

Comment 9 Marcus 2017-05-20 11:27:40 UTC
Reset assigne to the default "issues@openoffice.apache.org".