Bugs: Browse | Submit New | Admin

[#23559] DataObjects with more than one format only receive preferred data from clipboard

Date:
2009-01-14 22:53
Priority:
2
Submitted By:
Alex Fenton (brokentoy)
Assigned To:
Alex Fenton (brokentoy)
Category:
Incorrect behavior
State:
Open
Summary:
DataObjects with more than one format only receive preferred data from clipboard

Detailed description
When using eg DataObjectComposite or a custom DataObject class with multiple formats, only the preferred format is populated
from the Clipboard.

Documented in tests/test_clipboard.rb.

Not a 2.0 blocker I think as it can be worked around by using DataObjectSimple to receive desired format. And it's pretty
esoteric functionality.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-05-18 12:16
Sender: Muriel Salvan

Hi Alex

Thanks for your answer. I gave it a new try, and found out that
using a custom data object (inheriting DataObjectSimple) in a
DataObjectComposite object did not place the custom data in the
clipboard.

When used with standard data objects (Text, Bitmap...) it works
as you just say: DataObjectComposite correctly places data in
the clipboard, but can't retrieve non preferred format.

I found a workaroud to place several custom data formats, by
simply inheriting the DataObject itself, and implementing the
few needed methods. Works like a charm to place data: replace
DataObjectComposite and DataObjectSimple with a simple
DataObject.

Thanks a lot for your help, and congrats' for this wonderful
lib !

Best regards,

Muriel
Date: 2009-05-12 20:17
Sender: Alex Fenton

Hi Muriel

I believe it works fine for placing data on the clipboard - so
your custom data format is available to your app, but is also
available as text to other applications.

For fetching, I think the approach is to test is_supported? to
see whether the more advanced foramt is available, then fetch
it with an appropriate one-type data object. A bit clumsy but
should work.

Alex
Date: 2009-05-07 14:43
Sender: Muriel Salvan

Hi

I don't really understand the workaround.
DataObjectSimple supports only 1 format. I did not manage to
get it answer several formats.

This functionality is somewhat useful when your home made format
represents a text with additional metadata (kind of formatted
text). The metadata is only useful to your app, but the text
could be used in any application reading simple text from the
clipboard. In this case I don't see how I can work around this
missing behaviour.

Maybe I am missing something ?

Best regards

Muriel

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item