[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Oct 25 10:47:56 PDT 2011
sc/source/core/data/column.cxx | 2 +-
sc/source/core/data/column3.cxx | 4 ++--
sc/source/core/data/validat.cxx | 5 +++--
3 files changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 2091557777a5cc15c3b6fe3539d08cd821bd4669
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Oct 25 13:43:43 2011 -0400
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().
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 02e8bee..fc1178f 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 8e8037a..baa0518 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 b6144ab..31b4c4f 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;
More information about the Libreoffice-commits
mailing list