diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-23 16:49:35 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-24 23:29:39 -0400 |
commit | cc6e83d5ca69517f6dc44720d7c28417508b6542 (patch) | |
tree | 83654f8ed20378c5ef7097a45d3b2a4796113ba7 | |
parent | 37e80db5104db83dc2e52bb85d9353987701e8d1 (diff) |
Broadcast on recalc-ref-on-move cells for the other 3 directions.
Change-Id: I7794bd51c5fedb6c6c75f6910b7743df96d156c3
-rw-r--r-- | sc/source/core/data/document.cxx | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 9cba37457454..f32fcd5c1c36 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1122,6 +1122,36 @@ bool ScDocument::CanInsertRow( const ScRange& rRange ) const return bTest; } +namespace { + +struct StartNeededListenersHandler : std::unary_function<ScTable*, void> +{ + void operator() (ScTable* p) + { + if (p) + p->StartNeededListeners(); + } +}; + +struct SetRelNameDirtyHandler : std::unary_function<ScTable*, void> +{ + void operator() (ScTable* p) + { + if (p) + p->SetRelNameDirty(); + } +}; + +struct BroadcastRecalcOnRefMoveHandler : std::unary_function<ScTable*, void> +{ + void operator() (ScTable* p) + { + if (p) + p->BroadcastRecalcOnRefMove(); + } +}; + +} bool ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, SCCOL nEndCol, SCTAB nEndTab, @@ -1204,6 +1234,8 @@ bool ScDocument::InsertRow( SCCOL nStartCol, SCTAB nStartTab, for (; it != maTabs.end(); ++it) if (*it) (*it)->SetRelNameDirty(); + + std::for_each(maTabs.begin(), maTabs.end(), BroadcastRecalcOnRefMoveHandler()); } bRet = true; } @@ -1297,6 +1329,8 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab, for (; it != maTabs.end(); ++it) if (*it) (*it)->SetRelNameDirty(); + + std::for_each(maTabs.begin(), maTabs.end(), BroadcastRecalcOnRefMoveHandler()); } SetAutoCalc( bOldAutoCalc ); @@ -1334,37 +1368,6 @@ bool ScDocument::CanInsertCol( const ScRange& rRange ) const return bTest; } -namespace { - -struct StartNeededListenersHandler : std::unary_function<ScTable*, void> -{ - void operator() (ScTable* p) - { - if (p) - p->StartNeededListeners(); - } -}; - -struct SetRelNameDirtyHandler : std::unary_function<ScTable*, void> -{ - void operator() (ScTable* p) - { - if (p) - p->SetRelNameDirty(); - } -}; - -struct BroadcastRecalcOnRefMoveHandler : std::unary_function<ScTable*, void> -{ - void operator() (ScTable* p) - { - if (p) - p->BroadcastRecalcOnRefMove(); - } -}; - -} - bool ScDocument::InsertCol( SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTAB nEndTab, SCCOL nStartCol, SCSIZE nSize, ScDocument* pRefUndoDoc, @@ -1524,6 +1527,8 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA for (; it != maTabs.end(); ++it) if (*it) (*it)->SetRelNameDirty(); + + std::for_each(maTabs.begin(), maTabs.end(), BroadcastRecalcOnRefMoveHandler()); } SetAutoCalc( bOldAutoCalc ); |