OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

loadComponentFromURL working different in 2.0er versions

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
giaco777
General User
General User


Joined: 28 Feb 2005
Posts: 16

PostPosted: Wed Jun 07, 2006 3:58 am    Post subject: loadComponentFromURL working different in 2.0er versions Reply with quote

Hi there,

I want to load a file into an existing frame which name I know. This worked fine in the 1.1 to 1.9.125 versions of OOO. Now I wanted to migrate to OpenOffice 2.0.2 and the same code does not work any more. A call to loadComponentFromURL opens a new window every time.

This is my piece of code for the purpose (python):


Code:


import uno
from com.sun.star.frame.FrameSearchFlag import ALL, CREATE

url = "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"

ctxLocal = uno.getComponentContext()
smgrLocal = ctxLocal.ServiceManager

resolver = smgrLocal.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", ctxLocal )
ctx = resolver.resolve( url )
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop", ctx )

desktop.loadComponentFromURL( "private:factory/swriter", "frame", CREATE, () )
desktop.loadComponentFromURL( "private:factory/swriter", "frame", ALL, () )
desktop.loadComponentFromURL( "private:factory/swriter", "frame", ALL, () )



When running with OOo V1.9.125 or earlier this results in one writer window. When running in OOo 2.0.2 I get 3 windows.

Perhaps somebody can give me some advice?


Regards
Giaco777
Back to top
View user's profile Send private message
giaco777
General User
General User


Joined: 28 Feb 2005
Posts: 16

PostPosted: Fri Jun 09, 2006 5:26 am    Post subject: Reply with quote

Meanwhile I have found a work around for OOo 2.0.2:

if I do a

desktop.findName("frame", CREATE)

before the loadComponentFromURL sequence everything works fine ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group