[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/inc sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Tue Apr 30 08:23:05 PDT 2013
sc/inc/formulacell.hxx | 2 +-
sc/source/core/data/column.cxx | 2 +-
sc/source/core/data/formulacell.cxx | 7 +++----
sc/source/core/tool/formulagroup.cxx | 3 +++
sc/source/filter/oox/formulabuffer.cxx | 2 +-
sc/source/ui/unoobj/cellsuno.cxx | 2 +-
6 files changed, 10 insertions(+), 8 deletions(-)
New commits:
commit 8de5aadd3c24d6d678a0103c48f53ecb212f4ebb
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Apr 30 11:24:29 2013 -0400
Ensure that modified formula cells are redrawn.
ScFormulaCell::bChanged is responsible for this, though, we should only
set it to true for visible cells only. That's a TODO for later.
Change-Id: Ic237c45fb271f901320f4843c89710aedd16c906
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 2a8546f..2d0d04c 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -192,7 +192,7 @@ public:
void FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes) const;
bool IsSubTotal() const { return bSubTotal; }
bool IsChanged() const;
- void ResetChanged();
+ void SetChanged(bool b);
bool IsEmpty(); // formula::svEmptyCell result
// display as empty string if formula::svEmptyCell result
bool IsEmptyDisplayedAsString();
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index da9aa3c..2933e9f 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2382,7 +2382,7 @@ void ScColumn::ResetChanged( SCROW nStartRow, SCROW nEndRow )
{
ScBaseCell* pCell = maItems[nIndex].pCell;
if (pCell->GetCellType() == CELLTYPE_FORMULA)
- ((ScFormulaCell*)pCell)->ResetChanged();
+ ((ScFormulaCell*)pCell)->SetChanged(false);
++nIndex;
}
}
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index d271edc..80305c2 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2730,9 +2730,9 @@ bool ScFormulaCell::IsChanged() const
return bChanged;
}
-void ScFormulaCell::ResetChanged()
+void ScFormulaCell::SetChanged(bool b)
{
- bChanged = false;
+ bChanged = b;
}
void ScFormulaCell::CompileDBFormula()
@@ -3153,8 +3153,7 @@ bool ScFormulaCell::InterpretInvariantFormulaGroup()
// Ensure the cell truly has a result:
pCell->aResult = aResult;
pCell->ResetDirty();
-
- // FIXME: there is a view / refresh missing here it appears.
+ pCell->SetChanged(true);
}
return true;
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index 9f76fe2..c554e9c 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -88,7 +88,10 @@ bool FormulaGroupInterpreter::interpret()
pDest->SetResultToken(aInterpreter.GetResultToken().get());
pDest->ResetDirty();
+ pDest->SetChanged(true);
}
+
+ return true;
}
}
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index 0fa6dcb..32ec1d6 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -151,7 +151,7 @@ void FormulaBuffer::applyCellFormulaValues( const std::vector< ValueAddressPair
{
pCell->SetHybridDouble( it->second );
pCell->ResetDirty();
- pCell->ResetChanged();
+ pCell->SetChanged(false);
}
}
}
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 6006181..dc40193 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -6609,7 +6609,7 @@ void SAL_CALL ScCellObj::setFormulaResult( double nValue ) throw(uno::RuntimeExc
ScFormulaCell* pCell = pDocSh->GetDocument()->GetFormulaCell(aCellPos);
pCell->SetHybridDouble( nValue );
pCell->ResetDirty();
- pCell->ResetChanged();
+ pCell->SetChanged(false);
}
}
More information about the Libreoffice-commits
mailing list