diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-05-13 06:32:54 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-05-13 06:32:54 +0000 |
commit | 0254ae239850fbd17ee876fe189932cdef374817 (patch) | |
tree | 2a09409e276159767912cedec8db564f28c5db2c /sc/inc/token.hxx | |
parent | 5d1e249739f19639fe1cfd28f63ef4f8fc1fc826 (diff) |
INTEGRATION: CWS dr39 (1.10.30); FILE MERGED
2005/05/10 14:09:19 er 1.10.30.1: #i48967# Interpreter's TokenMatrixMap: no dangling map for reallocated pointers
Diffstat (limited to 'sc/inc/token.hxx')
-rw-r--r-- | sc/inc/token.hxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx index ffc95c338f2f..5532ee190778 100644 --- a/sc/inc/token.hxx +++ b/sc/inc/token.hxx @@ -2,9 +2,9 @@ * * $RCSfile: token.hxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: rt $ $Date: 2005-03-29 13:29:38 $ + * last change: $Author: rt $ $Date: 2005-05-13 07:32:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -123,7 +123,7 @@ private: OpCode eOp; // OpCode const StackVar eType; // type of data - USHORT nRefCnt; // reference count + mutable USHORT nRefCnt; // reference count // not implemented, prevent usage ScToken(); @@ -151,8 +151,12 @@ public: BOOL IsMatrixFunction() const; // if a function _always_ returns a Matrix BYTE GetParamCount() const; inline void NewOpCode( OpCode e ) { eOp = e; } - inline void IncRef() { nRefCnt++; } - inline void DecRef() { if( !--nRefCnt ) Delete(); } + inline void IncRef() const { nRefCnt++; } + inline void DecRef() const + { + if (!--nRefCnt) + const_cast<ScToken*>(this)->Delete(); + } inline USHORT GetRef() const { return nRefCnt; } /** @@ -214,6 +218,7 @@ public: typedef ScSimpleIntrusiveReference< class ScToken > ScTokenRef; +typedef ScSimpleIntrusiveReference< const class ScToken > ScConstTokenRef; class ScByteToken : public ScToken |