diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-02-08 15:43:42 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-02-16 10:05:25 +0530 |
commit | 16f8e1c398870870ed4ea4f90cd521f1885a1345 (patch) | |
tree | b09ee709a959746b1ed4e30f1da15693e01efab0 /sc/source/ui | |
parent | 6de3688cc6bd52ce08ff8a4327e59dbbc8a5c7d4 (diff) |
sc: Use less expensive alternative to count total notes
No need to fill the vector unnecessarily when we are just concerned
about the total count.
Change-Id: I94d7cd6dd86e612edc078f7b70c051d67b787a5a
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 41b7c48b98d8..2c43888f84d3 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -4092,11 +4092,9 @@ sal_Int32 SAL_CALL ScAnnotationsObj::getCount() sal_Int32 nCount = 0; if (pDocShell) { - ScDocument& rDoc = pDocShell->GetDocument(); - const ScRangeList aRangeList( ScRange( 0, 0, nTab, MAXCOL, MAXROW, nTab) ); - std::vector<sc::NoteEntry> rNotes; - rDoc.GetNotesInRange(aRangeList, rNotes); - nCount = rNotes.size(); + const ScDocument& rDoc = pDocShell->GetDocument(); + for (SCCOL nCol = 0; nCol <= MAXCOL; ++nCol) + nCount += rDoc.GetNoteCount(nTab, nCol); } return nCount; } |