sw/inc/accmap.hxx                    |    2 +-
 sw/source/core/access/acccontext.cxx |    6 +++---
 sw/source/core/access/accframe.cxx   |    4 ++--
 sw/source/core/access/accmap.cxx     |    6 +++---
 sw/source/core/access/accpara.cxx    |   16 ++++++++--------
 5 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 56d7c40e87076fbce0a402dc56ed5a3d536c36a9
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue May 25 19:44:21 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed May 26 08:42:27 2021 +0200

    CoreToPixel should take a SwRect argument
    
    Change-Id: Idbed2a8fc6b4bc289c3bb0e761931f0b3d672620
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116121
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 979fac964823..625f17e0dacd 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -275,7 +275,7 @@ public:
     // additional Core/Pixel conversions for internal use; also works
     // for preview
     Point PixelToCore (const Point& rPoint) const;
-    tools::Rectangle CoreToPixel (const tools::Rectangle& rRect) const;
+    tools::Rectangle CoreToPixel (const SwRect& rRect) const;
 
     // is there a known accessibility impl cached for the frame
     bool Contains(const SwFrame *pFrame) const;
diff --git a/sw/source/core/access/acccontext.cxx 
b/sw/source/core/access/acccontext.cxx
index 04beb8200745..82859195b12a 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -830,7 +830,7 @@ uno::Reference< XAccessible > SAL_CALL 
SwAccessibleContext::getAccessibleAtPoint
     if( !GetFrame()->IsRootFrame() )
     {
         SwRect aLogBounds( GetBounds( *(GetMap()), GetFrame() ) ); // twip rel 
to doc root
-        Point aPixPos( GetMap()->CoreToPixel( aLogBounds.SVRect() ).TopLeft() 
);
+        Point aPixPos( GetMap()->CoreToPixel( aLogBounds ).TopLeft() );
         aPixPoint.setX(aPixPoint.getX() + aPixPos.getX());
         aPixPoint.setY(aPixPoint.getY() + aPixPos.getY());
     }
@@ -905,11 +905,11 @@ awt::Rectangle SwAccessibleContext::getBoundsImpl(bool 
bRelative)
     }
     if( !aLogBounds.IsEmpty() )
     {
-        aPixBounds = GetMap()->CoreToPixel( aLogBounds.SVRect() );
+        aPixBounds = GetMap()->CoreToPixel( aLogBounds );
         if( !pParent->IsRootFrame() && bRelative)
         {
             SwRect aParentLogBounds( GetBounds( *(GetMap()), pParent ) ); // 
twip rel to doc root
-            Point aParentPixPos( GetMap()->CoreToPixel( 
aParentLogBounds.SVRect() ).TopLeft() );
+            Point aParentPixPos( GetMap()->CoreToPixel( aParentLogBounds 
).TopLeft() );
             aPixBounds.Move( -aParentPixPos.getX(), -aParentPixPos.getY() );
         }
     }
diff --git a/sw/source/core/access/accframe.cxx 
b/sw/source/core/access/accframe.cxx
index 0aa31107279d..7b0ff2693e69 100644
--- a/sw/source/core/access/accframe.cxx
+++ b/sw/source/core/access/accframe.cxx
@@ -225,7 +225,7 @@ SwAccessibleChild SwAccessibleFrame::GetChildAtPixel( const 
SwRect& rVisArea,
                 SwRect aLogBounds( rLower.GetBounds( rAccMap ) );
                 if( !aLogBounds.IsEmpty() )
                 {
-                    tools::Rectangle aPixBounds( rAccMap.CoreToPixel( 
aLogBounds.SVRect() ) );
+                    tools::Rectangle aPixBounds( rAccMap.CoreToPixel( 
aLogBounds ) );
                     if( aPixBounds.IsInside( rPixPos ) )
                         aRet = rLower;
                 }
@@ -256,7 +256,7 @@ SwAccessibleChild SwAccessibleFrame::GetChildAtPixel( const 
SwRect& rVisArea,
                 SwRect aLogBounds( rLower.GetBounds( rAccMap ) );
                 if( !aLogBounds.IsEmpty() )
                 {
-                    tools::Rectangle aPixBounds( rAccMap.CoreToPixel( 
aLogBounds.SVRect() ) );
+                    tools::Rectangle aPixBounds( rAccMap.CoreToPixel( 
aLogBounds ) );
                     if( aPixBounds.IsInside( rPixPos ) )
                         aRet = rLower;
                 }
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 8217e0500ce7..4479ce52e38c 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -3224,17 +3224,17 @@ static void lcl_CorrectRectangle(tools::Rectangle & 
rRect,
                                             rInGrid.Bottom(), true) );
 }
 
