diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-19 15:39:36 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-24 23:29:33 -0400 |
commit | 50c70948d05d8485e058af7fd90be1d61052afe7 (patch) | |
tree | bdfad7a9df4badd9547288ed4a34b7d876bd3896 /sc/source/core/data | |
parent | cbd61576667358413f391bc5d106d44375342f91 (diff) |
Handle range reference expansion on insertion.
Change-Id: I128ed26b6d6319a7e227885801e0683b517eb439
Diffstat (limited to 'sc/source/core/data')
-rw-r--r-- | sc/source/core/data/documen3.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/refupdatecontext.cxx | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 53769ef443e4..04973f4db031 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -981,7 +981,7 @@ void ScDocument::UpdateReference( return; boost::scoped_ptr<sc::ExpandRefsSwitch> pExpandRefsSwitch; - if (rCxt.meMode == URM_INSDEL && rCxt.hasDelta()) + if (rCxt.isInserted()) pExpandRefsSwitch.reset(new sc::ExpandRefsSwitch(*this, SC_MOD()->GetInputOptions().GetExpandRefs())); size_t nFirstTab, nLastTab; diff --git a/sc/source/core/data/refupdatecontext.cxx b/sc/source/core/data/refupdatecontext.cxx index 9f39f44a6443..1ba6a6b92c5c 100644 --- a/sc/source/core/data/refupdatecontext.cxx +++ b/sc/source/core/data/refupdatecontext.cxx @@ -14,9 +14,14 @@ namespace sc { RefUpdateContext::RefUpdateContext() : meMode(URM_INSDEL), mnColDelta(0), mnRowDelta(0), mnTabDelta(0) {} -bool RefUpdateContext::hasDelta() const +bool RefUpdateContext::isInserted() const { - return (mnColDelta > 0 || mnRowDelta > 0 || mnTabDelta > 0); + return (meMode == URM_INSDEL) && (mnColDelta > 0 || mnRowDelta > 0 || mnTabDelta > 0); +} + +bool RefUpdateContext::isDeleted() const +{ + return (meMode == URM_INSDEL) && (mnColDelta < 0 || mnRowDelta < 0 || mnTabDelta < 0); } RefUpdateResult::RefUpdateResult() : mbValueChanged(false), mbRangeSizeModified(false) {} |