Bugzilla – Attachment 104835 Details for
Bug 82743
insertDocumentFromURL no longer works
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
working code
TestInsertable.java (text/plain), 1.45 KB, created by
Maxim Monastirsky
on 2014-08-18 16:07:35 UTC
(
hide
)
Description:
working code
Filename:
MIME Type:
Creator:
Maxim Monastirsky
Created:
2014-08-18 16:07:35 UTC
Size:
1.45 KB
patch
obsolete
>import com.sun.star.beans.PropertyValue; >import com.sun.star.comp.helper.Bootstrap; >import com.sun.star.document.XDocumentInsertable; >import com.sun.star.frame.XComponentLoader; >import com.sun.star.lang.XComponent; >import com.sun.star.lang.XMultiComponentFactory; >import com.sun.star.text.XTextDocument; >import com.sun.star.text.XTextCursor; >import com.sun.star.uno.UnoRuntime; >import com.sun.star.uno.XComponentContext; > >public class TestInsertable { > > public static void main(String[] args) { > try { > XComponentContext xContext = Bootstrap.bootstrap(); > XMultiComponentFactory xMCF = xContext.getServiceManager(); > Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext); > XComponentLoader xCLoader = UnoRuntime.queryInterface(XComponentLoader.class, oDesktop); > > XComponent xComp = xCLoader.loadComponentFromURL("file:///home/maxim/Downloads/main.odt", "_blank", 0, new PropertyValue[0]); > > XTextDocument xDoc = UnoRuntime.queryInterface(XTextDocument.class, xComp); > XTextCursor xTCursor = xDoc.getText().createTextCursor(); > XDocumentInsertable xDocumentInsertable = UnoRuntime.queryInterface(XDocumentInsertable.class, xTCursor); > xDocumentInsertable.insertDocumentFromURL("file:///home/maxim/Downloads/sub.odt", new PropertyValue[0]); > } > catch(Exception e) { > e.printStackTrace(System.err); > } > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 82743
:
104832
|
104833
| 104835