Apache OpenOffice (AOO) Bugzilla – Issue 119415
VBA code can't load after open in AOO3.4
Last modified: 2013-07-11 08:11:28 UTC
1.Open the attached sample file in OpenOffice 2.Check the vba code Defect: All vba code are not load.
Created attachment 77596 [details] In Excel, click the button, a panel with one checkbox on it will popup. Opening this sample file in AOO3.4 can also reproduce this problem.
If I open the attached file in Excel 2010 and save it without any changes to a new file, that file is opened correctly in AOO3.4. The code is there and runs correctly.
Can't run the macro in attached sample file with AOO3.4
Created attachment 79522 [details] another sample, which VBA code can not load Please check the sample file, the vba code can not load correctly.
When I open the file with a debug build of r1378069 I get these errors: Error: XclImpStream::Ignore - record overread From File C:/AOO_2012_07_git/trunk/main/sc/source/filter/excel/xistream.cxx at Line 887 Error: TextInputStream::createXTextInputStream - unsupported text encoding From File C:/AOO_2012_07_git/trunk/main/oox/source/helper/textinputstream.cxx at Line 198 Error: ### default context of service manager singleton differs from context holding it! From File C:/AOO_2012_07_git/trunk/main/stoc/source/servicemanager/servicemanager.cxx at Line 1293 Error: VbaProject::importVba - form substorage without form module From File C:/AOO_2012_07_git/trunk/main/oox/source/ole/vbaproject.cxx at Line 481
Root Cause: The sample was created by Chinese MS Excel 2003, the textencoding value of this is 61, when call the pcCharset = rtl_getMimeCharsetFromTextEncoding( eTextEnc), it will return null, so can't set the text stream of VBA and can't load the VBA code in AOO. Resolution: Change the rtl_getMimeCharsetFromTextEncoding( eTextEnc) to rtl_getBestMimeCharsetFromTextEncoding( eTextEnc) to get the right Charset, then can set the VBA text stream to load VBA code in AOO.
Created attachment 79639 [details] Patch for 119415
The patch looks good. Submit in revision 1390869
Verified on Aoo_Trunk_20121109.1800 Rev.1407366 Still can run the macro attached in sample file, so reopen it.
Sorry for the typo in the comment above, Still can NOT run the macro (In reply to comment #9) > Verified on Aoo_Trunk_20121109.1800 Rev.1407366 Still can run the macro > attached in sample file, so reopen it.
changed the macro security level from default value to low one, and also checked "Executable code" on from the settings of VBA properties in Options dialog, the bug does not repro, it is fixed.
Verified it on latest AOO trunk build.
close it.
Update target to release that will contain it.