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.
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"
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.
Created attachment 101689 [details]
StarBasic Code from OOo Wiki
Checked with LO 126.96.36.199 and Win7 - same errors.
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.
unable to reproduce with Version: 188.8.131.52.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: 184.108.40.206.0+
Build ID: ca88a0ea6ed7277e8522d83458e3cfb975fcfb7d
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-4-3, Time: 2014-07-25_10:06:25
Thanks for taking a look at this issue - with the nightly build 220.127.116.11, i can't reproduce the problem any more (tested with Win7 18.104.22.168.0+,
Build 217d0ed1cdb492def7220859ecb4931d90d8022c and Linux x86_64): so, it seems the issue is solved in current builds.
fixed in new version, closing bug