diff options
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 3fd29334baaa..81f9b9ee5af3 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5518,12 +5518,12 @@ bool ScGridWindow::ContinueOnlineSpelling() SCROW nRow; ScRefCellValue* pCell = aIter.GetNext(nCol, nRow); SCROW nEndRow = 0; - bool bHidden = pDoc->RowHidden(nRow, nTab, nullptr, &nEndRow); + bool bHidden = pCell && pDoc->RowHidden(nRow, nTab, nullptr, &nEndRow); bool bSkip = pCell && (nRow < mpSpellCheckCxt->maPos.mnRow || bHidden); while (bSkip) { pCell = aIter.GetNext(nCol, nRow); - if (nRow > nEndRow) + if (pCell && nRow > nEndRow) { bHidden = pDoc->RowHidden(nRow, nTab, nullptr, &nEndRow); } @@ -5531,12 +5531,12 @@ bool ScGridWindow::ContinueOnlineSpelling() } SCCOL nEndCol = 0; - bHidden = pDoc->ColHidden(nCol, nTab, nullptr, &nEndCol); + bHidden = pCell && pDoc->ColHidden(nCol, nTab, nullptr, &nEndCol); bSkip = pCell && (nCol < mpSpellCheckCxt->maPos.mnCol || bHidden); while (bSkip) { pCell = aIter.GetNext(nCol, nRow); - if (nCol > nEndCol) + if (pCell && nCol > nEndCol) { bHidden = pDoc->ColHidden(nCol, nTab, nullptr, &nEndCol); } |