Apache OpenOffice (AOO) Bugzilla – Issue 93953
Source Format for secondary axes
Last modified: 2013-02-24 21:20:07 UTC
If the source for a chart formatted (e.g. as currency) the sec Axes should adopted the source format. Add info: the Numbers Dialog of the sec. Axes show the not correct Option "Source format"
When at a secondary axis no series is attached it should act as copy of the primary axis, when the scale options are set to automatic. This was implemented with issue 80518. What now is missing is that also the source format is copied from the primary to the secondary axis for viewing purposes. @weiz, please have a look.
Created attachment 60364 [details] patch_090223
@iha: the patch is submitted, please let me know your suggestions. Thank you!
@weiz, thanks for the patch. As discussed in our IRC meeting already there are some remaining problems. I'll attach an example document that contains the relevant cases. Use function ExplicitValueProvider::getExplicitNumberFormatKeyForAxis to get the correct number format from the axis with data attached to it.
Created attachment 60435 [details] examples for secondary axis without data attached to it
@weiz, looking at the code I found another problem. You change the model during view creation. The code in question is: xDestAxisProp->setPropertyValue( C2U( "NumberFormat" ), uno::makeAny( nNumberFormatKeySource ) ); That is forbidden! Creating a view on the model must not change the model. Please find a different solution to transport and use the necessary information.
Created attachment 60762 [details] patch_090306
@iha: the new patch is submitted. I added some codes in "ExplicitValueProvider::getExplicitNumberFormatKeyForAxis" and call it self inside the function. Maybe there is a better solution, but I am not familiar with the number format part, I am afraid if I change the structure in this function, it will cause new problems, so I chose the current solution. Please let me know your suggestions. Thank you!
@weiz, thanks for the second patch. It looks much better than the first one. All the scenarios from the example document do work. But it still needs some improvements. if( !nNumberFormatKey ) has not the meaning of 'no numberformat was set or found'. Instead nNumberFormatKey==0 is also a valid numberformat. It is the standard number format. if( !( xProp->getPropertyValue( C2U( "NumberFormat" ) ) >>= nNumberFormatKey ) ) instead has the meaning of 'no numberformat was set'. In addition the recursive call currently looks too risky to me. To more explicitly avoid an endless loop I created a second function which carries a parameter 'bSearchForParallelAxisIfNothingIsFound' to stop the recursion. I commited the corrected fix to CWS chart37. Have a nice weekend!
@kla, please verify in CWS chart37.
seen ok in CWS chart37 -> verified
Seen ok in Master -> closed