Kaydet (Commit) a45973a9 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#77806: Check the boundaries before accessing an array....

Change-Id: I0878f734599f566cde83183947cd7613c0f8d5c6
üst cd87cd92
......@@ -6135,14 +6135,30 @@ bool ScDocument::HasNote(const ScAddress& rPos) const
{
return HasNote(rPos.Col(), rPos.Row(), rPos.Tab());
}
bool ScDocument::HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab) const
{
const ScPostIt* pNote = maTabs[nTab]->aCol[nCol].GetCellNote(nRow);
if (!ValidColRow(nCol, nRow))
return false;
const ScTable* pTab = FetchTable(nTab);
if (!pTab)
return false;
const ScPostIt* pNote = pTab->aCol[nCol].GetCellNote(nRow);
return pNote != NULL;
}
bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const
{
return maTabs[nTab]->aCol[nCol].HasCellNotes();
if (!ValidCol(nCol))
return false;
const ScTable* pTab = FetchTable(nTab);
if (!pTab)
return false;
return pTab->aCol[nCol].HasCellNotes();
}
bool ScDocument::HasTabNotes(SCTAB nTab) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment