Bug 80494

Summary: Creating chart by StarBasic Macro fails
Product: LibreOffice Reporter: FS <bz_lo>
Component: BASICAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: raal
Priority: medium    
Version: 4.2.4.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: StarBasic Code from OOo Wiki

Description FS 2014-06-24 19:45:01 UTC
Creating a chart in LibreOffice Calc by means of a StarBasic macro fails, cause is unclear. I assume that the code examples from OpenOffice.org Wiki should work in LibreOffice, too.

Steps to reproduce:
1. In LibreOffice, create a new basic macro module;
2. Copy and paste the macro code from https://wiki.openoffice.org/wiki/Documentation/BASIC_Guide/Structure_of_Charts betwenn Sub <MacroName> and End Sub
3. Compile and run the macro.

Result:
1. On first run, LO throws an IllegalArgumentException on line "Charts.addNewByName("MyChart", Rect, RangeAddress(), True, True)";
2. On second and subsequent runs, LO throws a NoSuchElementException on line "Chart = Charts.getByName("MyChart").EmbeddedObject"

Expected result:
Execute the macro, creating the chart.

It seems that the "Charts.addNewByName()" call fails, but there seems no way to debug this, and it's exactly the code as proposed in the documentation.
Comment 1 FS 2014-06-24 19:49:12 UTC
Created attachment 101689 [details]
StarBasic Code from OOo Wiki
Comment 2 FS 2014-06-25 07:27:50 UTC
Checked with LO 4.2.4.2 and Win7 - same errors.
Comment 3 FS 2014-06-26 07:57:42 UTC
Checked the sample code with Apache OpenOffice.org Calc 4.1.0 on Win7 - works perfectly. So i assume the Basic code is valid and working.
Comment 4 raal 2014-07-29 17:48:33 UTC
unable to reproduce with Version: 4.4.0.0.alpha0+
Build ID: 7d06a0601ddccc50185ea97fddcdf2ea39299096
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-07-28_06:17:50

unable to reproduce with Version: 4.3.1.0.0+
Build ID: ca88a0ea6ed7277e8522d83458e3cfb975fcfb7d
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-4-3, Time: 2014-07-25_10:06:25
Comment 5 FS 2014-07-29 19:35:23 UTC
Thanks for taking a look at this issue - with the nightly build 4.3.1.0, i can't reproduce the problem any more (tested with Win7 4.3.1.0.0+,
Build 217d0ed1cdb492def7220859ecb4931d90d8022c and Linux x86_64): so, it seems the issue is solved in current builds.
Comment 6 raal 2014-07-29 19:42:52 UTC
fixed in new version, closing bug