Apache OpenOffice (AOO) Bugzilla – Issue 72758
Chart components cannot be edited correctly from code unless the chart is in edit mode
Last modified: 2017-05-20 09:32:04 UTC
I'm working on Windows 2003 with .Net Framework 2.0 (code written in C#, though I don't think that matters). I open the Calc component from code, insert a chart (and resize it to maximum landscape dimension - at this point the title gets resized too to a 42 size), set the String property of the Title (also from code), then try to set the CharHeight property of the title and it there is no visual change. If I get the value of the property it's the one I set. At this point my code enters a breakpoint, so I set the chart to edit mode (manually, not from code), and resume the debugging. From code: I set the chart property HasSubtitle to true, subtitle property String, and subtitle property CharHeight to 13, break again and surprise, surprise, the font size is correctly set. Another frustrating issue that I noticed is that getting the posions of chart components, when not in edit mode, leads to wrong values.
This is no prio 1 issue and i adapt the target to prio 3. Can you please provide a short example program or macro to reproduce this error.
Created attachment 41588 [details] Project to demonstrate the issue
I have attached a demo project that creates a chart, sets the title to some text and then tries to resize the font of the title. The project was created with VS 2005, it probably is compilable on VS 2003 with .Net Framework 1.1, and I don't know if the issue can be reproduced on that framework. So please use .Net Framework 2.0 in your test. The cli dlls (that are referenced in the project) are from version 2.0.4 (2.0.3 had the same problem). You can run the program once to see that it doesn't set the font size to 14. Then set a break point on the line 'titlePropSet.setPropertyValue("CharHeight", new uno.Any(14));', and on break, go to the Calc instance, set the chart to Edit mode, and then resume debugging, to see that this way the font size is set to 14.
jsc -> bm: i can reproduce this with Java as well, can you please verify this.
First idea: the change of the property does not lead to a modification so that the replacement image of the chart is not replaced with the title's new font size. This should be fixed in the new chart. Have to check, though.
->JSC: Could you please check if the issue is fixed. I don't know what to do with the files in the attached zip ;-) As you wrote you could reproduce this, maybe you can now verify that it is fixed with the chart-reimplementation.
jsc -bm: as discussed back to you
Fixed with the new chart. Verified in master SRC680.m219 with an SDK example (DevelopersGuide/Charts/ChartInDraw), added code for setting the CharHeight, is seen immediately and shown correctly when activating the chart. Important for this issue: commented out the lockControllers() and unlockControllers() calls, as those guarantee an update anyway.
->katahlyn: Please verify if your problem is solved. You need OOo 2.3, which is not released yet. You can either wait for the release, or download a developer snapshot version SRC680.m213 or greater (at the moment m222 should be available). You can get a developer snapshot here: http://download.openoffice.org/680/index.html
*** Issue 68836 has been marked as a duplicate of this issue. ***