Hello,
I would like some feedback by anyone using or knowledgeable in the LCL clipboard design on the changes introduced by this (already committed) patch:
http://bugs.freepascal.org/view.php?id=20089
-Fl?vio

Mailing lists / lazarus / 2011-10
5 messages · 2 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hello,
I would like some feedback by anyone using or knowledgeable in the LCL clipboard design on the changes introduced by this (already committed) patch:
http://bugs.freepascal.org/view.php?id=20089
-Fl?vio
What's the problem?
Mattias
I made TWin32WidgetSet.ClipboardFormatToMimeType raise an exception when Windows.GetClipboardFormatName returns empty (either a Windows predefined format or an error). At the last it will be triggered by code that uses TClipboard.FindFormatID (or iterate over available formats names in the clipboard) if there's a predefined format in the clipboard the LCL doesn't know about. Is that ok?
I didn't see any other issues, but the LCL uses MIME strings more extensively than initially thought, so I'm asking for advice.
-Fl?vio
Raising an exception in an LCL interface function is unusual. What do you mean with "a predefined format in the clipboard the LCL doesn't know about"?
Mattias
Is this why assigning icons to the clipboard doesn't raise exceptions even though it's not implemented? ;-)
If it's not reaised there, I think it should be raised in some other places anyway - in TRasterImage.LoadFromMimeStream for instance.
GetClipboardFormatName(1) doesn't return a string for "standard formats" (2) - sometimes called predefined formats in the docs -, so the LCL itself (i.e. TWin32WidgetSet.ClipboardFormatToMimeType) must "know" their MIME types.
(1) http://msdn.microsoft.com/en-us/library/windows/desktop/ms649040%28v=vs.85%29.aspx (2) http://msdn.microsoft.com/en-us/library/windows/desktop/ff729168%28v=vs.85%29.aspx
There're some other info and comments in the bug report.
-Fl?vio