diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-12-08 12:08:12 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-12-08 12:08:12 +0100 |
commit | e2227a4f4894612a9eee7deea44c9632d50314a4 (patch) | |
tree | 7db8698b4b181b3731d2ac5bb1ae7c9d420832ed /sc | |
parent | a238c829b209d0708714aa753fb686525411825f (diff) |
Avoid using uninitialized nCol, nRow
...when aIter.GetNext returned null; found by Valgrind'ing JunitTest_sc_unoapi_4
Change-Id: Ia94928f78d0512755ee6d788b0470dea34b2a9a7
Diffstat (limited to 'sc')
-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); } |