giaco777 General User

Joined: 28 Feb 2005 Posts: 16
|
Posted: Wed Jun 07, 2006 3:58 am Post subject: loadComponentFromURL working different in 2.0er versions |
|
|
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 |
|