summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-07-30 13:51:28 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-07-31 09:05:18 -0400
commit27182231acd3a0c9898a8dba78b76dc8a827b4c0 (patch)
tree02b853f50d4201799a28f85a40de1d171db73333 /sc/inc
parent85f8f8f8589af3c404339c0f78021a7fe21cdfcd (diff)
fdo#78555: Retain formula results when moving a range of cells.
* No need to re-compile RPN token array on reference change alone. We do that when the formula contains one or more names that have been updated. * Adjust undo code to get it to work without relying on ref undo document, which would cause the token arrays to be unnecessarily recompiled. * Whatever else need to be changed in order to pass all unit tests. Change-Id: I99e86d23320aca8900fef011da23a9d34e42751e
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/inc/refhint.hxx7
-rw-r--r--sc/inc/tokenarray.hxx5
-rw-r--r--sc/inc/types.hxx6
4 files changed, 15 insertions, 5 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 0dc3239441b3..6bfb13887176 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1876,6 +1876,8 @@ public:
void EndListeningCell( sc::EndListeningContext& rCxt, const ScAddress& rPos, SvtListener& rListener );
void EndListeningFormulaCells( std::vector<ScFormulaCell*>& rCells );
+ void CollectAllAreaListeners(
+ std::vector<SvtListener*>& rListeners, const ScRange& rRange, sc::AreaOverlapType eType );
void PutInFormulaTree( ScFormulaCell* pCell );
void RemoveFromFormulaTree( ScFormulaCell* pCell );
diff --git a/sc/inc/refhint.hxx b/sc/inc/refhint.hxx
index 1eff90631de6..0f65aaeae06b 100644
--- a/sc/inc/refhint.hxx
+++ b/sc/inc/refhint.hxx
@@ -15,6 +15,8 @@
namespace sc {
+struct RefUpdateContext;
+
class RefHint : public SfxSimpleHint
{
public:
@@ -42,10 +44,11 @@ class RefMovedHint : public RefHint
{
ScRange maRange;
ScAddress maMoveDelta;
+ const sc::RefUpdateContext& mrCxt;
public:
- RefMovedHint( const ScRange& rRange, const ScAddress& rMove );
+ RefMovedHint( const ScRange& rRange, const ScAddress& rMove, const sc::RefUpdateContext& rCxt );
virtual ~RefMovedHint();
/**
@@ -57,6 +60,8 @@ public:
* Get the movement vector.
*/
const ScAddress& getDelta() const;
+
+ const sc::RefUpdateContext& getContext() const;
};
class RefColReorderHint : public RefHint
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index 8ae61450c95a..97623647f9d2 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -152,11 +152,8 @@ public:
* Move reference positions that are within specified moved range.
*
* @param rPos position of this formula cell
- * @param rMovedRange range that has been moved.
- * @param rDelta movement vector.
*/
- void MoveReference(
- const ScAddress& rPos, const ScRange& rMovedRange, const ScAddress& rDelta );
+ sc::RefUpdateResult MoveReference( const ScAddress& rPos, const sc::RefUpdateContext& rCxt );
/**
* Move reference positions in response to column reordering. A range
diff --git a/sc/inc/types.hxx b/sc/inc/types.hxx
index 37784dc2f6ca..8dc8f181f28d 100644
--- a/sc/inc/types.hxx
+++ b/sc/inc/types.hxx
@@ -100,6 +100,12 @@ struct RangeMatrix
typedef boost::unordered_map<SCCOLROW,SCCOLROW> ColRowReorderMapType;
+enum AreaOverlapType
+{
+ AreaInside,
+ AreaPartialOverlap
+};
+
}
#endif