summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/cell.cxx5
-rw-r--r--sc/source/core/data/cell2.cxx9
2 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 324639129c41..8b1b99ea613c 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1798,7 +1798,12 @@ void ScFormulaCell::SetMatColsRows( SCCOL nCols, SCROW nRows )
if (pMat)
pMat->SetMatColsRows( nCols, nRows);
else if (nCols || nRows)
+ {
aResult.SetToken( new ScMatrixFormulaCellToken( nCols, nRows));
+ // Setting the new token actually forces an empty result at this top
+ // left cell, so have that recalculated.
+ SetDirty();
+ }
}
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index 648cd2365270..098a6a308725 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -624,7 +624,8 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos )
{
pFCell->GetMatColsRows( nC, nR );
if ( nC == 0 || nR == 0 )
- { // aus altem Dokument geladen, neu erzeugen
+ {
+ // No ScMatrixFormulaCellToken available yet, calculate new.
nC = 1;
nR = 1;
ScAddress aTmpOrg;
@@ -637,7 +638,8 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos )
pCell = pDocument->GetCell( aAdr );
if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA
&& ((ScFormulaCell*)pCell)->cMatrixFlag == MM_REFERENCE
- && GetMatrixOrigin( aTmpOrg ) && aTmpOrg == aOrg )
+ && ((ScFormulaCell*)pCell)->GetMatrixOrigin( aTmpOrg )
+ && aTmpOrg == aOrg )
{
nC++;
aAdr.IncCol();
@@ -653,7 +655,8 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos )
pCell = pDocument->GetCell( aAdr );
if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA
&& ((ScFormulaCell*)pCell)->cMatrixFlag == MM_REFERENCE
- && GetMatrixOrigin( aTmpOrg ) && aTmpOrg == aOrg )
+ && ((ScFormulaCell*)pCell)->GetMatrixOrigin( aTmpOrg )
+ && aTmpOrg == aOrg )
{
nR++;
aAdr.IncRow();