summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorSahil <me.sahilgautam@gmail.com>2023-11-29 15:38:10 +0530
committerMike Kaganski <mike.kaganski@collabora.com>2023-12-07 12:03:17 +0100
commit0e942c11e074244224a9968046da105dc62656e8 (patch)
tree066b305e62b525531efa16a5a0b84d1d12c7697d /sc/source/ui
parenta214ac677481883d31800bc2b67fd3a9c504319d (diff)
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.kaganski@collabora.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/tabview.hxx2
-rw-r--r--sc/source/ui/view/tabview3.cxx17
2 files changed, 9 insertions, 10 deletions
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 )