Issue 94515

Summary: XTransferable.getTransferDataFlavors() of writer documents lists unsupported DataFlavors
Product: App Dev Reporter: clutz <chrlutz>
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, nesshof
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description clutz 2008-10-01 08:03:30 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 + ") " +
    try {

      buffy = (byte[]) transferable.getTransferData(fl);

    } catch (Exception e) {

The output of the snippet is:

Windows MetaFile (application/x-openoffice-wmf;windows_formatname="Image WMF")
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] 
	at $Proxy17.getTransferData(Unknown Source)
	at TransferableText.main(
Bitmap (application/x-openoffice-bitmap;windows_formatname="Bitmap") Type[[]byte]
PNG (image/png) Type[[]byte]
Comment 1 jsc 2008-10-01 08:58:49 UTC
seems to be a writer issue or maybe related to the framework.  
Comment 2 thomas.lange 2010-07-02 07:32:47 UTC
Comment 3 thomas.lange 2010-08-20 11:48:42 UTC
tl->cd: SwXTextDocument inherits the XTransferable interface from SfxBaseModel,
thus please take over. Thanks!