diff options
author | Eike Rathke <erack@redhat.com> | 2017-02-24 15:30:24 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-02-24 15:24:28 +0000 |
commit | 5d9f7548bcf842c613c26e5ab192199b415e6004 (patch) | |
tree | dfa106679c99d7650d180505a47bc0d1b6359458 /sc/source/ui/undo | |
parent | maybe try ROUNDSIG(...,9) ...? (diff) | |
download | core-5d9f7548bcf842c613c26e5ab192199b415e6004.tar.gz core-5d9f7548bcf842c613c26e5ab192199b415e6004.zip |
a first stab against the note caption ownership mess
This should not change any existing behavior, but may help tracking down
what happens where and when. The final goal is to let ScCaptionPtr also
handle deletion of caption objects once they're unreferenced and guard
against dangling pointers and double delete, and/or to manage transfer
of ownership to the drawing layer. Further improvement to the structure
could involve a head data element so that the duplicated (and unused
except in head) mnRefs field could be eliminated and the walk simplified
when removing an element from the list.
Change-Id: Ifbb2fb1d9dc4d2594a1eae2a8489270dd1fe0d0c
Reviewed-on: https://gerrit.libreoffice.org/34616
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r-- | sc/source/ui/undo/undocell.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 8c3555b14440..ddd0ebdb66a9 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -708,7 +708,7 @@ ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rP maPos( rPos ), mpDrawUndo( pDrawUndo ) { - OSL_ENSURE( rNoteData.mpCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note caption" ); + OSL_ENSURE( rNoteData.mxCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note caption" ); (bInsert ? maNewData : maOldData) = rNoteData; } @@ -720,7 +720,7 @@ ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rP maNewData( rNewData ), mpDrawUndo( pDrawUndo ) { - OSL_ENSURE( maOldData.mpCaption || maNewData.mpCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note captions" ); + OSL_ENSURE( maOldData.mxCaption || maNewData.mxCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note captions" ); OSL_ENSURE( !maOldData.mxInitData.get() && !maNewData.mxInitData.get(), "ScUndoReplaceNote::ScUndoReplaceNote - unexpected unitialized note" ); } @@ -766,13 +766,13 @@ bool ScUndoReplaceNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const OUString ScUndoReplaceNote::GetComment() const { - return ScGlobal::GetRscString( maNewData.mpCaption ? - (maOldData.mpCaption ? STR_UNDO_EDITNOTE : STR_UNDO_INSERTNOTE) : STR_UNDO_DELETENOTE ); + return ScGlobal::GetRscString( maNewData.mxCaption ? + (maOldData.mxCaption ? STR_UNDO_EDITNOTE : STR_UNDO_INSERTNOTE) : STR_UNDO_DELETENOTE ); } void ScUndoReplaceNote::DoInsertNote( const ScNoteData& rNoteData ) { - if( rNoteData.mpCaption ) + if( rNoteData.mxCaption ) { ScDocument& rDoc = pDocShell->GetDocument(); OSL_ENSURE( !rDoc.GetNote(maPos), "ScUndoReplaceNote::DoInsertNote - unexpected cell note" ); @@ -783,7 +783,7 @@ void ScUndoReplaceNote::DoInsertNote( const ScNoteData& rNoteData ) void ScUndoReplaceNote::DoRemoveNote( const ScNoteData& rNoteData ) { - if( rNoteData.mpCaption ) + if( rNoteData.mxCaption ) { ScDocument& rDoc = pDocShell->GetDocument(); OSL_ENSURE( rDoc.GetNote(maPos), "ScUndoReplaceNote::DoRemoveNote - missing cell note" ); |