Peter Zhang Newbie

Joined: 20 Apr 2006 Posts: 4
|
Posted: Thu Apr 20, 2006 12:02 pm Post subject: Migrating 1.1.4 to 2.0.2: deprecated OfficeConnection etc. |
|
|
We used Open Office APIs to embed Open Office in a framed window. Three classes,
OfficeConnection, OfficeWindow and LocalOfficeConnection, are deprecated in 2.0.2.
Our code was tested again APIs of 1.1.4, and is no longer working with 2.0.2.
The possible problems are:
1) We did not call the APIs correctly in our code. When the bugs in Open Office
are fixed, our own bugs are exposed.
Or
2) 2.0.2 APIs are no longer backward compatible. I have noticed that two processes
soffice.exe and soffice.bin are created in 2.0.2, whereas only one soffice.exe was
created in 1.1.4.
I would greatly appreciate it if you could tell me how to replace the deprecated
classes in 1.1.4 with new classes in 2.0.2 if that is the solution, or where our
calls could be wrong based on your guess or experience.
Attached is a code segment.
...
Object object = mServiceFactory.createInstance("com.sun.star.frame.Frame");
XFrame mFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, object);
String type = "writer_StarOffice_XML_Writer";
object = mFrameLoaderFactory.createInstance(type);
XSynchronousFrameLoader frameLoader
= (XSynchronousFrameLoader) UnoRuntime.queryInterface(
XSynchronousFrameLoader.class, object);
PropertyValue[] desc = new PropertyValue[2];
desc[ 0 ] = new PropertyValue("FileName", 0, "C:/test.sxw",
PropertyState.DIRECT_VALUE );
desc[ 1 ] = new PropertyValue("TypeName", 0, type,
PropertyState.DIRECT_VALUE );
frameLoader.load(desc, mFrame); // This call is now hanging.
Peter Zhang |
|