summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-22 20:04:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-23 09:52:18 +0100
commit8a8058a63b1cc88b252021b5229cabc5b1e64da6 (patch)
tree469a1aa16083330ec7160c60a1c1321465670fc1 /sw
parenta8b5f7d4a40c6cd3eb93506d936c5cbedf327fbd (diff)
no need for repetitive GetShell()->GetWin() calls
Change-Id: I2c0a136db685e67b5981a0162619521d7f2070cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87216 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/access/accmap.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 0662ec7ddf26..47b66565c93a 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -3104,8 +3104,7 @@ Point SwAccessibleMap::LogicToPixel( const Point& rPoint ) const
MapMode aDest( MapUnit::MapTwip );
Point aPoint = OutputDevice::LogicToLogic( rPoint, aSrc, aDest );
- vcl::Window *pWin = GetShell()->GetWin();
- if( pWin )
+ if (const vcl::Window* pWin = GetShell()->GetWin())
{
MapMode aMapMode;
GetMapMode( aPoint, aMapMode );
@@ -3121,11 +3120,11 @@ Size SwAccessibleMap::LogicToPixel( const Size& rSize ) const
MapMode aSrc( MapUnit::Map100thMM );
MapMode aDest( MapUnit::MapTwip );
Size aSize( OutputDevice::LogicToLogic( rSize, aSrc, aDest ) );
- if( GetShell()->GetWin() )
+ if (const OutputDevice* pWin = GetShell()->GetWin())
{
MapMode aMapMode;
GetMapMode( Point(0,0), aMapMode );
- aSize = GetShell()->GetWin()->LogicToPixel( aSize, aMapMode );
+ aSize = pWin->LogicToPixel( aSize, aMapMode );
}
return aSize;
@@ -3240,11 +3239,11 @@ css::uno::Reference< XAccessible >
Point SwAccessibleMap::PixelToCore( const Point& rPoint ) const
{
Point aPoint;
- if( GetShell()->GetWin() )
+ if (const OutputDevice* pWin = GetShell()->GetWin())
{
MapMode aMapMode;
GetMapMode( rPoint, aMapMode );
- aPoint = GetShell()->GetWin()->PixelToLogic( rPoint, aMapMode );
+ aPoint = pWin->PixelToLogic( rPoint, aMapMode );
}
return aPoint;
}
@@ -3285,13 +3284,13 @@ static void lcl_CorrectRectangle(tools::Rectangle & rRect,
tools::Rectangle SwAccessibleMap::CoreToPixel( const tools::Rectangle& rRect ) const
{
tools::Rectangle aRect;
- if( GetShell()->GetWin() )
+ if (const OutputDevice* pWin = GetShell()->GetWin())
{
MapMode aMapMode;
GetMapMode( rRect.TopLeft(), aMapMode );
- aRect = GetShell()->GetWin()->LogicToPixel( rRect, aMapMode );
+ aRect = pWin->LogicToPixel( rRect, aMapMode );
- tools::Rectangle aTmpRect = GetShell()->GetWin()->PixelToLogic( aRect, aMapMode );
+ tools::Rectangle aTmpRect = pWin->PixelToLogic( aRect, aMapMode );
lcl_CorrectRectangle(aRect, rRect, aTmpRect);
}