Apache OpenOffice (AOO) Bugzilla – Issue 70380
unexpected behaviour when using basic 'erase'
Last modified: 2009-07-20 14:55:44 UTC
so the proposed patch here is incomplete ( but should serve as a start point for discussion etc. ) also there is I think another issue associated with this[*], we can discuss whether it's necessary to raise another issue here or fix it with this patch what's the story? current behaviour seems to completely destroy the array you 'erase' and free all memory. For vba interoperability obviously thats not the best ;-) the patch here just clears the array ( but not the memory ) if the compatibility option is specified. Note: currently the patch make no distinction made between variant and fixed array's ( but that should be easy to do? ) so this is a first step ;-) vba behavior apparently is * if its a variant array ( behave like ooobasic does now ) * if its a fixed array, set the values to appropriate initial ones so, if compatability no matter what type of array it is it is 'zeroed' rather than released for non-compatibility mode of course the behavior is the same as always. [*] even in "normal" mode after an erase it is possible to navigate the array without "getting index out of bounds"
Created attachment 39715 [details] patch
Created attachment 39716 [details] sortof test document
Created attachment 39740 [details] version #2
ahem, it appears that basic itself uses erase as part of the pcode it generates, so I had to put a quick hack for determining if an array is fixed size or not hence the version-2 patch
Patch is incomplete -> 2.x for now, STARTED
kso->np: This task is added to CWS npower5, which is targeted for OOo 2.2. Unfortunately, npower5 has no due date. Is npower5 actually intended to be integrated into 2.2? If yes, please set the target for this task to 2.2 (and supply due dates for your CWS, please). If no, please adjust the target of the CWS (and the tasks it contains).
lets try for 2.2
ab->npower: Assigning to you as all other npower5 tasks are also assigned to you.
Move to 2.3.
try for npower7
Created attachment 43378 [details] another version of test document
Created attachment 43529 [details] self testing document
fixed
Created attachment 45192 [details] final version of test document
final version of the test document above, please use this one to test the legacy test has some failures, these failure should be identical when running this document on any other version of openoffice ( e.g. any version that doesn't include the fixes to this cws ) the vba test should pass.
for qa
change target
Ran test documents (EraseArrayTest.ods) on released SLED10 SP1 OOo 2.1.14, Windows OOo 2.1 (Build 2007-06-04) and cws-npower7-m217. Below are the results returned in the msgbox after pressing the "legacy test" button: • Test Results • ============= • test 4 check modified contents of erased array failed got False expected True • test 5 test illegal element variant array element failed got True expected False • test 8 test use of ubounds on erase variant array failed got True expected False • • Tests passed: 5 • Tests failed: 3 ‣ Below are the results returned in the msgbox after pressing the "vba compat test" button: • Test Results • ============= • Tests passed: 8 • Tests failed: 0 ‣ RESULT: Test Passed
This issue is closed automatically and wasn't rechecked in a current version of OOo. The fixed issue should be integrated in OOo since more than half a year. If you think this issue isn't fixed in a current version (OOo 3.1), please reopen it and change the field 'Target Milestone' accordingly. If you want to download a current version of OOo => http://download.openoffice.org/index.html If you want to know more about the handling of fixed/verified issues => http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues