[Libreoffice-commits] .: sc/inc

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Dec 21 16:34:01 PST 2010


 sc/inc/compiler.hxx |   17 ++++++++++++-----
 sc/inc/token.hxx    |    1 -
 2 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit fac8343da5a907f28ac0e8ac481fb7356be2a939
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Dec 21 19:33:40 2010 -0500

    ScRawTokenRef is now based on intrusive_ptr.

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 3b1cc79..a1870d0 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 1c329d5..c1a451a 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"


More information about the Libreoffice-commits mailing list