Mathias Bauer wrote: > Matthias B. wrote: > >> We have a custom OOo component and we'd like to store additional data >> inside a document that this component can access. So far we've encoded >> the data as text and then stored it in notes, but this is quite >> hackish. What we would like to do is to put an extra binary file into >> the ODT file (which after all is just a ZIP archive) and to read this >> file in our custom component. Does UNO have interfaces for accessing >> arbitrary data stored in the document's ODT file? > > Yes. You must put your stream into a folder that you assign a MediaType to. > Here's some (untested) C++ code that illustrates this:
(snip) I forgot to mention: you must do this before the document is saved, e.g. in a listener callback that waits for the document events "OnSave", "OnSaveAs" and "OnCopyTo". But you also can do this at any other time before the user asks for saving, the document will then appear as modified. The inserted content is part of the document storage then (and is accessible for reading via storage API), but it will not appear in the file until the root storage is committed. But in our framework only the document itself is allowed to do this. This usually happens when the user asks to save the document. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]