summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/docshell/docsh3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/docshell/docsh3.cxx')
-rw-r--r--sc/source/ui/docshell/docsh3.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 96546d11a5..4634c5cbf1 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -118,6 +118,9 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sa
SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = std::min<SCTAB>(nMaxTab, rRange.aEnd.Tab());
+ if (nTab1 < 0 || nTab2 < 0)
+ continue;
+
if (!m_pDocument->ValidCol(nCol1)) nCol1 = m_pDocument->MaxCol();
if (!m_pDocument->ValidRow(nRow1)) nRow1 = m_pDocument->MaxRow();
if (!m_pDocument->ValidCol(nCol2)) nCol2 = m_pDocument->MaxCol();