-tools::Rectangle SwAccessibleMap::CoreToPixel( const tools::Rectangle& rRect ) 
const
+tools::Rectangle SwAccessibleMap::CoreToPixel( const SwRect& rRect ) const
 {
     tools::Rectangle aRect;
     if (const OutputDevice* pWin = GetShell()->GetWin()->GetOutDev())
     {
         MapMode aMapMode;
         GetMapMode( rRect.TopLeft(), aMapMode );
-        aRect = pWin->LogicToPixel( rRect, aMapMode );
+        aRect = pWin->LogicToPixel( rRect.SVRect(), aMapMode );
 
         tools::Rectangle aTmpRect = pWin->PixelToLogic( aRect, aMapMode );
-        lcl_CorrectRectangle(aRect, rRect, aTmpRect);
+        lcl_CorrectRectangle(aRect, rRect.SVRect(), aTmpRect);
     }
 
     return aRect;
diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 51645d24ab1e..555675d33473 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1134,10 +1134,10 @@ css::uno::Sequence< css::style::TabStop > 
SwAccessibleParagraph::GetCurrentTabSt
 
         SwRect aTmpRect(0, 0, tabs[0].Position, 0);
 
-        tools::Rectangle aScreenRect( GetMap()->CoreToPixel( aTmpRect.SVRect() 
));
+        tools::Rectangle aScreenRect( GetMap()->CoreToPixel( aTmpRect ));
         SwRect aFrameLogBounds( GetBounds( *(GetMap()) ) ); // twip rel to doc 
root
 
-        Point aFramePixPos( GetMap()->CoreToPixel( aFrameLogBounds.SVRect() 
).TopLeft() );
+        Point aFramePixPos( GetMap()->CoreToPixel( aFrameLogBounds ).TopLeft() 
);
         aScreenRect.Move( -aFramePixPos.X(), -aFramePixPos.Y() );
 
         tabs[0].Position = aScreenRect.GetWidth();
@@ -2081,10 +2081,10 @@ awt::Rectangle 
SwAccessibleParagraph::getCharacterBounds(
         throw uno::RuntimeException("no Window", 
static_cast<cppu::OWeakObject*>(this));
     }
 
-    tools::Rectangle aScreenRect( GetMap()->CoreToPixel( aCoreRect.SVRect() ));
+    tools::Rectangle aScreenRect( GetMap()->CoreToPixel( aCoreRect ));
     SwRect aFrameLogBounds( GetBounds( *(GetMap()) ) ); // twip rel to doc root
 
-    Point aFramePixPos( GetMap()->CoreToPixel( aFrameLogBounds.SVRect() 
).TopLeft() );
+    Point aFramePixPos( GetMap()->CoreToPixel( aFrameLogBounds ).TopLeft() );
     aScreenRect.Move( -aFramePixPos.getX(), -aFramePixPos.getY() );
 
     // convert into AWT Rectangle
@@ -2116,7 +2116,7 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const 
awt::Point& rPoint )
     }
     Point aPoint( rPoint.X, rPoint.Y );
     SwRect aLogBounds( GetBounds( *(GetMap()), GetFrame() ) ); // twip rel to 
doc root
-    Point aPixPos( GetMap()->CoreToPixel( aLogBounds.SVRect() ).TopLeft() );
+    Point aPixPos( GetMap()->CoreToPixel( aLogBounds ).TopLeft() );
     aPoint.setX(aPoint.getX() + aPixPos.getX());
     aPoint.setY(aPoint.getY() + aPixPos.getY());
     Point aCorePoint( GetMap()->PixelToCore( aPoint ) );
@@ -2515,7 +2515,7 @@ sal_Bool SwAccessibleParagraph::scrollSubstringTo( 
sal_Int32 nStartIndex,
 
     /* Offset the values relative to the view shell frame */
     SwRect aFrameLogBounds( GetBounds( *(GetMap()) ) ); // twip rel to doc root
-    Point aFramePixPos( GetMap()->CoreToPixel( aFrameLogBounds.SVRect() 
).TopLeft() );
+    Point aFramePixPos( GetMap()->CoreToPixel( aFrameLogBounds ).TopLeft() );
     sP += aFramePixPos;
     eP += aFramePixPos;
 
@@ -3309,10 +3309,10 @@ sal_Int32 SAL_CALL 
SwAccessibleParagraph::getNumberOfLineWithCaret()
                     throw uno::RuntimeException("no Window", 
static_cast<cppu::OWeakObject*>(this));
                 }
 
-                tools::Rectangle aScreenRect( GetMap()->CoreToPixel( 
aCursorCoreRect.SVRect() ));
+                tools::Rectangle aScreenRect( GetMap()->CoreToPixel( 
aCursorCoreRect ));
 
                 SwRect aFrameLogBounds( GetBounds( *(GetMap()) ) ); // twip 
rel to doc root
-                Point aFramePixPos( GetMap()->CoreToPixel( 
aFrameLogBounds.SVRect() ).TopLeft() );
+                Point aFramePixPos( GetMap()->CoreToPixel( aFrameLogBounds 
).TopLeft() );
                 aScreenRect.Move( -aFramePixPos.getX(), -aFramePixPos.getY() );
 
                 // convert into AWT Rectangle
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to