Kaydet (Commit) 16f8e1c3 authored tarafından Pranav Kant's avatar Pranav Kant

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
üst 6de3688c
...@@ -4092,11 +4092,9 @@ sal_Int32 SAL_CALL ScAnnotationsObj::getCount() ...@@ -4092,11 +4092,9 @@ sal_Int32 SAL_CALL ScAnnotationsObj::getCount()
sal_Int32 nCount = 0; sal_Int32 nCount = 0;
if (pDocShell) if (pDocShell)
{ {
ScDocument& rDoc = pDocShell->GetDocument(); const ScDocument& rDoc = pDocShell->GetDocument();
const ScRangeList aRangeList( ScRange( 0, 0, nTab, MAXCOL, MAXROW, nTab) ); for (SCCOL nCol = 0; nCol <= MAXCOL; ++nCol)
std::vector<sc::NoteEntry> rNotes; nCount += rDoc.GetNoteCount(nTab, nCol);
rDoc.GetNotesInRange(aRangeList, rNotes);
nCount = rNotes.size();
} }
return nCount; return nCount;
} }
......
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