summaryrefslogtreecommitdiff
path: root/sc/source/core/data/document.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/document.cxx')
-rw-r--r--sc/source/core/data/document.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 8c69412d1beb..47164be8c49f 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6113,14 +6113,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