changeset 29834:87925a935c7d

pass arguments by reference to main_window::get_screen_geometry * main-window.h, main-window.cc (main_window::get_screen_geometry): Pass height and width by reference. Change all uses.
author John W. Eaton <jwe@octave.org>
date Sat, 26 Jun 2021 07:05:12 -0400
parents f0da0d901d8e
children a946d742fb97
files libgui/src/main-window.cc libgui/src/main-window.h
diffstat 2 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Tue Jun 29 05:49:14 2021 -0400
+++ b/libgui/src/main-window.cc	Sat Jun 26 07:05:12 2021 -0400
@@ -896,7 +896,7 @@
         browser->document ()->adjustSize ();
 
         int win_x, win_y;
-        get_screen_geometry (&win_x, &win_y);
+        get_screen_geometry (win_x, win_y);
 
         m_release_notes_window->resize (win_x*2/5, win_y*2/3);
         m_release_notes_window->move (20, 20);  // move to the top left corner
@@ -2857,13 +2857,12 @@
   }
 
   // Get size of screen where the main window is located
-  void main_window::get_screen_geometry (int *width, int *height)
+  void main_window::get_screen_geometry (int& width, int& height)
   {
-    QRect screen_geometry
-        = QApplication::desktop ()->availableGeometry (this);
-
-    *width = screen_geometry.width ();
-    *height = screen_geometry.height ();
+    QRect screen_geometry = QApplication::desktop ()->availableGeometry (this);
+
+    width = screen_geometry.width ();
+    height = screen_geometry.height ();
   }
 
   void main_window::resize_dock (QDockWidget *dw, int width, int height)
@@ -2891,7 +2890,7 @@
   void main_window::set_default_geometry ()
   {
     int win_x, win_y;
-    get_screen_geometry (&win_x, &win_y);
+    get_screen_geometry (win_x, win_y);
 
     move (0, 0);
     resize (2*win_x/3, 7*win_y/8);
--- a/libgui/src/main-window.h	Tue Jun 29 05:49:14 2021 -0400
+++ b/libgui/src/main-window.h	Sat Jun 26 07:05:12 2021 -0400
@@ -299,7 +299,7 @@
 
     void update_default_encoding (const QString& default_encoding);
 
-    void get_screen_geometry (int *width, int *height);
+    void get_screen_geometry (int& width, int& height);
     void set_default_geometry (void);
     void resize_dock (QDockWidget *dw, int width, int height);