diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-10-25 13:43:43 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-10-25 13:47:46 -0400 |
commit | 2091557777a5cc15c3b6fe3539d08cd821bd4669 (patch) | |
tree | 62e065c0ed2e8e5f5b5d596bbed076faf8a9e803 | |
parent | b5423ef42e18caac3ceb5d880ba1b6a1737e155c (diff) |
To destroy a cell instance, we need to call ScBaseCell::Delete().
We can't call delete on them directly, as their destructors are
intentionally not public. Instead, we need to call Delete().
-rw-r--r-- | sc/source/core/data/column.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/column3.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/validat.cxx | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 02e8bee7f42f..fc1178f4a622 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1610,7 +1610,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) memmove( &pItems[nStartPos], &pItems[nStopPos], (nCount - nStartPos) * sizeof(ColEntry) ); } - delete pNoteCell; + pNoteCell->Delete(); pItems[nCount].nRow = 0; pItems[nCount].pCell = NULL; } diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 8e8037a5914c..baa05185ce8e 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -222,7 +222,7 @@ void ScColumn::Delete( SCROW nRow ) } else { - delete pNoteCell; + pNoteCell->Delete(); --nCount; memmove( &pItems[nIndex], &pItems[nIndex + 1], (nCount - nIndex) * sizeof(ColEntry) ); pItems[nCount].nRow = 0; @@ -242,7 +242,7 @@ void ScColumn::DeleteAtIndex( SCSIZE nIndex ) pItems[nIndex].pCell = pNoteCell; // Dummy fuer Interpret pDocument->Broadcast( ScHint( SC_HINT_DYING, ScAddress( nCol, pItems[nIndex].nRow, nTab ), pCell ) ); - delete pNoteCell; + pNoteCell->Delete(); --nCount; memmove( &pItems[nIndex], &pItems[nIndex + 1], (nCount - nIndex) * sizeof(ColEntry) ); pItems[nCount].nRow = 0; diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index b6144ab119ab..31b4c4fac58d 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -528,8 +528,9 @@ sal_Bool ScValidationData::IsDataValid( ScBaseCell* pCell, const ScAddress& rPos if ( bOk ) { double nLenVal = (double) aString.Len(); - ScValueCell aTmpCell( nLenVal ); - bOk = IsCellValid( &aTmpCell, rPos ); + ScValueCell* pTmpCell = new ScValueCell( nLenVal ); + bOk = IsCellValid( pTmpCell, rPos ); + pTmpCell->Delete(); } break; |