summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-01-30 16:10:48 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-01-30 16:18:18 -0500
commite2b11f4fd79dce4116badb0ecf6477546ca5d0d4 (patch)
tree8ce51068122c0f1b9318a872691a547b6d4f023d /sc/inc
parent400f715ad7ebecb9c657fed4ade40bd5135efde2 (diff)
Prevent excessive references to single token instance during fill.
Because if not, we may run out of the 16-bit integer space to store reference count.
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/cell.hxx2
-rw-r--r--sc/inc/formularesult.hxx12
2 files changed, 14 insertions, 0 deletions
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 52244f6dca93..3bc7aee92b1f 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -535,6 +535,8 @@ public:
bool IsMultilineResult();
void MaybeInterpret();
+
+ void ResetFormulaResult();
};
// Iterator for references in a formula cell
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index c1cb90609275..94c62f83bbea 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -117,6 +117,8 @@ public:
mpToken->DecRef();
}
+ inline void Reset();
+
/** Well, guess what ... */
inline ScFormulaResult & operator=( const ScFormulaResult & r );
@@ -216,6 +218,16 @@ public:
inline ScMatrixFormulaCellToken* GetMatrixFormulaCellTokenNonConst();
};
+inline void ScFormulaResult::Reset()
+{
+ ResetToDefaults();
+
+ if (mbToken && mpToken)
+ mpToken->DecRef();
+
+ mbToken = true;
+ mpToken = NULL;
+}
inline void ScFormulaResult::ResetToDefaults()
{