diff options
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/column4.cxx | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 9cecaccf510c..5a38c92fabfc 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -4980,6 +4980,12 @@ void Test::testNoteCopyPaste() CPPUNIT_ASSERT(pNote); CPPUNIT_ASSERT_EQUAL(OUString("Note2"), pNote->GetText()); + // Test that GetNotesInRange includes the end of its range + // and so can find the note + std::vector<sc::NoteEntry> aNotes; + m_pDoc->GetNotesInRange(ScRange(1,7,0), aNotes); + CPPUNIT_ASSERT_EQUAL(size_t(1), aNotes.size()); + m_pDoc->DeleteTab(0); } diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index e145e758dc76..6e8e4daa753c 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -701,7 +701,7 @@ void ScColumn::GetNotesInRange(SCROW nStartRow, SCROW nEndRow, maCellNotes.position(nEndRow); sc::CellNoteStoreType::const_iterator itEnd = aEndPos.first; - std::for_each(it, itEnd, NoteEntryCollector(rNotes, nTab, nCol, nStartRow, nEndRow)); + std::for_each(it, ++itEnd, NoteEntryCollector(rNotes, nTab, nCol, nStartRow, nEndRow)); } namespace { |