https://bugs.documentfoundation.org/show_bug.cgi?id=159966

            Bug ID: 159966
           Summary: getAccessibleName no longer returns string for
                    vertical scrollbar
           Product: LibreOffice
           Version: 7.6.5.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

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

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to