diff options
Diffstat (limited to 'sc/source/core/data')
-rw-r--r-- | sc/source/core/data/column2.cxx | 21 | ||||
-rw-r--r-- | sc/source/core/data/column3.cxx | 5 | ||||
-rw-r--r-- | sc/source/core/data/column4.cxx | 2 |
3 files changed, 25 insertions, 3 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 93f61a6f2b75..3f22a7329b6d 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1815,8 +1815,27 @@ void ScColumn::SetCellNote(SCROW nRow, ScPostIt* pNote) maCellNotes.set(nRow, pNote); } -void ScColumn::DeleteCellNotes( sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2 ) +namespace { +class ForgetCellNoteCaptionsHandler +{ + +public: + ForgetCellNoteCaptionsHandler() {} + + void operator() ( size_t /*nRow*/, ScPostIt* p ) + { + p->ForgetCaption(); + } +}; +} + +void ScColumn::DeleteCellNotes( sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2, bool bForgetCaptionOwnership ) { + if (bForgetCaptionOwnership) + { + ForgetCellNoteCaptionsHandler aFunc; + sc::ParseNote(maCellNotes.begin(), maCellNotes, nRow1, nRow2, aFunc); + } rBlockPos.miCellNotePos = maCellNotes.set_empty(rBlockPos.miCellNotePos, nRow1, nRow2); } diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index d50e4436222a..2b8bdac7332d 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -684,7 +684,10 @@ void ScColumn::DeleteArea( } if (nDelFlag & IDF_NOTE) - DeleteCellNotes(aBlockPos, nStartRow, nEndRow); + { + bool bForgetCaptionOwnership = ((nDelFlag & IDF_FORGETCAPTIONS) != IDF_NONE); + DeleteCellNotes(aBlockPos, nStartRow, nEndRow, bForgetCaptionOwnership); + } if ( nDelFlag & IDF_EDITATTR ) { diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index 63534c3aeae3..4de41943eb57 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -114,7 +114,7 @@ void ScColumn::DeleteBeforeCopyFromClip( } if (nDelFlag & IDF_NOTE) - DeleteCellNotes(aBlockPos, nRow1, nRow2); + DeleteCellNotes(aBlockPos, nRow1, nRow2, false); if (nDelFlag & IDF_EDITATTR) RemoveEditAttribs(nRow1, nRow2); |