summaryrefslogtreecommitdiff
path: root/sc/source/core/data/column.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-03-12 21:53:34 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-03-12 22:00:07 -0400
commit18909ddb30db7ca9416ee2bfb0503753e877f002 (patch)
treef8865f2f8b3932172fa08390adbe98c23e19d6ca /sc/source/core/data/column.cxx
parentc9058f25e97b58a05eb25b7b769f6406423186b6 (diff)
fdo#75977: Clear sheet deleted flags for affected references when undoing.
This will allow formula cells to restore deleted references when they get recalculated. With this change, SetDirty() that previosly took no argument has been renamed to SetAllFormulasDirty(), and it now takes one argument that stores context information. Change-Id: If0de5dc1737a2722b6d61a87644b10a4f921edc5
Diffstat (limited to 'sc/source/core/data/column.cxx')
-rw-r--r--sc/source/core/data/column.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 200d088b392f..1fa7120729bf 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2959,11 +2959,23 @@ struct SetDirtyVarHandler
class SetDirtyHandler
{
ScDocument& mrDoc;
+ const sc::SetFormulaDirtyContext& mrCxt;
public:
- SetDirtyHandler(ScDocument& rDoc) : mrDoc(rDoc) {}
+ SetDirtyHandler( ScDocument& rDoc, const sc::SetFormulaDirtyContext& rCxt ) :
+ mrDoc(rDoc), mrCxt(rCxt) {}
void operator() (size_t /*nRow*/, ScFormulaCell* p)
{
+ if (mrCxt.mbClearTabDeletedFlag)
+ {
+ if (!p->IsShared() || p->IsSharedTop())
+ {
+ ScTokenArray* pCode = p->GetCode();
+ pCode->ClearTabDeleted(
+ p->aPos, mrCxt.mnTabDeletedStart, mrCxt.mnTabDeletedEnd);
+ }
+ }
+
p->SetDirtyVar();
if (!mrDoc.IsInFormulaTree(p))
mrDoc.PutInFormulaTree(p);
@@ -3357,11 +3369,11 @@ bool ScColumn::IsFormulaDirty( SCROW nRow ) const
return p->GetDirty();
}
-void ScColumn::SetDirty()
+void ScColumn::SetAllFormulasDirty( const sc::SetFormulaDirtyContext& rCxt )
{
// is only done documentwide, no FormulaTracking
sc::AutoCalcSwitch aSwitch(*pDocument, false);
- SetDirtyHandler aFunc(*pDocument);
+ SetDirtyHandler aFunc(*pDocument, rCxt);
sc::ProcessFormula(maCells, aFunc);
}