https://bugs.documentfoundation.org/show_bug.cgi?id=159966
Caolán McNamara <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |NOTABUG Status|NEW |RESOLVED --- Comment #5 from Caolán McNamara <[email protected]> --- So this is a pretty unusual macro that depends on finding a particular accessibility component and internal widget at a particular place to manipulate it in ways I don't think anyone ever had in mind :-) Anyhow, the original report is for windows, and there the searched for accessibility component is still in the a11y hierarchy (and the same XScrollBar widget is likewise still in the widget hierarchy) just not where it used to be. I've tested this alternative macro on Windows and should give the same outcome on all versions as the original one did in older versions. I've just extracted "GetVertScrollbar" to recursively search for that "Vertical scroll bar" accessibility component so it can find it in its new home. It won't work for the gtk case, and there's no guarantee that this will always work, but it probably will for the foreseeable future. I hope the below helps. Function GetVertScrollbar(parent) as Variant Dim jc: jc=parent.getAccessibleContext.getAccessibleChildcount() Dim j for j = 0 to jc -1 'find the scrollbar Dim child: child = parent.getAccessibleContext.getAccessibleChild(j) Dim n: n = child.getAccessibleContext.getAccessibleName() if n = "Vertical scroll bar" then GetVertScrollbar = child exit for end if Dim result: result = GetVertScrollbar(child) if result then GetVertScrollbar = result exit for end if next end Function sub VCToCentreScreen Dim doc: doc = thiscomponent Dim vc: vc = doc.currentcontroller.viewcursor Dim y: y= vc.position.y 'position is in page/metric coordinates Dim svalue 'svalue = (y+someothervalue )/ (10/(2.83465 * 2)) 'converts value to scrollbar uses half points svalue = (y+0)/ (10/(2.83465 * 2)) 'converts value to scrollbar uses half points Dim comp comp = doc.currentcontroller.frame.getcomponentwindow() Dim compchild compchild=comp.getAccessibleContext.getAccessibleChild(0) Dim scrollBar scrollBar = GetVertScrollbar(compchild) if scrollBar then '.getblockincrement is usually the amount scrolled when screen down 'subtract a bit for that /2 doesn't work on my machine /5 roughly does 'svalue = svalue - someothervalue svalue = svalue - scrollBar.getBlockIncrement()/5 scrollBar.getAccessibleContext.setCurrentValue clng(svalue) end if end sub -- You are receiving this mail because: You are the assignee for the bug.
