diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-12-21 19:33:40 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-12-21 19:33:40 -0500 |
commit | b13a822f43316959260b4275b4c6c682bdd8ab71 (patch) | |
tree | 669a69adc38b86c9987a3ff439e9084905843ef1 /sc | |
parent | f7e9694be4d3c7d4a1bb16cf1620acf1473e650d (diff) |
ScRawTokenRef is now based on intrusive_ptr.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/compiler.hxx | 17 | ||||
-rw-r--r-- | sc/inc/token.hxx | 1 |
2 files changed, 12 insertions, 6 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index cfd92b28b1df..f38abc562d4f 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -38,7 +38,6 @@ #include "global.hxx" #include "refdata.hxx" #include "formula/token.hxx" -#include "formula/intruref.hxx" #include "formula/grammar.hxx" #include <unotools/charclass.hxx> #include <rtl/ustrbuf.hxx> @@ -47,8 +46,7 @@ #include <formula/FormulaCompiler.hxx> - -#include <boost/shared_ptr.hpp> +#include <boost/intrusive_ptr.hpp> #ifndef INCLUDED_HASH_MAP #include <hash_map> @@ -111,7 +109,7 @@ class ScTokenArray; #define SC_TOKEN_FIX_MEMBERS \ OpCode eOp; \ formula::StackVar eType; \ - USHORT nRefCnt; \ + mutable USHORT nRefCnt; \ BOOL bRaw; struct ScDoubleRawToken @@ -203,8 +201,17 @@ public: { return GetStrLenBytes( GetStrLen( pStr ) ); } }; +inline void intrusive_ptr_add_ref(ScRawToken* p) +{ + p->IncRef(); +} + +inline void intrusive_ptr_release(ScRawToken* p) +{ + p->DecRef(); +} -typedef formula::SimpleIntrusiveReference< struct ScRawToken > ScRawTokenRef; +typedef ::boost::intrusive_ptr<ScRawToken> ScRawTokenRef; class SC_DLLPUBLIC ScCompiler : public formula::FormulaCompiler { diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx index 5d3455517f4d..362ba1bbdad6 100644 --- a/sc/inc/token.hxx +++ b/sc/inc/token.hxx @@ -36,7 +36,6 @@ #include "formula/opcode.hxx" #include "refdata.hxx" #include "scmatrix.hxx" -#include "formula/intruref.hxx" #include <tools/mempool.hxx> #include "scdllapi.h" #include "formula/IFunctionDescription.hxx" |