sw/source/core/access/accmap.cxx |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 8a8058a63b1cc88b252021b5229cabc5b1e64da6
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Jan 22 20:04:15 2020 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Jan 23 09:52:18 2020 +0100

    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 <caol...@redhat.com>

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);
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to