From c06dbbe7594c2a0b5a5b19f8e183d9c421e6e094 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 23 Feb 2012 23:36:49 +0100 Subject: remove mpNote from ScBaseCell --- sc/source/ui/undo/undoblk3.cxx | 2 +- sc/source/ui/undo/undocell.cxx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sc/source/ui/undo') diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 00f3b6e850fe..3286614bb530 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -1210,7 +1210,7 @@ void ScUndoReplace::Undo() } else if (pSearchItem->GetCellType() == SVX_SEARCHIN_NOTE) { - ScPostIt* pNote = pDoc->GetNote( aCursorPos ); + ScPostIt* pNote = pDoc->GetNotes( aCursorPos.Tab() )->findByAddress( aCursorPos ); OSL_ENSURE( pNote, "ScUndoReplace::Undo - cell does not contain a note" ); if (pNote) pNote->SetText( aCursorPos, aUndoStr ); diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 114964220a19..a0198bb52c17 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -897,9 +897,9 @@ void ScUndoReplaceNote::DoInsertNote( const ScNoteData& rNoteData ) if( rNoteData.mpCaption ) { ScDocument& rDoc = *pDocShell->GetDocument(); - OSL_ENSURE( !rDoc.GetNote( maPos ), "ScUndoReplaceNote::DoInsertNote - unexpected cell note" ); + OSL_ENSURE( !rDoc.GetNotes( maPos.Tab() )->findByAddress(maPos), "ScUndoReplaceNote::DoInsertNote - unexpected cell note" ); ScPostIt* pNote = new ScPostIt( rDoc, maPos, rNoteData, false ); - rDoc.TakeNote( maPos, pNote ); + rDoc.GetNotes(maPos.Tab())->insert( maPos, pNote ); } } @@ -908,8 +908,8 @@ void ScUndoReplaceNote::DoRemoveNote( const ScNoteData& rNoteData ) if( rNoteData.mpCaption ) { ScDocument& rDoc = *pDocShell->GetDocument(); - OSL_ENSURE( rDoc.GetNote( maPos ), "ScUndoReplaceNote::DoRemoveNote - missing cell note" ); - if( ScPostIt* pNote = rDoc.ReleaseNote( maPos ) ) + OSL_ENSURE( rDoc.GetNotes( maPos.Tab() )->findByAddress(maPos), "ScUndoReplaceNote::DoRemoveNote - missing cell note" ); + if( ScPostIt* pNote = rDoc.GetNotes(maPos.Tab())->ReleaseNote( maPos ) ) { /* Forget pointer to caption object to suppress removing the caption object from the drawing layer while deleting pNote @@ -936,7 +936,7 @@ ScUndoShowHideNote::~ScUndoShowHideNote() void ScUndoShowHideNote::Undo() { BeginUndo(); - if( ScPostIt* pNote = pDocShell->GetDocument()->GetNote( maPos ) ) + if( ScPostIt* pNote = pDocShell->GetDocument()->GetNotes( maPos.Tab() )->findByAddress(maPos) ) pNote->ShowCaption( maPos, !mbShown ); EndUndo(); } @@ -944,7 +944,7 @@ void ScUndoShowHideNote::Undo() void ScUndoShowHideNote::Redo() { BeginRedo(); - if( ScPostIt* pNote = pDocShell->GetDocument()->GetNote( maPos ) ) + if( ScPostIt* pNote = pDocShell->GetDocument()->GetNotes( maPos.Tab() )->findByAddress(maPos) ) pNote->ShowCaption( maPos, mbShown ); EndRedo(); } -- cgit