sw/inc/accmap.hxx                |    7 ++-----
 sw/source/core/access/accmap.cxx |   17 ++++++-----------
 2 files changed, 8 insertions(+), 16 deletions(-)

New commits:
commit 2cedb1a19ad605df4e148589e9027512e4dd9265
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Jan 26 18:37:11 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Jan 26 22:12:22 2024 +0100

    sw a11y: Return MapMode instead of using out param
    
    Change-Id: I116e006e3fcdb3c6993adf7c99860bdd952af6e0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162633
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 9daf15b8ae07..d99d8dc16c7a 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -297,12 +297,9 @@ private:
         input parameter - constant reference to point to determine the mapping
         mode adjustments for page/print preview.
 
-        @param _orMapMode
-        output parameter - reference to the mapping mode, which is determined
-        by the method
+        @return mapping mode, which is determined by the method
     */
-    void GetMapMode( const Point& _rPoint,
-                     MapMode&     _orMapMode ) const;
+    MapMode GetMapMode(const Point& _rPoint) const;
 public:
     virtual bool IsDocumentSelAll() override;
 };
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index aa34fdf2d568..704dac005566 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2949,8 +2949,7 @@ Point SwAccessibleMap::LogicToPixel( const Point& rPoint 
) const
     Point aPoint = o3tl::toTwips( rPoint, o3tl::Length::mm100 );
     if (const vcl::Window* pWin = GetShell()->GetWin())
     {
-        MapMode aMapMode;
-        GetMapMode( aPoint, aMapMode );
+        const MapMode aMapMode = GetMapMode(aPoint);
         aPoint = pWin->LogicToPixel( aPoint, aMapMode );
         aPoint = Point(pWin->OutputToAbsoluteScreenPixel( aPoint ));
     }
@@ -2963,8 +2962,7 @@ Size SwAccessibleMap::LogicToPixel( const Size& rSize ) 
const
     Size aSize( o3tl::toTwips( rSize, o3tl::Length::mm100 ) );
     if (const OutputDevice* pWin = GetShell()->GetWin()->GetOutDev())
     {
-        MapMode aMapMode;
-        GetMapMode( Point(0,0), aMapMode );
+        const MapMode aMapMode = GetMapMode(Point(0, 0));
         aSize = pWin->LogicToPixel( aSize, aMapMode );
     }
 
@@ -3073,8 +3071,7 @@ Point SwAccessibleMap::PixelToCore( const Point& rPoint ) 
const
     Point aPoint;
     if (const OutputDevice* pWin = GetShell()->GetWin()->GetOutDev())
     {
-        MapMode aMapMode;
-        GetMapMode( rPoint, aMapMode );
+        const MapMode aMapMode = GetMapMode(rPoint);
         aPoint = pWin->PixelToLogic( rPoint, aMapMode );
     }
     return aPoint;
@@ -3118,8 +3115,7 @@ tools::Rectangle SwAccessibleMap::CoreToPixel( const 
SwRect& rRect ) const
     tools::Rectangle aRect;
     if (const OutputDevice* pWin = GetShell()->GetWin()->GetOutDev())
     {
-        MapMode aMapMode;
-        GetMapMode( rRect.TopLeft(), aMapMode );
+        const MapMode aMapMode = GetMapMode(rRect.TopLeft());
         aRect = pWin->LogicToPixel( rRect.SVRect(), aMapMode );
 
         tools::Rectangle aTmpRect = pWin->PixelToLogic( aRect, aMapMode );
@@ -3137,8 +3133,7 @@ tools::Rectangle SwAccessibleMap::CoreToPixel( const 
SwRect& rRect ) const
     output device for mapping logic document positions to page preview window
     positions and vice versa and doesn't take care to recover its changes.
 */
-void SwAccessibleMap::GetMapMode( const Point& _rPoint,
-                                  MapMode&     _orMapMode ) const
+MapMode SwAccessibleMap::GetMapMode(const Point& _rPoint) const
 {
     MapMode aMapMode = GetShell()->GetWin()->GetMapMode();
     if( GetShell()->IsPreview() )
@@ -3146,7 +3141,7 @@ void SwAccessibleMap::GetMapMode( const Point& _rPoint,
         assert(mpPreview != nullptr);
         mpPreview->AdjustMapMode( aMapMode, _rPoint );
     }
-    _orMapMode = aMapMode;
+    return aMapMode;
 }
 
 Size SwAccessibleMap::GetPreviewPageSize(sal_uInt16 const nPreviewPageNum) 
const

Reply via email to