summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorjailletc36 <christophe.jaillet@wanadoo.fr>2012-11-10 11:25:34 +0100
committerEike Rathke <erack@redhat.com>2012-11-13 13:57:26 +0000
commitc5aa953e005709c113f6ac11b9028e0a551a84eb (patch)
tree26b55bf601d6941fea9573c0094c5b2eeaa7454d /sc
parent000928b3b38fa7cdd3bca90419ed680eb59ad646 (diff)
bcppCheck: redundant assignment and Possible null pointer dereference.
I also turned a memmove into a memcpy. The 2 memory areas can not overlap. Change-Id: Id4f984f9eb5dea1ba59631281d6967d259948e5b Reviewed-on: https://gerrit.libreoffice.org/1015 Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docfunc.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 2c53a44e2a8c..fff492f15468 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3094,8 +3094,6 @@ bool ScDocFunc::SetTabBgColor(
static sal_uInt16 lcl_GetOptimalColWidth( ScDocShell& rDocShell, SCCOL nCol, SCTAB nTab, sal_Bool bFormula )
{
- sal_uInt16 nTwips = 0;
-
ScSizeDeviceProvider aProv(&rDocShell);
OutputDevice* pDev = aProv.GetDevice(); // has pixel MapMode
double nPPTX = aProv.GetPPTX();
@@ -3103,8 +3101,8 @@ static sal_uInt16 lcl_GetOptimalColWidth( ScDocShell& rDocShell, SCCOL nCol, SCT
ScDocument* pDoc = rDocShell.GetDocument();
Fraction aOne(1,1);
- nTwips = pDoc->GetOptimalColWidth( nCol, nTab, pDev, nPPTX, nPPTY, aOne, aOne,
- bFormula, NULL );
+ sal_uInt16 nTwips = pDoc->GetOptimalColWidth( nCol, nTab, pDev, nPPTX, nPPTY, aOne, aOne,
+ bFormula, NULL );
return nTwips;
}
@@ -3161,7 +3159,7 @@ sal_Bool ScDocFunc::SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOL
}
pUndoRanges = new SCCOLROW[ 2*nRangeCnt ];
- memmove( pUndoRanges, pRanges, 2*nRangeCnt*sizeof(SCCOLROW) );
+ memcpy( pUndoRanges, pRanges, 2*nRangeCnt*sizeof(SCCOLROW) );
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
@@ -5097,9 +5095,9 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
if(nOldFormat)
{
ScConditionalFormat* pOldFormat = pDoc->GetCondFormList(nTab)->GetFormat(nOldFormat);
- pRepaintRange.reset(new ScRange( pOldFormat->GetRange().Combine() ));
if(pOldFormat)
{
+ pRepaintRange.reset(new ScRange( pOldFormat->GetRange().Combine() ));
RemoveCondFormatAttributes(pDoc, pOldFormat, nTab);
}