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()
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;
}
......
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