Issue 108871 - [from Symphony]After saved, form control lost assigned macro
Summary: [from Symphony]After saved, form control lost assigned macro
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: vba (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-03 06:32 UTC by lihuiibm
Modified: 2017-05-20 11:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Fix for this issue (6.53 KB, text/plain)
2010-02-03 06:33 UTC, lihuiibm
no flags Details
New patch for this issue. (6.07 KB, patch)
2010-04-30 09:30 UTC, lihuiibm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description lihuiibm 2010-02-03 06:32:53 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.
Comment 1 lihuiibm 2010-02-03 06:33:27 UTC
Created attachment 67551 [details]
Fix for this issue
Comment 2 noel.power 2010-02-22 20:07:58 UTC
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' 
Comment 3 noel.power 2010-02-22 20:12:51 UTC
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' 
Comment 4 lihuiibm 2010-02-24 06:29:06 UTC
Because user can change the library, or sample has more than one library, I
think we should search all the library.
Comment 5 noel.power 2010-02-24 09:26:57 UTC
>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 
Comment 6 lihuiibm 2010-04-30 09:29:55 UTC
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.
Comment 7 lihuiibm 2010-04-30 09:30:22 UTC
Created attachment 69179 [details]
New patch for this issue.
Comment 8 noel.power 2010-05-04 10:57:16 UTC
looks good to me, unfortunately not upstreamable until at least I get to
upstream import of project 
Comment 9 Marcus 2017-05-20 11:29:25 UTC
Reset assigne to the default "issues@openoffice.apache.org".