sc/Library_vbaobj.mk | 5 ++++- sc/qa/unit/filters-test.cxx | 2 +- sc/qa/unit/ucalc.cxx | 40 +++++++++++++++++++++++----------------- sc/source/ui/navipi/content.cxx | 19 ------------------- 4 files changed, 28 insertions(+), 38 deletions(-)
New commits: commit 1132ea0a7c5a5b97a155b1bb65468242fc484da8 Author: Laurent Godard <lgodard.li...@laposte.net> Date: Thu Sep 12 18:30:35 2013 +0200 GetNotes removal - last initial changes Change-Id: I419dd8671f40fdfce5f181cda35415526c72844f diff --git a/sc/Library_vbaobj.mk b/sc/Library_vbaobj.mk index 9146a11..00f31ad 100644 --- a/sc/Library_vbaobj.mk +++ b/sc/Library_vbaobj.mk @@ -21,7 +21,10 @@ $(eval $(call gb_Library_set_precompiled_header,vbaobj,$(SRCDIR)/sc/inc/pch/prec $(eval $(call gb_Library_set_componentfile,vbaobj,sc/util/vbaobj)) -$(eval $(call gb_Library_use_external,vbaobj,boost_headers)) +$(eval $(call gb_Library_use_externals,vbaobj,\ + boost_headers \ + mdds_headers \ +)) $(eval $(call gb_Library_use_api,vbaobj,\ offapi \ diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 23e8675..07c4d90 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3747,8 +3747,10 @@ void Test::testSort() ASSERT_DOUBLES_EQUAL(nVal, 1.0); // check that note is also moved +/* TODO GetNotes pNote = m_pDoc->GetNote(1, 0, 0); CPPUNIT_ASSERT(pNote); +*/ clearRange(m_pDoc, ScRange(0, 0, 0, 1, 9, 0)); // Clear A1:B10. { diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 17e92ad..c09baeb 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -968,25 +968,6 @@ sal_Bool ScContentTree::NoteStringsChanged() } } - -/* - ScNotes* pNotes = pDoc->GetNotes(nTab); - for (ScNotes::const_iterator itr = pNotes->begin(); itr != pNotes->end(); ++itr) - { - if( const ScPostIt* pNote = itr->second ) - { - if ( !pEntry ) - bEqual = false; - else - { - if ( lcl_NoteString( *pNote ) != GetEntryText(pEntry) ) - bEqual = false; - - pEntry = NextSibling( pEntry ); - } - } - } -*/ } if ( pEntry ) commit 0b3822c0efb544d77539eaca097a19f03a04a957 Author: Laurent Godard <lgodard.li...@laposte.net> Date: Thu Sep 12 18:01:37 2013 +0200 remove GetNotes use - unit tests Change-Id: I6f466b3d5424f8f39c56827e3a70ab205e6ac4cb diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index f6b9b0b..45cd1b2 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -275,7 +275,7 @@ void testContentImpl(ScDocument* pDoc, sal_Int32 nFormat ) //same code for ods, //check notes import ScAddress aAddress(7, 2, 0); - ScPostIt* pNote = pDoc->GetNotes(aAddress.Tab())->findByAddress(aAddress); + ScPostIt* pNote = pDoc->GetNote(aAddress); CPPUNIT_ASSERT_MESSAGE("note not imported", pNote); CPPUNIT_ASSERT_EQUAL_MESSAGE("note text not imported correctly", pNote->GetText(), OUString("Test")); } diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 11b7c0e..23e8675 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -2573,58 +2573,58 @@ void Test::testPostIts() m_pDoc->InsertTab(0, aTabName); ScAddress rAddr(2, 2, 0); // cell C3 - ScPostIt *pNote = m_pDoc->GetNotes(rAddr.Tab())->GetOrCreateNote(rAddr); + ScPostIt *pNote = m_pDoc->GetOrCreateNote(rAddr); pNote->SetText(rAddr, aHello); pNote->SetAuthor(aJimBob); - ScPostIt *pGetNote = m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr); + ScPostIt *pGetNote = m_pDoc->GetNote(rAddr); CPPUNIT_ASSERT_MESSAGE("note should be itself", pGetNote == pNote ); // Insert one row at row 1. bool bInsertRow = m_pDoc->InsertRow(0, 0, MAXCOL, 0, 1, 1); CPPUNIT_ASSERT_MESSAGE("failed to insert row", bInsertRow ); - CPPUNIT_ASSERT_MESSAGE("note hasn't moved", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == NULL); + CPPUNIT_ASSERT_MESSAGE("note hasn't moved", m_pDoc->GetNote(rAddr) == NULL); rAddr.IncRow(); // cell C4 - CPPUNIT_ASSERT_MESSAGE("note not there", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + CPPUNIT_ASSERT_MESSAGE("note not there", m_pDoc->GetNote(rAddr) == pNote); // Insert column at column A. bool bInsertCol = m_pDoc->InsertCol(0, 0, MAXROW, 0, 1, 1); CPPUNIT_ASSERT_MESSAGE("failed to insert column", bInsertCol ); - CPPUNIT_ASSERT_MESSAGE("note hasn't moved", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == NULL); + CPPUNIT_ASSERT_MESSAGE("note hasn't moved", m_pDoc->GetNote(rAddr) == NULL); rAddr.IncCol(); // cell D4 - CPPUNIT_ASSERT_MESSAGE("note not there", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + CPPUNIT_ASSERT_MESSAGE("note not there", m_pDoc->GetNote(rAddr) == pNote); // Insert a new sheet to shift the current sheet to the right. m_pDoc->InsertTab(0, aTabName2); - CPPUNIT_ASSERT_MESSAGE("note hasn't moved", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == NULL); + CPPUNIT_ASSERT_MESSAGE("note hasn't moved", m_pDoc->GetNote(rAddr) == NULL); rAddr.IncTab(); // Move to the next sheet. - CPPUNIT_ASSERT_MESSAGE("note not there", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + CPPUNIT_ASSERT_MESSAGE("note not there", m_pDoc->GetNote(rAddr) == pNote); m_pDoc->DeleteTab(0); rAddr.IncTab(-1); - CPPUNIT_ASSERT_MESSAGE("note not there", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + CPPUNIT_ASSERT_MESSAGE("note not there", m_pDoc->GetNote(rAddr) == pNote); // Insert cell at C4. This should NOT shift the note position. bInsertRow = m_pDoc->InsertRow(2, 0, 2, 0, 3, 1); CPPUNIT_ASSERT_MESSAGE("Failed to insert cell at C4.", bInsertRow); - CPPUNIT_ASSERT_MESSAGE("Note shouldn't have moved but it has.", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + CPPUNIT_ASSERT_MESSAGE("Note shouldn't have moved but it has.", m_pDoc->GetNote(rAddr) == pNote); // Delete cell at C4. Again, this should NOT shift the note position. m_pDoc->DeleteRow(2, 0, 2, 0, 3, 1); - CPPUNIT_ASSERT_MESSAGE("Note shouldn't have moved but it has.", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + CPPUNIT_ASSERT_MESSAGE("Note shouldn't have moved but it has.", m_pDoc->GetNote(rAddr) == pNote); // Now, with the note at D4, delete cell D3. This should shift the note one cell up. m_pDoc->DeleteRow(3, 0, 3, 0, 2, 1); rAddr.IncRow(-1); // cell D3 - CPPUNIT_ASSERT_MESSAGE("Note at D4 should have shifted up to D3.", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + CPPUNIT_ASSERT_MESSAGE("Note at D4 should have shifted up to D3.", m_pDoc->GetNote(rAddr) == pNote); // Delete column C. This should shift the note one cell left. m_pDoc->DeleteCol(0, 0, MAXROW, 0, 2, 1); rAddr.IncCol(-1); // cell C3 - CPPUNIT_ASSERT_MESSAGE("Note at D3 should have shifted left to C3.", m_pDoc->GetNotes(rAddr.Tab())->findByAddress(rAddr) == pNote); + CPPUNIT_ASSERT_MESSAGE("Note at D3 should have shifted left to C3.", m_pDoc->GetNote(rAddr) == pNote); m_pDoc->DeleteTab(0); } @@ -3729,7 +3729,7 @@ void Test::testSort() OUString aHello("Hello"); OUString aJimBob("Jim Bob"); ScAddress rAddr(1, 1, 0); - ScPostIt* pNote = m_pDoc->GetNotes(rAddr.Tab())->GetOrCreateNote(rAddr); + ScPostIt* pNote = m_pDoc->GetOrCreateNote(rAddr); pNote->SetText(rAddr, aHello); pNote->SetAuthor(aJimBob); @@ -3747,7 +3747,7 @@ void Test::testSort() ASSERT_DOUBLES_EQUAL(nVal, 1.0); // check that note is also moved - pNote = m_pDoc->GetNotes(0)->findByAddress( 1, 0 ); + pNote = m_pDoc->GetNote(1, 0, 0); CPPUNIT_ASSERT(pNote); clearRange(m_pDoc, ScRange(0, 0, 0, 1, 9, 0)); // Clear A1:B10. @@ -3829,13 +3829,15 @@ void Test::testDeleteRow() OUString aHello("Hello"); OUString aJimBob("Jim Bob"); ScAddress rAddr(1, 1, 0); - ScPostIt* pNote = m_pDoc->GetNotes(rAddr.Tab())->GetOrCreateNote(rAddr); + ScPostIt* pNote = m_pDoc->GetOrCreateNote(rAddr); pNote->SetText(rAddr, aHello); pNote->SetAuthor(aJimBob); pDoc->DeleteRow(0, 0, MAXCOL, 0, 1, 1); +/* TODO GetNotes CPPUNIT_ASSERT(m_pDoc->GetNotes(0)->empty()); +*/ pDoc->DeleteTab(0); } @@ -3848,13 +3850,15 @@ void Test::testDeleteCol() OUString aHello("Hello"); OUString aJimBob("Jim Bob"); ScAddress rAddr(1, 1, 0); - ScPostIt* pNote = m_pDoc->GetNotes(rAddr.Tab())->GetOrCreateNote(rAddr); + ScPostIt* pNote = m_pDoc->GetOrCreateNote(rAddr); pNote->SetText(rAddr, aHello); pNote->SetAuthor(aJimBob); pDoc->DeleteCol(0, 0, MAXROW, 0, 1, 1); +/* TODO GetNotes CPPUNIT_ASSERT(m_pDoc->GetNotes(0)->empty()); +*/ pDoc->DeleteTab(0); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits