Hacker News new | ask | show | jobs
by johannes1234321 1330 days ago
You snapshot the data in your application's native data format, then you can convert it later to the best match for the consumer.

Taking the Excel example form above: You got to store the cell layout and values. If it's pasted into a different excel sheet you pass that structure over. If it is pasted in a richt text editor it is converted to some richt text table format. If it is pasted to a plain text editor it is made tab separated or something and if pasted into an image editor it is renders into a bmp (well, Excel doesn't do that, but imagine ...) Doing all those conversions beforehand, just due to pressing Ctrl-C, is expensive as most of the time none is needed.

2 comments

The Excel clipboard has a more complex model:

- If the copied data is pasted in the same Excel instance, then the system clipboard isn’t used at all and native Excel objects are pasted.

- If data is pasted in an OLE-enabled application (e.g. Word or PowerPoint), then an OLE-specific method is used.

- If the data is pasted into another Excel instance or into another application, then the system clipboard is used, but without the possibility to transfer native Excel objects, only csv, RTF, html, text, image, or an ancient spreadsheet-like format called SYLK.

And at any time during this process you can easily and readily lose the copy from Excel.

God its so annoying to tab back to the sheet to hit Ctrl-C again.

True, but doing it "right" (especially considering 1990ies hardware) isn't easy. And Windows has the option, to just pass it to the system, if you don't have complex needs (only copying plain text etc.)