diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-12-17 01:59:24 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-12-17 01:59:24 -0500 |
commit | 79c8c0a5fa21da68e9b10dc4d1a89341e346c2bf (patch) | |
tree | 50b8b5ed5d4ce204353f5662badb3dec98752d89 /sc/inc/scmatrix.hxx | |
parent | b36b0e091f5d487be076e515000423059b9e4a9d (diff) |
Implemented ScMatrixRef using boost::intrusive_ptr.
Diffstat (limited to 'sc/inc/scmatrix.hxx')
-rw-r--r-- | sc/inc/scmatrix.hxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index 0adce6d343af..d88828b97346 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -30,11 +30,12 @@ #define SC_MATRIX_HXX #include "global.hxx" -#include "formula/intruref.hxx" #include "formula/errorcodes.hxx" #include <tools/string.hxx> #include "scdllapi.h" +#include <boost/intrusive_ptr.hpp> + class SvStream; class ScInterpreter; class SvNumberFormatter; @@ -134,7 +135,7 @@ struct ScMatrixValue class SC_DLLPUBLIC ScMatrix { ScMatrixImpl* pImpl; - mutable ULONG nRefCnt; // reference count + mutable size_t nRefCnt; // reference count // only delete via Delete() ~ScMatrix(); @@ -355,10 +356,18 @@ public: // to be numerically safe. }; +inline void intrusive_ptr_add_ref(const ScMatrix* p) +{ + p->IncRef(); +} -typedef formula::SimpleIntrusiveReference< class ScMatrix > ScMatrixRef; -typedef formula::SimpleIntrusiveReference< const class ScMatrix > ScConstMatrixRef; +inline void intrusive_ptr_release(const ScMatrix* p) +{ + p->DecRef(); +} +typedef ::boost::intrusive_ptr<ScMatrix> ScMatrixRef; +typedef ::boost::intrusive_ptr<const ScMatrix> ScConstMatrixRef; #endif // SC_MATRIX_HXX |