Apache OpenOffice (AOO) Bugzilla – Issue 94515
XTransferable.getTransferDataFlavors() of writer documents lists unsupported DataFlavors
Last modified: 2013-02-24 21:08:33 UTC
I have got a small codesnippet that tries to call XTransferable.getTransferData(flavor) for all flavors listed in XTransferable.getTransferDataFlavors() for a TextDocument. The DataFlavor "Star Embed Source (XML)" is listed in the list of supported DataFlavors for this Component, but trying to get the respective transfer data throws an UnsupportedFlavorException. So please either remove "Star Embed Source (XML)" from the list of supported DataFlavors or enable this functionality that the exception is not thrown. To reproduce, I used the following snippet: byte[] buffy; XTransferable transferable = (XTransferable) UnoRuntime.queryInterface(XTransferable.class, UNO.desktop.getCurrentComponent()); DataFlavor[] flavors = transferable.getTransferDataFlavors(); for (DataFlavor fl : flavors) { System.out.println(fl.HumanPresentableName + " (" + fl.MimeType + ") " + fl.DataType); try { buffy = (byte[]) transferable.getTransferData(fl); } catch (Exception e) { e.printStackTrace(); } } The output of the snippet is: Windows MetaFile (application/x-openoffice-wmf;windows_formatname="Image WMF") Type[[]byte] Star Object Descriptor (XML) (application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)") Type[[]byte] Star Embed Source (XML) (application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source (XML)") Type[[]byte] com.sun.star.datatransfer.UnsupportedFlavorException: at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:187) at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:153) at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:349) at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:318) at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:106) at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:657) at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:159) at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:141) at $Proxy17.getTransferData(Unknown Source) at TransferableText.main(TransferableText.java:32) Bitmap (application/x-openoffice-bitmap;windows_formatname="Bitmap") Type[[]byte] PNG (image/png) Type[[]byte]
seems to be a writer issue or maybe related to the framework.
.
tl->cd: SwXTextDocument inherits the XTransferable interface from SfxBaseModel, thus please take over. Thanks!