diff options
-rw-r--r-- | sc/source/core/data/document.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index da23524ad344..f486e28139be 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -6420,11 +6420,16 @@ bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const bool ScDocument::HasTabNotes(SCTAB nTab) const { - bool hasNotes = false; - for (SCCOL nCol=0; nCol<MAXCOLCOUNT && !hasNotes; ++nCol) - hasNotes = HasColNotes(nCol, nTab); + const ScTable* pTab = FetchTable(nTab); + + if ( !pTab ) + return false; - return hasNotes; + for (SCCOL nCol=0, nColSize = pTab->aCol.size(); nCol < nColSize; ++nCol) + if ( HasColNotes(nCol, nTab) ) + return true; + + return false; } bool ScDocument::HasNotes() const |