Apache OpenOffice (AOO) Bugzilla – Issue 63017
new chart: Format::Arrangement always visible in menu
Last modified: 2013-02-24 21:22:26 UTC
new chart (in Inplace mode) -> Format::Arrangement::* is always visible in menu even when it cannot be applied
add keyword
accepted
changed issue type from defect to task to better reflect that this issue is only a working issue for the chart reimplementation
Note: The menu items can only be executed when a series is selected, and the selection is valid. Meaning: "Send Backwards" is only valid if series 1,..,n-1 is selected. "Bring Forward" is only valid if series 2,...,n is selected. Note, that in the old chart implementation both items were only available when being inside Calc. I don't know if this really makes sense, but we may ignore that for the first start.
To add some comments about this feature : At the moment, even when you just do not select any particular range, you can access to the At the moment, even when you just do not select any particular range, you can access to the Format::Arrangement::(Bring forward / Send Backward). For example, if you double-click on the chart, you will have access to the menu "Bring forward / Send Backward". This should not be the case, as you need to select a particular column in order to that Arragment feature to make sense the feature should be disabled ("in gray"). Now, we should establish when this features should be "in gray" and when they should be enabled. Should be choose the same behavior as in the current chart implementation ? Do you think writing a spec about it would be a good idea ?
I don't think that we ned an own specification here. Instead the enableing and disabling of this menu item should be described in the chart menu specification: http://specs.openoffice.org/chart/menus/MenuStructure.odt So we should change that spec if necessary.
The logic when a series can be moved and when not depends not only on the index of the series. If a chart does contain multiple charttypes it is also important whether neighboured charttypes are compatible. The concrete logic is implemented in the method: DiagramHelper::moveSeries(). I strongly suggest to have only one implementation of this logic. So it would be good to enhance this method by a paramter which tells the method to indicate the possibility only or instead execute the move (bExecute for example). The return value than describes wheter a move is possible or wether it was actually done dependent on that input parameter.
Changed target to 2.x
Notes : The argument which is at the moment called "bIsWritable" is the condition expressing if the menu "Backward/Forward" will be visible. ControllerCommandDispatch::fireStatusEvent() { [...] conditionalFireStatusEventForURL( C2U(".uno:Backward"), [...] , bIsWritable ); } Hence, we need to add two booleans (bMayMoveSeriesForward and MayMoveSeriesBackward) which will explicit if the series can be moved or not. Those booleans will be added to the "ModelState" structure (in the file ControllerCommandDispatch.cxx). and will be updated when the function ModelState::update() will be called.
In the class "ControllerCommandDispatch" : A new structure "ControllerState" has been created. This structure is designed to cache the state of the selected series : can a series be moved forward/backward. The ControllerCommandDispatch now inherits from XSelectionChangeListener. This means that when the selected series changes, the ControllerState will be updated. In the class "DiagramHelper" : The private method "lcl_moveSeriesOrCheckIfMoveIsAllowed()" has been added to abstract the logic of testing that a series can/has to be moved. This function is used by "DiagramHelper::moveSeries()" and DiagramHelper::isSeriesMoveable().
Created attachment 38370 [details] Patch for the arrangement feature
Added me for CC
->pagalmes: To you, as you are working on this already.
I will set this issue as fixed, even if the contextual menu (right-click) Arrangement is not working at the moment. The contextual menu issue is described as issue 68330.
@Thomas: Fixed in CWS chart2mst3 milestone10, please verify.
changed target to 2.3
verified follow up issue i 64495
ok in SRC680m220 -> closing