diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-16 13:16:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-17 14:29:06 +0200 |
commit | 6aec5d5a3a26bd973e46b6c593373e2f03f51a37 (patch) | |
tree | a36bfd3ef41ed5ec2a5266c7ee4139352bba1422 /sc/source/ui/docshell | |
parent | a78770c1935cabaafbb1d0bec258095b8899d25d (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/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 3a26bffadfa6..f98350f0963c 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4977,11 +4977,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo if (bRecord) { // test if the range contains other notes which also implies that we need an undo document - bool bHasNotes = false; - for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() ) - for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() ) - bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (rDoc.HasNote(aPos)); - + bool bHasNotes = rDoc.HasNote(nTab, nStartCol, nStartRow, nEndCol, nEndRow); if (!pUndoDoc) { pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); |