Apache OpenOffice (AOO) Bugzilla – Issue 26402
macro import bug fixes ...
Last modified: 2013-08-07 15:15:02 UTC
This patch associates macro invocations as ocMacro calls; it also re-orders the VBA load/parse - this is because (if you turn the auto-commenting off on import etc.) it is possible to load/run macros - but only if they're there before you try to evaluate them the 1st time :-) This is (presumably) the 1st half of preserving macro references over XL load/save - which at a minimum might be useful (with the stream copying code) to avoid corrupting macros as they are saved again [ something that is most irksome to my users it transpires ]. Comments on the design appreciated; admittedly it's not an overly elegant solution but ... ;-)
Created attachment 13748 [details] import macros
Hi Niklas, it seems to be your decisiion, so please set the target to the needed one. Frank
The next attachment makes macro round-tripping possible; Sadly the design is pretty nasty - short of keeping a global list of macros, names being used (a-la Excel) it's not clear how to make this nicer; either way - the non-sorted Name records seem to cause OfficeXP at least no grief, but it'd really help to have some design comment before doing this sort of thing.
Created attachment 13822 [details] export VBA.
Target set to "not determined" to encourage Niklas' decision process...
The export seems to fail if a formula contains anything besides the Basic function (=FOO(A1+1) or =FOO(A1)+1). If that can be solved, and Daniel doesn't have any objections against the way it is implemented, I'm all for integrating it. Removing the auto-commenting can only be done as part of a bigger change to macro handling. For that, we need to define what we want to achieve before doing selective changes. All of this should take place on a recent 680 version instead of 645, as there have been substantial changes to the name handling in the Excel filter. I don't see this being integrated into a 1.1.x version anyway, 1.1.x is basically limited to important bugfixes.
Ok, I'll include it into the 680 code. Michael, it would be nice if you can have a look at the mentioned export problems.
Michael, just reminder for Daniel questions, regarding the export problems. Thanks Quote: Michael, it would be nice if you can have a look at the mentioned export problems
John will take care about this
sorry for dropping this - been crazy busy with other stuff; will be back to real work shortly (DV).
mark started - I hope to post a patch for this soon when I sort it out.
Created attachment 15757 [details] Proposed patch to fix this
latest patch will result in a '#MACRO?' as a cell result i.e. "Error - Macro not found " on import of a VBA macro. The formula is now parsed correctly and will appear in the formula bar. Once the VBA auto-commented code is converted a CTRL-SHIFT-F9 should replace the '#MACRO?' with the actual result of the macro. The export should write it out exactly as the import. I did not see any problems with the export. The NAME record is written out unsorted.
patch change: function name in DBG_ASSERT() in xilink.cxx::XclImpNameBuffer::GetNameFromIndex(). checked in fix into cws/dr19
reopen to reassign
assign to qa
reset to fixed
verified in internal build cws_dr19
Created attachment 17604 [details] back port patch for the srx645 tree
closed because fix available in OOo1.9m62