To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=97907
                 Issue #|97907
                 Summary|DOCX : XComponentLoader . loadComponentFromURL ("priva
                        |te:stream" , ...) throws IllegalArgumentException: URL
                        | seems to be an unsupported one.
               Component|Word processor
                 Version|OOO300m9
                Platform|Unknown
                     URL|
              OS/Version|All
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|open-import
             Assigned to|writerneedsconfirm
             Reported by|albert617





------- Additional comments from albert...@openoffice.org Fri Jan  9 18:33:24 
+0000 2009 -------
It seems when loading a DOCX file from an XInputStream, it fails to load
properly.  So the following will fail:

XComponentContext xContext = Bootstrap.bootstrap();
XMultiComponentFactory xServiceManager = xContext.getServiceManager();
Object desktop =
xServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", 
xContext);
XComponentLoader xComponentLoader =
(XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, desktop);
XSimpleFileAccess xSimpleFileAccess =
(XSimpleFileAccess)UnoRuntime.queryInterface(XSimpleFileAccess.class,
xServiceManager.createInstanceWithContext("com.sun.star.ucb.SimpleFileAccess",
xContext));
XInputStream xInputStream = 
xSimpleFileAccess.openFileRead("file:///c:/test.docx");
PropertyValue[] loadProps = new PropertyValue[2];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "InputStream";
loadProps[0].Value = xInputStream;
loadProps[1] = new PropertyValue();
loadProps[1].Name = "FilterName";
loadProps[1].Value = "Microsoft Word 2007 XML";
XComponent xComponent = xComponentLoader.loadComponentFromURL("private:stream",
"_blank", 0, loadProps);


But the following will succeed:
XComponentContext xContext = Bootstrap.bootstrap();
XMultiComponentFactory xServiceManager = xContext.getServiceManager();
Object desktop =
xServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", 
xContext);
XComponentLoader xComponentLoader =
(XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, desktop);
XSimpleFileAccess xSimpleFileAccess =
(XSimpleFileAccess)UnoRuntime.queryInterface(XSimpleFileAccess.class,
xServiceManager.createInstanceWithContext("com.sun.star.ucb.SimpleFileAccess",
xContext));
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "FilterName";
loadProps[0].Value = "Microsoft Word 2007 XML";
XComponent xComponent =
xComponentLoader.loadComponentFromURL("file:///c:/test.docx", "_blank", 0,
loadProps);

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@sw.openoffice.org
For additional commands, e-mail: issues-h...@sw.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to