From 79c8c0a5fa21da68e9b10dc4d1a89341e346c2bf Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 17 Dec 2010 01:59:24 -0500 Subject: Implemented ScMatrixRef using boost::intrusive_ptr. --- sc/inc/scmatrix.hxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'sc/inc/scmatrix.hxx') 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 #include "scdllapi.h" +#include + 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 ScMatrixRef; +typedef ::boost::intrusive_ptr ScConstMatrixRef; #endif // SC_MATRIX_HXX -- cgit