diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-18 15:57:10 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-24 23:29:29 -0400 |
commit | 87c187be0a2c56fefab53594e00f979492c004fd (patch) | |
tree | a4154731d1e53439e06a2f81704fab9016a60621 /sc/inc | |
parent | 8a459277b4e27e7b18fae842a62f2774cb62fc2a (diff) |
Correctly update references on cell insertion/deletion.
Change-Id: Ie7499f1f589cd384c4e2421dc81d3c1f02e4a53e
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/refupdatecontext.hxx | 8 | ||||
-rw-r--r-- | sc/inc/tokenarray.hxx | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/inc/refupdatecontext.hxx b/sc/inc/refupdatecontext.hxx index 80fdd7417c37..7192ec70a7fd 100644 --- a/sc/inc/refupdatecontext.hxx +++ b/sc/inc/refupdatecontext.hxx @@ -43,6 +43,14 @@ struct RefUpdateContext bool hasDelta() const; }; +struct RefUpdateResult +{ + bool mbValueChanged; + bool mbRangeSizeModified; + + RefUpdateResult(); +}; + } #endif diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx index 9f0c46357e4b..fe6204c1f2ff 100644 --- a/sc/inc/tokenarray.hxx +++ b/sc/inc/tokenarray.hxx @@ -27,6 +27,13 @@ #include "calcmacros.hxx" #include <formula/tokenarray.hxx> +namespace sc { + +struct RefUpdateContext; +struct RefUpdateResult; + +} + struct ScRawToken; struct ScSingleRefData; struct ScComplexRefData; @@ -113,6 +120,15 @@ public: */ void AdjustAbsoluteRefs( const ScDocument* pOldDoc, const ScAddress& rOldPos, const ScAddress& rNewPos, bool bRangeName = false, bool bCheckCopyArea = false ); + /** + * Adjust all references in response to shifting of cells during cell + * insertion and deletion. + * + * @param rCxt context that stores details of shifted region. + * @param rOldPos old cell position prior to shifting. + */ + sc::RefUpdateResult AdjustReferenceOnShift( const sc::RefUpdateContext& rCxt, const ScAddress& rOldPos ); + #if DEBUG_FORMULA_COMPILER void Dump() const; #endif |