summaryrefslogtreecommitdiff
path: root/sc/source/core/data/document.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-16 13:16:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-17 14:29:06 +0200
commit6aec5d5a3a26bd973e46b6c593373e2f03f51a37 (patch)
treea36bfd3ef41ed5ec2a5266c7ee4139352bba1422 /sc/source/core/data/document.cxx
parenta78770c1935cabaafbb1d0bec258095b8899d25d (diff)
small perf improvement in checking for note
Change-Id: Ib92e04da47d910662eb765c9c68b561647570ecd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115673 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core/data/document.cxx')
-rw-r--r--sc/source/core/data/document.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index a0690931540c..29ce6fa3c77a 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6596,6 +6596,20 @@ bool ScDocument::HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab) const
return pNote != nullptr;
}
+bool ScDocument::HasNote(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow) const
+{
+ const ScTable* pTab = FetchTable(nTab);
+ if (!pTab)
+ return false;
+
+ nStartCol = pTab->ClampToAllocatedColumns(nStartCol);
+ nEndCol = pTab->ClampToAllocatedColumns(nEndCol);
+ for (SCCOL nCol = nStartCol; nCol < nEndCol; ++nCol)
+ if (pTab->aCol[nCol].HasCellNote(nStartRow, nEndRow))
+ return true;
+ return false;
+}
+
bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const
{
if (!ValidCol(nCol))