sc/source/ui/inc/tabview.hxx   |    2 +-
 sc/source/ui/view/tabview3.cxx |   17 ++++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 0e942c11e074244224a9968046da105dc62656e8
Author:     Sahil <me.sahilgau...@gmail.com>
AuthorDate: Wed Nov 29 15:38:10 2023 +0530
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Thu Dec 7 12:03:17 2023 +0100

    tdf#33201 Move Cell position logic inside the function
    
    Previously to Highlight some cell's row/column, one had to
    get the current cell cursor position, and pass it to HighlightOverlay(),
    but now that is not required.
    
    Change-Id: I4d08bf1fa84fcbd4820fd166c1d137bd3d950413
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160151
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 8c69933cc1af..23419f463923 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -566,7 +566,7 @@ public:
      * @param nModifier: 0, KEY_SHIFT, KEY_MOD1, KEY_SHIFT | KEY_MOD1
      */
     void            MarkRows(SCROW nRow, sal_Int16 nModifier);
-    void            HighlightOverlay(const ScAddress& rCell);
+    void            HighlightOverlay();
 
     void            MarkDataArea( bool bIncludeCursor = true );
     void            MarkMatrixFormula();
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 96209c1a123d..4a78aa38e710 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -376,8 +376,7 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool 
bNew )
 
     if ( !(nPosX != nOldX || nPosY != nOldY || bNew) )
     {
-        ScAddress aCell = GetViewData().GetCurPos();
-        HighlightOverlay(aCell);
+        HighlightOverlay();
         return;
     }
 
@@ -395,8 +394,7 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool 
bNew )
 
     ShowAllCursors();
 
-    ScAddress aCell = aViewData.GetCurPos();
-    HighlightOverlay(aCell);
+    HighlightOverlay();
 
     CursorPosChanged();
 
@@ -1692,7 +1690,7 @@ void ScTabView::MarkRows(SCROW nRow, sal_Int16 nModifier)
     }
 }
 
-void ScTabView::HighlightOverlay(const ScAddress& rCell)
+void ScTabView::HighlightOverlay()
 {
     if 
(!officecfg::Office::Calc::Content::Display::ColumnRowHighlighting::get())
     {
@@ -1701,15 +1699,16 @@ void ScTabView::HighlightOverlay(const ScAddress& rCell)
         return;
     }
 
-    SCROW nRow = rCell.Row();
-    SCCOL nCol = rCell.Col();
+    ScAddress aCell = GetViewData().GetCurPos();
+    SCROW nRow = aCell.Row();
+    SCCOL nCol = aCell.Col();
 
     bool nModifier = false;         // modifier key pressed?
     DoneBlockModeHighlight( nModifier );
-    InitBlockModeHighlight( nCol, 0, rCell.Tab(), true, false);
+    InitBlockModeHighlight( nCol, 0, aCell.Tab(), true, false);
     nModifier = true;
     DoneBlockModeHighlight( nModifier );
-    InitBlockModeHighlight( 0, nRow, rCell.Tab(), false, true );
+    InitBlockModeHighlight( 0, nRow, aCell.Tab(), false, true );
 }
 
 void ScTabView::MarkDataArea( bool bIncludeCursor )

Reply via email to