summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-25 19:44:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-26 08:42:27 +0200
commit56d7c40e87076fbce0a402dc56ed5a3d536c36a9 (patch)
treef255719bf6f83ecacb988db0f47de0ef4b31b09b /sw/source/core
parent399149155cf4f882541848ea53bfa5c9806b23f8 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/access/acccontext.cxx6
-rw-r--r--sw/source/core/access/accframe.cxx4
-rw-r--r--sw/source/core/access/accmap.cxx6
-rw-r--r--sw/source/core/access/accpara.cxx16
4 files changed, 16 insertions, 16 deletions
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