I've been using the following code to keep the visual cursor at a higher position in the viewable area. It relies on getAccessibleName to locate the vertical scrollbar. It now returns an empty string. ' ' From https://forum.openoffice.org//en/forum/viewtopic.php?f=20&p=495197 ' 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 jc: jc=compchild.getAccessibleContext.getAccessibleChildcount Dim j for j = 0 to jc -1 'find the scrollbar with compchild.getAccessibleContext.getAccessibleChild(j) Dim n: n = .getAccessibleContext.getAccessibleName if n = "Vertical scroll bar" 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 - .getblockincrement/5 .getAccessibleContext.setcurrentvalue clng(svalue) exit for end if end with next end sub It works in v7.4.7.2 but NOT in v7.6.5.1 and the latest, Version: 24.2.1.2 (X86_64) / LibreOffice Community Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac CPU threads: 4; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win Locale: en-AU (en_AU); UI: en-US Calc: threaded
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided. (Please note that the attachment will be public, remove any sensitive information before attaching it. See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Reproduced in Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: fd948fd27356e703fffc7e46df0f0e3a22f57967 CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3 Locale: es-ES (es_ES.UTF-8); UI: en-US Calc: threaded
Regression introduced by: author Caolán McNamara <caolanm@redhat.com> 2022-08-02 16:44:44 +0100 committer Caolán McNamara <caolanm@redhat.com> 2022-08-03 20:23:49 +0200 commit 6c12f6dca251ba583297090def8aa9597a818c14 (patch) tree 8437a70e0df8c00684d8f2bee45796f562b44d1e parent adc15ce09e5f7fbcf5857238a9898f96da5acb9f (diff) tdf#117388 use native scrollbar under gtk in writer Bisected with: bibisect-linux64-7.5
Also reproducible with GEN
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
Confirmed. It works on latest stable and older 7.4 I am using currently. Many thanks Caolán.