summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-08-26 13:52:56 +0200
committerIvo Hinkelmann <ihi@openoffice.org>2010-08-26 13:52:56 +0200
commit8c8d2a8a8f0721ebf8767ab2f0a058730d16996f (patch)
tree6e26807d786cd087d066db74deecfd6ccc6b0b35 /sc/inc
parent9ceca79b6020bf63652012b9fe3863454be3145e (diff)
parentb07c2a4cb2b8060addbf0326970afedf62f7ecc9 (diff)
CWS-TOOLING: integrate CWS calc58
Notes
Notes: split repo tag: calc_ooo/OOO330_m6 split repo tag: calc_ooo/OOO330_m7
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/scmatrix.hxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx
index 9857d675b7ab..b788672aa715 100644
--- a/sc/inc/scmatrix.hxx
+++ b/sc/inc/scmatrix.hxx
@@ -99,6 +99,7 @@ class SC_DLLPUBLIC ScMatrix
mutable ULONG nRefCnt; // reference count
SCSIZE nColCount;
SCSIZE nRowCount;
+ bool mbCloneIfConst; // Whether the matrix is cloned with a CloneIfConst() call.
void ResetIsString();
void DeleteIsString();
@@ -171,11 +172,19 @@ public:
/** If nC*nR results in more than GetElementsMax() entries, a 1x1 matrix is
created instead and a double error value (errStackOverflow) is set.
Compare nC and nR with a GetDimensions() call to check. */
- ScMatrix( SCSIZE nC, SCSIZE nR) : nRefCnt(0) { CreateMatrix( nC, nR); }
+ ScMatrix( SCSIZE nC, SCSIZE nR) : nRefCnt(0), mbCloneIfConst(true) { CreateMatrix( nC, nR); }
/** Clone the matrix. */
ScMatrix* Clone() const;
+ /** Clone the matrix if mbCloneIfConst (immutable) is set, otherwise
+ return _this_ matrix, to be assigned to a ScMatrixRef. */
+ ScMatrix* CloneIfConst();
+
+ /** Set the matrix to (im)mutable for CloneIfConst(), only the interpreter
+ should do this and know the consequences. */
+ inline void SetImmutable( bool bVal ) { mbCloneIfConst = bVal; }
+
/**
* Resize the matrix to specified new dimension. Note that this operation
* clears all stored values.