summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabview2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/tabview2.cxx')
-rw-r--r--sc/source/ui/view/tabview2.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index cf4770798a19..da36ab8dff66 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -578,8 +578,8 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
nBlockStartX = nBlockStartX + nBlockStartXOffset >= 0 ? nBlockStartX + nBlockStartXOffset : 0;
nBlockStartY = nBlockStartY + nBlockStartYOffset >= 0 ? nBlockStartY + nBlockStartYOffset : 0;
- nBlockEndX = nCurX + nCurXOffset > MAXCOL ? MAXCOL : nCurX + nCurXOffset;
- nBlockEndY = nCurY + nCurYOffset > MAXROW ? MAXROW : nCurY + nCurYOffset;
+ nBlockEndX = std::min<SCCOL>(nCurX + nCurXOffset, MAXCOL);
+ nBlockEndY = std::min(nCurY + nCurYOffset, MAXROW);
}
else
{