Issue 26402 - macro import bug fixes ...
Summary: macro import bug fixes ...
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 1.1.1RC
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: oc
QA Contact: issues@sc
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-12 14:39 UTC by mmeeks
Modified: 2013-08-07 15:15 UTC (History)
5 users (show)

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


Attachments
import macros (7.56 KB, patch)
2004-03-12 14:39 UTC, mmeeks
no flags Details | Diff
export VBA. (8.46 KB, patch)
2004-03-15 20:25 UTC, mmeeks
no flags Details | Diff
Proposed patch to fix this (15.28 KB, patch)
2004-06-09 09:27 UTC, john.marmion
no flags Details | Diff
back port patch for the srx645 tree (14.72 KB, patch)
2004-09-08 18:13 UTC, john.marmion
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description mmeeks 2004-03-12 14:39:13 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 ... ;-)
Comment 1 mmeeks 2004-03-12 14:39:35 UTC
Created attachment 13748 [details]
import macros
Comment 2 frank 2004-03-12 16:26:27 UTC
Hi Niklas,

it seems to be your decisiion, so please set the target to the needed one.

Frank
Comment 3 mmeeks 2004-03-15 20:25:22 UTC
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.
Comment 4 mmeeks 2004-03-15 20:25:59 UTC
Created attachment 13822 [details]
export VBA.
Comment 5 stx123 2004-03-25 09:44:20 UTC
Target set to "not determined" to encourage Niklas' decision process...
Comment 6 niklas.nebel 2004-03-31 10:39:21 UTC
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.
Comment 7 daniel.rentz 2004-03-31 11:33:18 UTC
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.
Comment 8 utomo99 2004-05-29 07:10:11 UTC
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
Comment 9 daniel.rentz 2004-06-02 11:12:53 UTC
John will take care about this
Comment 10 mmeeks 2004-06-02 16:13:31 UTC
sorry for dropping this - been crazy busy with other stuff; will be back to real
work shortly (DV).
Comment 11 john.marmion 2004-06-02 17:10:49 UTC
mark started - I hope to post a patch for this soon when I sort it out.
Comment 12 john.marmion 2004-06-09 09:27:10 UTC
Created attachment 15757 [details]
Proposed patch to fix this
Comment 13 john.marmion 2004-06-09 09:35:58 UTC
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. 
Comment 14 john.marmion 2004-06-09 14:01:28 UTC
patch change: function name in DBG_ASSERT() in
xilink.cxx::XclImpNameBuffer::GetNameFromIndex().

checked in fix into cws/dr19
Comment 15 john.marmion 2004-07-06 19:16:31 UTC
reopen to reassign
Comment 16 john.marmion 2004-07-06 19:17:08 UTC
assign to qa
Comment 17 john.marmion 2004-07-06 19:17:41 UTC
reset to fixed
Comment 18 oc 2004-07-12 14:15:55 UTC
verified in internal build cws_dr19
Comment 19 john.marmion 2004-09-08 18:13:02 UTC
Created attachment 17604 [details]
back port patch for the srx645 tree
Comment 20 oc 2004-11-26 11:42:29 UTC
closed because fix available in OOo1.9m62