Apache OpenOffice (AOO) Bugzilla – Issue 108871
[from Symphony]After saved, form control lost assigned macro
Last modified: 2017-05-20 11:29:25 UTC
1. Root Cause: Currently, the codes use "VBAProject" as the vba codes' project name, but old codes use "Standard" as the name. When open a xls file that have a Form control being attached with a macro, then save this xls file, filter check the form control's macro link using "Standard", but actually the name is "VBAProject", that causes form control's macro link can't be saved successfully. 2. Resolution: Because the VBA project name can be changed, so we must iterate all the library of the document, and match current macro name using each library name.
Created attachment 67551 [details] Fix for this issue
be careful to remove windows crlf(s) from patches I don't think it is necessary to search all Libraries for the macro here, we *do* know the name of the vba project ( for a document to be round-tripped ) it's the name of the BasicManager, however if there are some imported or referenced projects then these will appear as additional libraries so probably better to only search libraries for the macro if there are Libraries in addition to the VBA project library and 'Standard'
Because user can change the library, or sample has more than one library, I think we should search all the library.
>Because user can change the library, I am a little confused here :/ 1. I fail to see how a user can change a library ( meaning Project ) because library in this case is just an openoffice specific detail, it is just a container with the same name as the Project of the imported macros. 2. even if someone creates a new library and inserts macros they wont be exported 3. even if we did support export of macros it's hard to see how that would map to what we would need to export, what would these extra 'libraries' get exported too, remember in vba there is only a single project in a document >or sample has more than one library, I think we should search all the library. if you read what I said above then I say if there are more Libraries ( than the Project library ) where those libraries refer to other referenced vba projects then it makes sense to search *all* libraries ( and I think in excel I haven't seen a case where this is necessary ), in other words if there are just the 2 Libraries present ( Standard & the 'Project' library ) then you just can immediatlely search the libarary names by the name of the BasicManager
Yes, currently, we don't support to export a new library, so I did a little change: I use the name of BasicManager to compare the macro url, but not search all libraries, please review the new patch.
Created attachment 69179 [details] New patch for this issue.
looks good to me, unfortunately not upstreamable until at least I get to upstream import of project
Reset assigne to the default "issues@openoffice.apache.org".