Apache OpenOffice (AOO) Bugzilla – Issue 106183
data labels in pie charts cannot be selected anymore
Last modified: 2017-05-20 10:29:07 UTC
Create a pie chart with labels or load the attached document. With the mouse left click on a data point label text shape. The labels should be selected but instead the whole chart is selected wrongly.
Created attachment 65532 [details] example document to reproduce the problem
This is broken by CWS aw065. The hit test does not return the correct object. Seems to have something to do with not up to date bounding rects of group objects.
IHA->AW: Is there a chance to get this fixed for OOo3.2?
AW: Evaluating what happens. It would be useful to know what kind of objects is used for those texts, and if the same kind is used for other charts (where it works). Getting chart2 with debug...
IHA->AW: The labels are normal text shapes created via service com.sun.star.drawing.TextShape. But they are contained within a group shape. This group shape seems to cause the problems. During the hit test within svx the object hierarchy is traveled. The mentioned group shape has a negative size and is skipped. So the text shapes are never tested for the hit. It makes sense to set a breakpoint into ChartController::execute_MouseButtonDown and then activate the break point within SdrView::PickObj afterwards. Because for each mouse move PickObj is called twice - once for the mouse pointer and once for the tip help.
AW->IHA: Thanks for the helpful information. AW: Looks like a refresh problem with buffered data at SdrObjList in Drawinglayer which is a very central, but also very old part. After some debugging (MANY groups, hierarchies with 4-5 group-in-group depth) i checked the SdrObjList::GetAllObjBoundRect call and the bRectsDirty flag. Setting it to dirty by hand for aOutRect's with negative size makes the labels work. This shows that there are circumstances where this flag is NOT correctly handled (not invalidated). Aftre some code reading i guess it's in SdrObjList::NbcInsertObject where the aOutRect is expanded by the range of the new object, but this cange is NOT propagated to the parents. Adding a reaction on existing pUpList-list... PS: Even when this works it's too dangerous to add this to a 3.2; the SdrObjList is the central class for Page and Group handling and a lot of old code works on it...
IHA->AW: Thanks for the evaluation! Is it maybe possible to only change the behavior of SdrView::PickObj to avoid greater risks? SdrView::PickObj could maybe check the children of group shapes with negative sizes in addtion as long as the sizes of group shapes are not reliable..
AW->IHA: First i had to evaluate deeper what exactly goes wrong... A small patch which will fix this and should not be too dangerous is: --- a/svx/source/svdraw/svdpage.cxx Thu Oct 22 17:29:01 2009 +0200 +++ b/svx/source/svdraw/svdpage.cxx Tue Oct 27 12:55:28 2009 +0100 @@ -671,7 +671,8 @@ const Rectangle& SdrObjList::GetAllObjBoundRect() const { - if (bRectsDirty) { + if (bRectsDirty || aOutRect.IsEmpty()) + { ((SdrObjList*)this)->RecalcRects(); ((SdrObjList*)this)->bRectsDirty=FALSE; } You may check this and also decide if You want to add this to a current or OOo3.2 CWS.
IHA->AW: Great, that a fix exsist! :-) I tested it in my local build (dev300m60) and it works fine. I really think the fix for this regression should go into OOo 3.2 as wrongly calculated bound rects of group shapes can have much further bad impact on the charts layout. As I am on vacation starting tomorrow I would like to ask you to take over for the integration of the fix. Thanks a lot!
AW: Adding task and fix to ooo32gsl03...
AW: Fix added to CWS ooo32gsl03, checked in, built, done.
AW: Checked in ooo32gsl03 build, works as expected. AW->WG: Please verify.
Verified in CWS.