Kaydet (Commit) af611617 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Bit of a cleanup.

Change-Id: I814ab7e55119a28bd52a8da7f21c03ff44c73e33
üst a995462e
...@@ -1267,7 +1267,6 @@ void ScTable::FillAutoSimple( ...@@ -1267,7 +1267,6 @@ void ScTable::FillAutoSimple(
sal_Int32 nStringValue = 0; sal_Int32 nStringValue = 0;
OUString aValue; OUString aValue;
ScCellValue aSrcCell; ScCellValue aSrcCell;
CellType eCellType = CELLTYPE_NONE;
bool bIsOrdinalSuffix = false; bool bIsOrdinalSuffix = false;
bool bColHidden = false, bRowHidden = false; bool bColHidden = false, bRowHidden = false;
...@@ -1287,19 +1286,18 @@ void ScTable::FillAutoSimple( ...@@ -1287,19 +1286,18 @@ void ScTable::FillAutoSimple(
if ( bGetCell ) if ( bGetCell )
{ {
if (bVertical) // rInner&:=nRow, rOuter&:=nCol if (bVertical) // rInner&:=nRow, rOuter&:=nCol
aSrcCell = aCol[rCol].GetCellValue(static_cast<SCROW>(nSource)); aSrcCell = aCol[rCol].GetCellValue(nSource);
else // rInner&:=nCol, rOuter&:=nRow else // rInner&:=nCol, rOuter&:=nRow
aSrcCell = aCol[nSource].GetCellValue(static_cast<SCROW>(rRow)); aSrcCell = aCol[nSource].GetCellValue(rRow);
bGetCell = false; bGetCell = false;
if (!aSrcCell.isEmpty()) if (!aSrcCell.isEmpty())
{ {
eCellType = aSrcCell.meType; switch (aSrcCell.meType)
switch (eCellType)
{ {
case CELLTYPE_STRING: case CELLTYPE_STRING:
case CELLTYPE_EDIT: case CELLTYPE_EDIT:
if ( eCellType == CELLTYPE_STRING ) if (aSrcCell.meType == CELLTYPE_STRING)
aValue = aSrcCell.mpString->getString(); aValue = aSrcCell.mpString->getString();
else else
aValue = ScEditUtil::GetString(*aSrcCell.mpEditText, pDocument); aValue = ScEditUtil::GetString(*aSrcCell.mpEditText, pDocument);
...@@ -1319,14 +1317,12 @@ void ScTable::FillAutoSimple( ...@@ -1319,14 +1317,12 @@ void ScTable::FillAutoSimple(
} }
} }
} }
else
eCellType = CELLTYPE_NONE;
} }
switch (eCellType) switch (aSrcCell.meType)
{ {
case CELLTYPE_VALUE: case CELLTYPE_VALUE:
aCol[rCol].SetValue(static_cast<SCROW>(rRow), aSrcCell.mfValue + nDelta); aCol[rCol].SetValue(rRow, aSrcCell.mfValue + nDelta);
break; break;
case CELLTYPE_STRING: case CELLTYPE_STRING:
case CELLTYPE_EDIT: case CELLTYPE_EDIT:
...@@ -1341,14 +1337,14 @@ void ScTable::FillAutoSimple( ...@@ -1341,14 +1337,14 @@ void ScTable::FillAutoSimple(
if ( nHeadNoneTail < 0 ) if ( nHeadNoneTail < 0 )
{ {
setSuffixCell( setSuffixCell(
aCol[rCol], static_cast<SCROW>(rRow), aCol[rCol], rRow,
nNextValue, nCellDigits, aValue, nNextValue, nCellDigits, aValue,
eCellType, bIsOrdinalSuffix); aSrcCell.meType, bIsOrdinalSuffix);
} }
else else
{ {
aStr = aValue + lcl_ValueString( nNextValue, nCellDigits ); aStr = aValue + lcl_ValueString( nNextValue, nCellDigits );
aCol[rCol].SetRawString(static_cast<SCROW>(rRow), aStr); aCol[rCol].SetRawString(rRow, aStr);
} }
} }
else else
...@@ -1357,9 +1353,7 @@ void ScTable::FillAutoSimple( ...@@ -1357,9 +1353,7 @@ void ScTable::FillAutoSimple(
break; break;
case CELLTYPE_FORMULA : case CELLTYPE_FORMULA :
FillFormula( FillFormula(
aSrcCell.mpFormula, aSrcCell.mpFormula, rCol, rRow, (rInner == nIEnd));
static_cast<SCCOL>(rCol),
static_cast<SCROW>(rRow), (rInner == nIEnd) );
if (nFormulaCounter - nActFormCnt > nMaxFormCnt) if (nFormulaCounter - nActFormCnt > nMaxFormCnt)
nMaxFormCnt = nFormulaCounter - nActFormCnt; nMaxFormCnt = nFormulaCounter - nActFormCnt;
break; break;
...@@ -1369,7 +1363,7 @@ void ScTable::FillAutoSimple( ...@@ -1369,7 +1363,7 @@ void ScTable::FillAutoSimple(
} }
} }
if (nSource==nISrcEnd) if (nSource == nISrcEnd)
{ {
if ( nSource != nISrcStart ) if ( nSource != nISrcStart )
{ // More than one source cell { // More than one source cell
...@@ -1404,7 +1398,7 @@ void ScTable::FillAutoSimple( ...@@ -1404,7 +1398,7 @@ void ScTable::FillAutoSimple(
// and even then not individually for each one // and even then not individually for each one
++rProgress; ++rProgress;
if ( pProgress && (eCellType == CELLTYPE_FORMULA || eCellType == CELLTYPE_EDIT) ) if ( pProgress && (aSrcCell.meType == CELLTYPE_FORMULA || aSrcCell.meType == CELLTYPE_EDIT) )
pProgress->SetStateOnPercent( rProgress ); pProgress->SetStateOnPercent( rProgress );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment