[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Sep 13 11:03:47 PDT 2011
sc/source/core/data/cell.cxx | 5 +++++
sc/source/core/data/cell2.cxx | 9 ++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
New commits:
commit 6dcc0967b83b77ab289abcb1a3531469c6444a93
Author: Eike Rathke <erack at erack.de>
Date: Tue Sep 13 12:23:21 2011 -0400
fix fdo#39485 recalculate matrix formula dimension correctly
ScFormulaCell::GetMatrixEdge() when recalculating its dimension obtained
the matrix origin of itself instead of a neighboring matrix formula if
encountered such, effectively adding that other matrix to its own cells
occupying dimension.
Signed-off-by: Kohei Yoshida <kohei.yoshida at suse.com>
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 4651a2c..862cb4d 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1681,7 +1681,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 5bac8e3..1023099 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -609,7 +609,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;
@@ -622,7 +623,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();
@@ -638,7 +640,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();
More information about the Libreoffice-commits
mailing list