sw/source/core/access/accpara.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit a58444db7dcd5a84cda235984b311e9c81ce8a3d
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Apr 24 11:29:02 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 25 07:29:59 2025 +0200

    sw a11y: Assign final coords to point right away
    
    Change-Id: I3ff988dfe13b095f842d637f3e87ffb742f68ec2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184571
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index c8b2d8189492..8ecad5bdfa3b 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1918,11 +1918,9 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const 
awt::Point& rPoint )
     {
         throw uno::RuntimeException(u"no Window"_ustr, getXWeak());
     }
-    Point aPoint( rPoint.X, rPoint.Y );
     SwRect aLogBounds( GetBounds( *(GetMap()), GetFrame() ) ); // twip rel to 
doc root
     Point aPixPos( GetMap()->CoreToPixel( aLogBounds ).TopLeft() );
-    aPoint.setX(aPoint.getX() + aPixPos.getX());
-    aPoint.setY(aPoint.getY() + aPixPos.getY());
+    const Point aPoint(rPoint.X + aPixPos.getX(), rPoint.Y + aPixPos.getY());
     Point aCorePoint( GetMap()->PixelToCore( aPoint ) );
     if( !aLogBounds.Contains( aCorePoint ) )
     {
commit 03239b9002fee213099ef2f567c4c53cef0d6cd0
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Apr 24 11:23:11 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 25 07:29:51 2025 +0200

    sw a11y: Use vcl::unohelper::ConvertToAWTRect
    
    Change-Id: I9ba2d353479df0e054a5a4f67ea2ba112e2589da
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184570
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 4bf046938aad..c8b2d8189492 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -31,6 +31,7 @@
 #include <fesh.hxx>
 #include <viewopt.hxx>
 #include <vcl/svapp.hxx>
+#include <vcl/unohelp.hxx>
 #include <vcl/window.hxx>
 #include <sal/log.hxx>
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
@@ -1893,10 +1894,7 @@ awt::Rectangle SwAccessibleParagraph::getCharacterBounds(
     Point aFramePixPos( GetMap()->CoreToPixel( aFrameLogBounds ).TopLeft() );
     aScreenRect.Move( -aFramePixPos.getX(), -aFramePixPos.getY() );
 
-    // convert into AWT Rectangle
-    return awt::Rectangle(
-        aScreenRect.Left(), aScreenRect.Top(),
-        aScreenRect.GetWidth(), aScreenRect.GetHeight() );
+    return vcl::unohelper::ConvertToAWTRect(aScreenRect);
 }
 
 sal_Int32 SwAccessibleParagraph::getCharacterCount()

Reply via email to