tdf#50916 Make sure that we don't access aCol out of range
Change-Id: Ib41b474c6ae573ca68614aeff8ca2cda5fd52dbc Reviewed-on: https://gerrit.libreoffice.org/33061 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
committed by
Markus Mohrhard
parent
91f8766db5
commit
4f6d6d905f
@@ -6420,11 +6420,16 @@ bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const
|
|||||||
|
|
||||||
bool ScDocument::HasTabNotes(SCTAB nTab) const
|
bool ScDocument::HasTabNotes(SCTAB nTab) const
|
||||||
{
|
{
|
||||||
bool hasNotes = false;
|
const ScTable* pTab = FetchTable(nTab);
|
||||||
for (SCCOL nCol=0; nCol<MAXCOLCOUNT && !hasNotes; ++nCol)
|
|
||||||
hasNotes = HasColNotes(nCol, nTab);
|
|
||||||
|
|
||||||
return hasNotes;
|
if ( !pTab )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (SCCOL nCol=0, nColSize = pTab->aCol.size(); nCol < nColSize; ++nCol)
|
||||||
|
if ( HasColNotes(nCol, nTab) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScDocument::HasNotes() const
|
bool ScDocument::HasNotes() const
|
||||||
|
Reference in New Issue
Block a user