diff options
author | jailletc36 <christophe.jaillet@wanadoo.fr> | 2012-11-11 11:51:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-11-14 16:48:17 +0000 |
commit | de51745f588a2e2aa933e4c33fae3d9a10385eb1 (patch) | |
tree | a15f8d5c02080f32df73bf2bbf13170bc7b8ac04 /sc | |
parent | 5b1fcd5262f087e3d1cabb240d1761064baeafc6 (diff) |
Turn some memmove into memcpy when it is safe to do so.
Most of the changes are related to newly allocated memory, so we are
sure it can not overlap with the source of the copy.
Change-Id: Ie6ccf1bbb07b792fb18601a38dfaa55755d14b7d
Signed-off-by: jailletc36 <christophe.jaillet@wanadoo.fr>
Reviewed-on: https://gerrit.libreoffice.org/1033
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/markarr.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/consoli.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/starcalc/collect.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx index 2e57f02d1e35..1970700b2b14 100644 --- a/sc/source/core/data/markarr.cxx +++ b/sc/source/core/data/markarr.cxx @@ -300,7 +300,7 @@ void ScMarkArray::CopyMarksTo( ScMarkArray& rDestMarkArray ) const if (pData) { rDestMarkArray.pData = new ScMarkEntry[nCount]; - memmove( rDestMarkArray.pData, pData, nCount * sizeof(ScMarkEntry) ); + memcpy( rDestMarkArray.pData, pData, nCount * sizeof(ScMarkEntry) ); } else rDestMarkArray.pData = NULL; diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx index 2ad21525fd10..649f1771f150 100644 --- a/sc/source/core/tool/consoli.cxx +++ b/sc/source/core/tool/consoli.cxx @@ -63,7 +63,7 @@ void ScReferenceList::AddEntry( SCCOL nCol, SCROW nRow, SCTAB nTab ) pData = new ScReferenceEntry[ nFullSize+1 ]; if (pOldData) { - memmove( pData, pOldData, nCount * sizeof(ScReferenceEntry) ); + memcpy( pData, pOldData, nCount * sizeof(ScReferenceEntry) ); delete[] pOldData; } while (nCount < nFullSize) @@ -87,7 +87,7 @@ static void lcl_AddString( String**& pData, T& nCount, const String& rInsert ) pData = new String*[ nCount+1 ]; if (pOldData) { - memmove( pData, pOldData, nCount * sizeof(String*) ); + memcpy( pData, pOldData, nCount * sizeof(String*) ); delete[] pOldData; } pData[nCount] = new String(rInsert); diff --git a/sc/source/filter/starcalc/collect.cxx b/sc/source/filter/starcalc/collect.cxx index b56faec22dc0..e825289f691a 100644 --- a/sc/source/filter/starcalc/collect.cxx +++ b/sc/source/filter/starcalc/collect.cxx @@ -102,7 +102,7 @@ sal_Bool ScCollection::AtInsert(sal_uInt16 nIndex, ScDataObject* pScDataObject) if (!pNewItems) return false; nLimit = sal::static_int_cast<sal_uInt16>( nLimit + nDelta ); - memmove(pNewItems, pItems, nCount * sizeof(ScDataObject*)); + memcpy(pNewItems, pItems, nCount * sizeof(ScDataObject*)); delete[] pItems; pItems = pNewItems; } diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 8b13ebd501d2..22f6eccf4120 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2066,7 +2066,7 @@ void ScViewFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOLROW } pUndoRanges = new SCCOLROW[ 2*nRangeCnt ]; - memmove( pUndoRanges, pRanges, 2*nRangeCnt*sizeof(SCCOLROW) ); + memcpy( pUndoRanges, pRanges, 2*nRangeCnt*sizeof(SCCOLROW) ); //! outlines from all tab? ScOutlineTable* pTable = pDoc->GetOutlineTable( nCurTab ); |