Not too long ago, a change landed, that brought Biff12 clipboard format support in Calc v.26.2 – thanks Laurent!
It was an easyhack that I authored some time ago; and Laurent volunteered to implement that long-standing missing feature. The small detail was, that the feature was Windows-specific (it is trivial to get the wanted clipboard content there, simply copying from Excel), while Laurent developed on another platform.
Laurent had made the majority of work, before he was stuck, without being able to test / debug further changes. Then, he asked me, if there a way to continue on the platform he used.
At that time, I answered, that no, one would need Windows (and Excel) to continue the implementation. So I jumped in, and added the rest, and in the end, we have created the change in co-authorship.
But later, when part of my code turned out problematic, and I needed to fix it and create a unit test for it, I discovered a trick, that could put Biff12 data into system clipboard on any platform, without Excel – allowing then just paste, and debug everything that’s going on there. It relies on UNO API, and can be implemented e.g. in Basic:
function XTransferable_getTransferData(aFlavor as com.sun.star.datatransfer.DataFlavor) as variant
if (not XTransferable_isDataFlavorSupported(aFlavor)) then exit function
oUcb = CreateUnoService("com.sun.star.ucb.SimpleFileAccess")
oFile = oUcb.openFileRead(ConvertToURL("/path/to/biff12.clipboard.xlsb"))
dim sequence() as byte
oFile.readBytes(sequence, oFile.available()) ' changes value type of 'sequence' to integer
XTransferable_getTransferData = CreateUnoValue("[]byte", sequence)
end function
function XTransferable_getTransferDataFlavors() as variant
aFlavor = new com.sun.star.datatransfer.DataFlavor
aFlavor.MimeType = "application/x-openoffice-biff-12;windows_formatname=""Biff12"""
XTransferable_getTransferDataFlavors = array(aFlavor)
end function
function XTransferable_isDataFlavorSupported(aFlavor as com.sun.star.datatransfer.DataFlavor) as boolean
XTransferable_isDataFlavorSupported = (aFlavor.MimeType = "application/x-openoffice-biff-12;windows_formatname=""Biff12""")
end function
sub setClipboardContent
oClip = CreateUNOService("com.sun.star.datatransfer.clipboard.SystemClipboard")
oClip.setContents(CreateUNOListener("XTransferable_", "com.sun.star.datatransfer.XTransferable"), nothing)
end sub
The first three functions are Basic implementation of XTransferable interface.
Running setClipboardContent will prepare the system clipboard on any platform, using a trick of implementing arbitrary UNO interface using CreateUNOListener; and after that, pasting into Calc would allow to see if things work (if content of /path/to/biff12.clipboard.xlsb is pasted, as expected), and make improvements. If I knew this trick back then, I would of course share it with Laurent; but I thought I’d put it here now, so maybe it helps me or someone else in the future. (Note that application/x-openoffice-biff-12;windows_formatname="Biff12" there in the code was the name introduced by Laurent in the discussed commit; indeed, that, and the actual data in the file, would depend on the exact format that you work with.)

Commented text range, inside a tracked delete, in DOCX, Collabora Online
Commented text range, inside a tracked delete, in DOCX, desktop
Commented text range, inside a tracked delete, in DOCX, Collabora Online, old bad state
Commented text range, inside a tracked delete, in DOCX, desktop, old bad state
Online odfvalidator tool
Outliner shape with 3 outliner styles
Outliner shape with a numbering on the second level
Outliner shape with two outline styles
LibreOffice CI uses Jenkins
Resume build in LibreOffice CI
PDF result: templated
PDF result: default
Interdependent tracked change: baseline
Interdependent tracked change: default accept result
Interdependent tracked change: direct accept via the dialog
Interdependent tracked change: direct accept result