On 16/08/11 17:32, Lionel Elie Mamane wrote:
( after refamiliarising myself with this code ) this behaviour is not at all expected.I disabled the "export out any embedded image object" code by adding a "return;" before it, and it does not loose the embedded images, even after restarting LO and re-opening the document.
It seems that base documents are doing something strange ( well maybe better to say different ) here, in fact if you add, save and then remove some image controls ( with embedded images ) then the Picture streams are never discarded. With the other applications ( calc, writer etc. ) when you save you save you save to new storage and the storage content is regenerated from the document model so effectively the existing content is thrown away and recreated. In the case of basic of course some optimizations might occur like copying existing 'Basic' substorages to rather than writing to the target storage based on the in-memory libraries model.
With that in mind and after doing a little testing I think your patch for loading the library in SfxDialogLibraryContainer::storeLibrariesToStorage is the simplest thing to do and should avoid any such problems in any other applications like the one you mentioned ( that I cannot reproduce ) in calc. So I will push this ( and good job too tracking it down )
The issue with the leaking 'Picture/xxxxxxxxxx.png" etc. streams still remains, I guess I would need to understand what base actually does when saving with the existing content to see what we can do there, probably it is just a case of excluding the Pictures directory rather than blanket copying stuff.
thanks, Noel