summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-11-20 16:41:51 +0200
committerMichael Meeks <michael.meeks@collabora.com>2013-11-20 18:23:07 +0000
commit0c7e7043bdeab5ad683e9621573441891ef4868b (patch)
tree23540757510ed503056244c4fc8d0d4bf78c14f7 /sc/source/core
parent4787398ff07fe1bfe34ea878e9c8ee96e5d9994f (diff)
Fix a few of my own thinkos, and add some assertions
Fix two obvious mistakes from 8c37bafbc5adc0c79f218f9db2dc25ca8e683125. Add asserts to make sure the calls to ScFormulaCell::CreateCellGroup() that now don't take the nStart parameter any more (but assume that the cell for which this methoid is called is the start one) match the old ones in semantics. Change-Id: I50cb0cdaf620253881225baf39ae9cd935917b27
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/column3.cxx3
-rw-r--r--sc/source/core/data/formulacell.cxx4
-rw-r--r--sc/source/core/tool/sharedformula.cxx1
3 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 141240f029b0..7a7f0a7cdea1 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2786,13 +2786,14 @@ public:
nRow += xCurGrp->mnLength;
std::advance(it, xCurGrp->mnLength);
pPrev->SetCellGroup(xCurGrp);
- --xCurGrp->mpTopCell = pPrev;
+ xCurGrp->mpTopCell = pPrev;
++xCurGrp->mnLength;
xPrevGrp = xCurGrp;
}
else
{
// Both previous and current cells are regular cells.
+ assert(pPrev->aPos.Row() == (SCROW)(nRow - 1));
xPrevGrp = pPrev->CreateCellGroup(2, eCompState == ScFormulaCell::EqualInvariant);
pCur->SetCellGroup(xPrevGrp);
++nRow;
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 9f6465f78160..6144c09fae14 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3329,8 +3329,12 @@ void ScFormulaCell::SetNextTrack( ScFormulaCell* pF ) { pNextTr
ScFormulaCellGroupRef ScFormulaCell::CreateCellGroup( SCROW nLen, bool bInvariant )
{
if (mxGroup)
+ {
// You can't create a new group if the cell is already a part of a group.
+ // Is this a sign of some inconsistent or incorrect data structures? Or normal?
+ SAL_INFO("sc.opencl", "You can't create a new group if the cell is already a part of a group");
return ScFormulaCellGroupRef();
+ }
mxGroup.reset(new ScFormulaCellGroup);
mxGroup->mpTopCell = this;
diff --git a/sc/source/core/tool/sharedformula.cxx b/sc/source/core/tool/sharedformula.cxx
index 20eef831a956..ed35690a63a7 100644
--- a/sc/source/core/tool/sharedformula.cxx
+++ b/sc/source/core/tool/sharedformula.cxx
@@ -151,6 +151,7 @@ void SharedFormulaUtil::joinFormulaCells(const CellStoreType::position_type& rPo
else
{
// neither cells are shared.
+ assert(rCell1.aPos.Row() == (SCROW)(rPos.first->position + rPos.second));
xGroup1 = rCell1.CreateCellGroup(2, eState == ScFormulaCell::EqualInvariant);
rCell2.SetCellGroup(xGroup1);
}