summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/filter/excel/excform.cxx37
-rw-r--r--sc/source/filter/excel/namebuff.cxx3
2 files changed, 20 insertions, 20 deletions
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index 56a18f8f81d4..82a3ae59a8db 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -115,27 +115,28 @@ void ImportExcel::Formula(
{
// This is a shared formula. Get the token array from the shared formula pool.
ScFormulaCellGroupRef xGroup = pFormConv->GetSharedFormula(maStrm, aScPos.Col(), nFormLen);
- if (!xGroup)
- return;
-
- if (xGroup->mnStart == aScPos.Row())
- // Generate code for the top cell only.
- xGroup->compileCode(*pD, aScPos, formula::FormulaGrammar::GRAM_DEFAULT);
-
- ScFormulaCell* pCell = new ScFormulaCell(pD, aScPos, xGroup);
- pD->EnsureTable(aScPos.Tab());
- bool bInserted = pD->SetGroupFormulaCell(aScPos, pCell);
- if (!bInserted)
+ if (xGroup)
{
- delete pCell;
+ if (xGroup->mnStart == aScPos.Row())
+ // Generate code for the top cell only.
+ xGroup->compileCode(*pD, aScPos, formula::FormulaGrammar::GRAM_DEFAULT);
+
+ ScFormulaCell* pCell = new ScFormulaCell(pD, aScPos, xGroup);
+ pD->EnsureTable(aScPos.Tab());
+ bool bInserted = pD->SetGroupFormulaCell(aScPos, pCell);
+ if (!bInserted)
+ {
+ delete pCell;
+ return;
+ }
+ xGroup->mnLength = aScPos.Row() - xGroup->mnStart + 1;
+ pCell->SetNeedNumberFormat(false);
+ if (!rtl::math::isNan(fCurVal))
+ pCell->SetResultDouble(fCurVal);
+
+ GetXFRangeBuffer().SetXF(aScPos, nXF);
return;
}
- pCell->SetNeedNumberFormat(false);
- if (!rtl::math::isNan(fCurVal))
- pCell->SetResultDouble(fCurVal);
-
- GetXFRangeBuffer().SetXF(aScPos, nXF);
- return;
}
ConvErr eErr = pFormConv->Convert( pResult, maStrm, nFormLen, true, FT_CellFormula);
diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx
index 4e47c09f7346..4c75d64216d9 100644
--- a/sc/source/filter/excel/namebuff.cxx
+++ b/sc/source/filter/excel/namebuff.cxx
@@ -79,7 +79,6 @@ void SharedFormulaBuffer::Clear()
void SharedFormulaBuffer::Store( const ScRange& rRange, const ScTokenArray& rArray )
{
- SCROW nGroupLen = rRange.aEnd.Row() - rRange.aStart.Row() + 1;
for (SCCOL i = rRange.aStart.Col(); i <= rRange.aEnd.Col(); ++i)
{
// Create one group per column.
@@ -88,7 +87,7 @@ void SharedFormulaBuffer::Store( const ScRange& rRange, const ScTokenArray& rArr
ScFormulaCellGroupRef xNewGroup(new ScFormulaCellGroup);
xNewGroup->mnStart = rRange.aStart.Row();
- xNewGroup->mnLength = nGroupLen;
+ xNewGroup->mnLength = 1;
xNewGroup->setCode(rArray);
maFormulaGroups.insert(FormulaGroupsType::value_type(aPos, xNewGroup));
}