[Libreoffice-commits] .: sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Dec 21 15:05:48 PST 2010


 sc/inc/chart2uno.hxx                          |    6 
 sc/inc/chartlis.hxx                           |    4 
 sc/inc/detfunc.hxx                            |    4 
 sc/inc/reftokenhelper.hxx                     |   24 +--
 sc/inc/token.hxx                              |   10 -
 sc/source/core/tool/chartlis.cxx              |   18 +-
 sc/source/core/tool/detfunc.cxx               |   10 -
 sc/source/core/tool/reftokenhelper.cxx        |   50 +++----
 sc/source/filter/excel/xichart.cxx            |    8 -
 sc/source/filter/inc/xichart.hxx              |    4 
 sc/source/filter/xml/XMLTableShapeResizer.cxx |    2 
 sc/source/ui/docshell/docfunc.cxx             |    8 -
 sc/source/ui/inc/docfunc.hxx                  |    4 
 sc/source/ui/unoobj/chart2uno.cxx             |  178 +++++++++++++-------------
 sc/source/ui/view/viewfun6.cxx                |    6 
 15 files changed, 163 insertions(+), 173 deletions(-)

New commits:
commit aa462f424ea29f5c8256f8928a66ebc6578c7952
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Dec 21 18:03:28 2010 -0500

    Removed ScSharedTokenRef and replaced it with ScTokenRef.
    
    ScSharedTokenRef was implemented by boost::shared_ptr, only because
    SimpleIntrusiveReference which the original ScTokenRef was implemented
    by could not be used with STL.
    
    Now that ScTokenRef is implemented by intrusive_ptr, we no longer
    need ScSharedTokenRef.

diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index dc9c758..8455d9c 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -320,7 +320,7 @@ class ScChart2DataSequence : public
 public:
     explicit ScChart2DataSequence( ScDocument* pDoc,
             const com::sun::star::uno::Reference< com::sun::star::chart2::data::XDataProvider >& xDP,
-            ::std::vector<ScSharedTokenRef>* pTokens, bool bIncludeHiddenCells );
+            ::std::vector<ScTokenRef>* pTokens, bool bIncludeHiddenCells );
 
     virtual ~ScChart2DataSequence();
     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
@@ -476,7 +476,7 @@ private:
 
     void RebuildDataCache();
 
-    sal_Int32 FillCacheFromExternalRef(const ScSharedTokenRef& pToken);
+    sal_Int32 FillCacheFromExternalRef(const ScTokenRef& pToken);
 
     void UpdateTokensFromRanges(const ScRangeList& rRanges);
 
@@ -525,7 +525,7 @@ private:
     sal_Bool                    m_bIncludeHiddenCells;
 
     // internals
-    typedef ::std::auto_ptr< ::std::vector<ScSharedTokenRef> >  TokenListPtr;
+    typedef ::std::auto_ptr< ::std::vector<ScTokenRef> >  TokenListPtr;
     typedef ::std::auto_ptr< ::std::vector<sal_uInt32> >        RangeIndexMapPtr;
     typedef ::std::auto_ptr<ExternalRefListener>                ExtRefListenerPtr;
 
diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index c6a6045..df92f9f 100644
--- a/sc/inc/chartlis.hxx
+++ b/sc/inc/chartlis.hxx
@@ -72,7 +72,7 @@ public:
 private:
 
     ::std::auto_ptr<ExternalRefListener>                mpExtRefListener;
-    ::std::auto_ptr< ::std::vector<ScSharedTokenRef> >  mpTokens;
+    ::std::auto_ptr< ::std::vector<ScTokenRef> >  mpTokens;
 
     ScChartUnoData*	pUnoData;
     ScDocument* 	pDoc;
@@ -89,7 +89,7 @@ public:
                     ScChartListener( const String& rName, ScDocument* pDoc,
                                      const ScRangeListRef& rRangeListRef );
                     ScChartListener( const String& rName, ScDocument* pDoc,
-                                     ::std::vector<ScSharedTokenRef>* pTokens );
+                                     ::std::vector<ScTokenRef>* pTokens );
                     ScChartListener( const ScChartListener& );
     virtual			~ScChartListener();
     virtual ScDataObject*	Clone() const;
diff --git a/sc/inc/detfunc.hxx b/sc/inc/detfunc.hxx
index 52ba59e..133950e 100644
--- a/sc/inc/detfunc.hxx
+++ b/sc/inc/detfunc.hxx
@@ -149,8 +149,8 @@ public:
 
     BOOL		MarkInvalid(BOOL& rOverflow);
 
-    void        GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector<ScSharedTokenRef>& rRefTokens);
-    void        GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector<ScSharedTokenRef>& rRefTokens);
+    void        GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector<ScTokenRef>& rRefTokens);
+    void        GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector<ScTokenRef>& rRefTokens);
 
     static void UpdateAllComments( ScDocument& rDoc );        // on all tables
     void		UpdateAllArrowColors();		// on all tables
diff --git a/sc/inc/reftokenhelper.hxx b/sc/inc/reftokenhelper.hxx
index 9f9ac01..8451a16 100644
--- a/sc/inc/reftokenhelper.hxx
+++ b/sc/inc/reftokenhelper.hxx
@@ -54,31 +54,31 @@ public:
      * The source range may consist of multiple ranges separated by ';'s. 
      */
     static void compileRangeRepresentation(
-        ::std::vector<ScSharedTokenRef>& rRefTokens, const ::rtl::OUString& rRangeStr, ScDocument* pDoc,
+        ::std::vector<ScTokenRef>& rRefTokens, const ::rtl::OUString& rRangeStr, ScDocument* pDoc,
         ::formula::FormulaGrammar::Grammar eGrammar = ::formula::FormulaGrammar::GRAM_ENGLISH);
 
-    static bool getRangeFromToken(ScRange& rRange, const ScSharedTokenRef& pToken, bool bExternal = false);
+    static bool getRangeFromToken(ScRange& rRange, const ScTokenRef& pToken, bool bExternal = false);
 
-    static void getRangeListFromTokens(ScRangeList& rRangeList, const ::std::vector<ScSharedTokenRef>& pTokens);
+    static void getRangeListFromTokens(ScRangeList& rRangeList, const ::std::vector<ScTokenRef>& pTokens);
 
     /** 
      * Create a double reference token from a range object.
      */
-    static void getTokenFromRange(ScSharedTokenRef& pToken, const ScRange& rRange);
+    static void getTokenFromRange(ScTokenRef& pToken, const ScRange& rRange);
 
-    static void getTokensFromRangeList(::std::vector<ScSharedTokenRef>& pTokens, const ScRangeList& rRanges);
+    static void getTokensFromRangeList(::std::vector<ScTokenRef>& pTokens, const ScRangeList& rRanges);
 
-    static bool SC_DLLPUBLIC isRef(const ScSharedTokenRef& pToken);
-    static bool SC_DLLPUBLIC isExternalRef(const ScSharedTokenRef& pToken);
+    static bool SC_DLLPUBLIC isRef(const ScTokenRef& pToken);
+    static bool SC_DLLPUBLIC isExternalRef(const ScTokenRef& pToken);
 
-    static bool SC_DLLPUBLIC intersects(const ::std::vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken);
+    static bool SC_DLLPUBLIC intersects(const ::std::vector<ScTokenRef>& rTokens, const ScTokenRef& pToken);
 
-    static void SC_DLLPUBLIC join(::std::vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken);
+    static void SC_DLLPUBLIC join(::std::vector<ScTokenRef>& rTokens, const ScTokenRef& pToken);
 
-    static bool getDoubleRefDataFromToken(ScComplexRefData& rData, const ScSharedTokenRef& pToken);
+    static bool getDoubleRefDataFromToken(ScComplexRefData& rData, const ScTokenRef& pToken);
 
-    static ScSharedTokenRef createRefToken(const ScAddress& rAddr);
-    static ScSharedTokenRef createRefToken(const ScRange& rRange);
+    static ScTokenRef createRefToken(const ScAddress& rAddr);
+    static ScTokenRef createRefToken(const ScRange& rRange);
 };
 
 #endif
diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx
index 70fa424..3e22b5b 100644
--- a/sc/inc/token.hxx
+++ b/sc/inc/token.hxx
@@ -50,16 +50,6 @@ class ScToken;
 typedef ::std::vector< ScComplexRefData > ScRefList;
 typedef ::boost::intrusive_ptr<ScToken> ScTokenRef;
 
-/** 
- * Another ref-counted token type using shared_ptr.  <b>Be extra careful 
- * not to mix use of this smart pointer type with ScTokenRef</b>, since 
- * mixing them might cause a premature object deletion because the same 
- * object may be ref-counted by two different smart pointer wrappers. 
- *  
- * You have been warned. 
- */
-typedef ::boost::shared_ptr< ScToken > ScSharedTokenRef;
-
 class SC_DLLPUBLIC ScToken : public formula::FormulaToken
 {
 private:
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index f3aa255..bfb3d57 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -129,7 +129,7 @@ ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP,
     StrData( rName ),
     SvtListener(),
     mpExtRefListener(NULL), 
-    mpTokens(new vector<ScSharedTokenRef>), 
+    mpTokens(new vector<ScTokenRef>),
     pUnoData( NULL ),
     pDoc( pDocP ),
     bUsed( FALSE ),
@@ -144,7 +144,7 @@ ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP,
     StrData( rName ),
     SvtListener(),
     mpExtRefListener(NULL), 
-    mpTokens(new vector<ScSharedTokenRef>), 
+    mpTokens(new vector<ScTokenRef>),
     pUnoData( NULL ),
     pDoc( pDocP ),
     bUsed( FALSE ),
@@ -154,7 +154,7 @@ ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP,
     ScRefTokenHelper::getTokensFromRangeList(*mpTokens, *rRangeList);
 }
 
-ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP, vector<ScSharedTokenRef>* pTokens ) :
+ScChartListener::ScChartListener( const String& rName, ScDocument* pDocP, vector<ScTokenRef>* pTokens ) :
     StrData( rName ),
     SvtListener(),
     mpExtRefListener(NULL), 
@@ -171,7 +171,7 @@ ScChartListener::ScChartListener( const ScChartListener& r ) :
     StrData( r ),
     SvtListener(),
     mpExtRefListener(NULL), 
-    mpTokens(new vector<ScSharedTokenRef>(*r.mpTokens)),
+    mpTokens(new vector<ScTokenRef>(*r.mpTokens)),
     pUnoData( NULL ),
     pDoc( r.pDoc ),
     bUsed( FALSE ),
@@ -284,27 +284,27 @@ ScRangeListRef ScChartListener::GetRangeList() const
 
 void ScChartListener::SetRangeList( const ScRangeListRef& rNew )
 {
-    vector<ScSharedTokenRef> aTokens;
+    vector<ScTokenRef> aTokens;
     ScRefTokenHelper::getTokensFromRangeList(aTokens, *rNew);
     mpTokens->swap(aTokens);
 }
 
 void ScChartListener::SetRangeList( const ScRange& rRange )
 {
-    ScSharedTokenRef pToken;
+    ScTokenRef pToken;
     ScRefTokenHelper::getTokenFromRange(pToken, rRange);
     mpTokens->push_back(pToken);
 }
 
 namespace {
 
-class StartEndListening : public unary_function<ScSharedTokenRef, void>
+class StartEndListening : public unary_function<ScTokenRef, void>
 {
 public:
     StartEndListening(ScDocument* pDoc, ScChartListener& rParent, bool bStart) :
         mpDoc(pDoc), mrParent(rParent), mbStart(bStart) {}
 
-    void operator() (const ScSharedTokenRef& pToken)
+    void operator() (const ScTokenRef& pToken)
     {
         if (!ScRefTokenHelper::isRef(pToken))
             return;
@@ -404,7 +404,7 @@ void ScChartListener::UpdateScheduledSeriesRanges()
 
 void ScChartListener::UpdateChartIntersecting( const ScRange& rRange )
 {
-    ScSharedTokenRef pToken;
+    ScTokenRef pToken;
     ScRefTokenHelper::getTokenFromRange(pToken, rRange);
 
     if (ScRefTokenHelper::intersects(*mpTokens, pToken))
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 7748122..22a341e 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -1428,7 +1428,7 @@ BOOL ScDetectiveFunc::MarkInvalid(BOOL& rOverflow)
 }
 
 void ScDetectiveFunc::GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-                                  vector<ScSharedTokenRef>& rRefTokens)
+                                  vector<ScTokenRef>& rRefTokens)
 {
     ScCellIterator aCellIter(pDoc, nCol1, nRow1, nTab, nCol2, nRow2, nTab);
     for (ScBaseCell* pCell = aCellIter.GetFirst(); pCell; pCell = aCellIter.GetNext())
@@ -1440,16 +1440,16 @@ void ScDetectiveFunc::GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
         ScDetectiveRefIter aRefIter(pFCell);
         for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken())
         {
-            ScSharedTokenRef pRef(static_cast<ScToken*>(p->Clone()));
+            ScTokenRef pRef(static_cast<ScToken*>(p->Clone()));
             ScRefTokenHelper::join(rRefTokens, pRef);
         }
     }
 }
 
 void ScDetectiveFunc::GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-                                  vector<ScSharedTokenRef>& rRefTokens)
+                                  vector<ScTokenRef>& rRefTokens)
 {
-    vector<ScSharedTokenRef> aSrcRange;
+    vector<ScTokenRef> aSrcRange;
     aSrcRange.push_back(
         ScRefTokenHelper::createRefToken(ScRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab)));
 
@@ -1463,7 +1463,7 @@ void ScDetectiveFunc::GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
         ScDetectiveRefIter aRefIter(pFCell);
         for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken())
         {
-            ScSharedTokenRef pRef(static_cast<ScToken*>(p->Clone()));
+            ScTokenRef pRef(static_cast<ScToken*>(p->Clone()));
             if (ScRefTokenHelper::intersects(aSrcRange, pRef))
             {
                 pRef = ScRefTokenHelper::createRefToken(aCellIter.GetPos());
diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx
index 013c4fc..4c6d554 100644
--- a/sc/source/core/tool/reftokenhelper.cxx
+++ b/sc/source/core/tool/reftokenhelper.cxx
@@ -47,7 +47,7 @@ using ::std::auto_ptr;
 using ::rtl::OUString;
 
 void ScRefTokenHelper::compileRangeRepresentation(
-    vector<ScSharedTokenRef>& rRefTokens, const OUString& rRangeStr, ScDocument* pDoc, FormulaGrammar::Grammar eGrammar)
+    vector<ScTokenRef>& rRefTokens, const OUString& rRangeStr, ScDocument* pDoc, FormulaGrammar::Grammar eGrammar)
 {
     const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
     const sal_Unicode cQuote = '\'';
@@ -109,7 +109,7 @@ void ScRefTokenHelper::compileRangeRepresentation(
                 }
                 if (!bFailure)
                     rRefTokens.push_back(
-                            ScSharedTokenRef(static_cast<ScToken*>(p->Clone())));
+                            ScTokenRef(static_cast<ScToken*>(p->Clone())));
             }
         }
 
@@ -118,7 +118,7 @@ void ScRefTokenHelper::compileRangeRepresentation(
         rRefTokens.clear();
 }
 
-bool ScRefTokenHelper::getRangeFromToken(ScRange& rRange, const ScSharedTokenRef& pToken, bool bExternal)
+bool ScRefTokenHelper::getRangeFromToken(ScRange& rRange, const ScTokenRef& pToken, bool bExternal)
 {
     StackVar eType = pToken->GetType();
     switch (pToken->GetType())
@@ -159,9 +159,9 @@ bool ScRefTokenHelper::getRangeFromToken(ScRange& rRange, const ScSharedTokenRef
     return false;
 }
 
-void ScRefTokenHelper::getRangeListFromTokens(ScRangeList& rRangeList, const vector<ScSharedTokenRef>& rTokens)
+void ScRefTokenHelper::getRangeListFromTokens(ScRangeList& rRangeList, const vector<ScTokenRef>& rTokens)
 {
-    vector<ScSharedTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
+    vector<ScTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
     for (; itr != itrEnd; ++itr)
     {
         ScRange aRange;
@@ -170,7 +170,7 @@ void ScRefTokenHelper::getRangeListFromTokens(ScRangeList& rRangeList, const vec
     }
 }
 
-void ScRefTokenHelper::getTokenFromRange(ScSharedTokenRef& pToken, const ScRange& rRange)
+void ScRefTokenHelper::getTokenFromRange(ScTokenRef& pToken, const ScRange& rRange)
 {
     ScComplexRefData aData;
     aData.InitFlags();
@@ -195,9 +195,9 @@ void ScRefTokenHelper::getTokenFromRange(ScSharedTokenRef& pToken, const ScRange
     pToken.reset(new ScDoubleRefToken(aData));
 }
 
-void ScRefTokenHelper::getTokensFromRangeList(vector<ScSharedTokenRef>& pTokens, const ScRangeList& rRanges)
+void ScRefTokenHelper::getTokensFromRangeList(vector<ScTokenRef>& pTokens, const ScRangeList& rRanges)
 {
-    vector<ScSharedTokenRef> aTokens;
+    vector<ScTokenRef> aTokens;
     size_t nCount = rRanges.size();
     aTokens.reserve(nCount);
     for (size_t i = 0; i < nCount; ++i)
@@ -207,14 +207,14 @@ void ScRefTokenHelper::getTokensFromRangeList(vector<ScSharedTokenRef>& pTokens,
             // failed.
             return;
 
-        ScSharedTokenRef pToken;
+        ScTokenRef pToken;
         ScRefTokenHelper::getTokenFromRange(pToken,* pRange);
         aTokens.push_back(pToken);
     }
     pTokens.swap(aTokens);
 }
 
-bool ScRefTokenHelper::isRef(const ScSharedTokenRef& pToken)
+bool ScRefTokenHelper::isRef(const ScTokenRef& pToken)
 {
     switch (pToken->GetType())
     {
@@ -229,7 +229,7 @@ bool ScRefTokenHelper::isRef(const ScSharedTokenRef& pToken)
     return false;
 }
 
-bool ScRefTokenHelper::isExternalRef(const ScSharedTokenRef& pToken)
+bool ScRefTokenHelper::isExternalRef(const ScTokenRef& pToken)
 {
     switch (pToken->GetType())
     {
@@ -242,7 +242,7 @@ bool ScRefTokenHelper::isExternalRef(const ScSharedTokenRef& pToken)
     return false;
 }
 
-bool ScRefTokenHelper::intersects(const vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken)
+bool ScRefTokenHelper::intersects(const vector<ScTokenRef>& rTokens, const ScTokenRef& pToken)
 {
     if (!isRef(pToken))
         return false;
@@ -253,10 +253,10 @@ bool ScRefTokenHelper::intersects(const vector<ScSharedTokenRef>& rTokens, const
     ScRange aRange;
     getRangeFromToken(aRange, pToken, bExternal);
 
-    vector<ScSharedTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
+    vector<ScTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
     for (; itr != itrEnd; ++itr)
     {
-        const ScSharedTokenRef& p = *itr;
+        const ScTokenRef& p = *itr;
         if (!isRef(p))
             continue;
 
@@ -288,7 +288,7 @@ public:
      * @param rTokens existing list of reference tokens
      * @param rToken new token
      */
-    void operator() (vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken)
+    void operator() (vector<ScTokenRef>& rTokens, const ScTokenRef& pToken)
     {
         join(rTokens, pToken);
     }
@@ -331,7 +331,7 @@ private:
         return (bRowsContained && bColsContained);
     }
 
-    void join(vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken)
+    void join(vector<ScTokenRef>& rTokens, const ScTokenRef& pToken)
     {
         // Normalize the token to a double reference.
         ScComplexRefData aData;
@@ -344,10 +344,10 @@ private:
         String aTabName = bExternal ? pToken->GetString() : String();
 
         bool bJoined = false;
-        vector<ScSharedTokenRef>::iterator itr = rTokens.begin(), itrEnd = rTokens.end();
+        vector<ScTokenRef>::iterator itr = rTokens.begin(), itrEnd = rTokens.end();
         for (; itr != itrEnd; ++itr)
         {
-            ScSharedTokenRef& pOldToken = *itr;
+            ScTokenRef& pOldToken = *itr;
 
             if (!ScRefTokenHelper::isRef(pOldToken))
                 // A non-ref token should not have been added here in the first
@@ -417,7 +417,7 @@ private:
                 return;
 
             // Pop the last token from the list, and keep joining recursively.
-            ScSharedTokenRef p = rTokens.back();
+            ScTokenRef p = rTokens.back();
             rTokens.pop_back();
             join(rTokens, p);
         }
@@ -428,13 +428,13 @@ private:
 
 }
 
-void ScRefTokenHelper::join(vector<ScSharedTokenRef>& rTokens, const ScSharedTokenRef& pToken)
+void ScRefTokenHelper::join(vector<ScTokenRef>& rTokens, const ScTokenRef& pToken)
 {
     JoinRefTokenRanges join;
     join(rTokens, pToken);
 }
 
-bool ScRefTokenHelper::getDoubleRefDataFromToken(ScComplexRefData& rData, const ScSharedTokenRef& pToken)
+bool ScRefTokenHelper::getDoubleRefDataFromToken(ScComplexRefData& rData, const ScTokenRef& pToken)
 {
     switch (pToken->GetType())
     {
@@ -459,19 +459,19 @@ bool ScRefTokenHelper::getDoubleRefDataFromToken(ScComplexRefData& rData, const
     return true;
 }
 
-ScSharedTokenRef ScRefTokenHelper::createRefToken(const ScAddress& rAddr)
+ScTokenRef ScRefTokenHelper::createRefToken(const ScAddress& rAddr)
 {
     ScSingleRefData aRefData;
     aRefData.InitAddress(rAddr);
-    ScSharedTokenRef pRef(new ScSingleRefToken(aRefData));
+    ScTokenRef pRef(new ScSingleRefToken(aRefData));
     return pRef;
 }
 
-ScSharedTokenRef ScRefTokenHelper::createRefToken(const ScRange& rRange)
+ScTokenRef ScRefTokenHelper::createRefToken(const ScRange& rRange)
 {
     ScComplexRefData aRefData;
     aRefData.InitRange(rRange);
-    ScSharedTokenRef pRef(new ScDoubleRefToken(aRefData));
+    ScTokenRef pRef(new ScDoubleRefToken(aRefData));
     return pRef;
 }
 
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 5f90040..c82b0c5 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -839,7 +839,7 @@ Sequence< Reference< XFormattedString > > XclImpChSourceLink::CreateStringSequen
     return ScfApiHelper::VectorToSequence( aStringVec );
 }
 
-void XclImpChSourceLink::FillSourceLink( ::std::vector< ScSharedTokenRef >& rTokens ) const
+void XclImpChSourceLink::FillSourceLink( ::std::vector< ScTokenRef >& rTokens ) const
 {
     if( !mxTokenArray )
         // no links to fill.
@@ -848,7 +848,7 @@ void XclImpChSourceLink::FillSourceLink( ::std::vector< ScSharedTokenRef >& rTok
     mxTokenArray->Reset();
     for (FormulaToken* p = mxTokenArray->First(); p; p = mxTokenArray->Next())
     {
-        ScSharedTokenRef pToken(static_cast<ScToken*>(p->Clone()));
+        ScTokenRef pToken(static_cast<ScToken*>(p->Clone()));
         if (ScRefTokenHelper::isRef(pToken))
             // This is a reference token.  Store it.
             ScRefTokenHelper::join(rTokens, pToken);
@@ -1959,7 +1959,7 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
     return xDataSeries;
 }
 
-void XclImpChSeries::FillAllSourceLinks( ::std::vector< ScSharedTokenRef >& rTokens ) const
+void XclImpChSeries::FillAllSourceLinks( ::std::vector< ScTokenRef >& rTokens ) const
 {
     if( mxValueLink )
         mxValueLink->FillSourceLink( rTokens );
@@ -3834,7 +3834,7 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc,
     ScDocument& rDoc = GetRoot().GetDoc();
     if( ScChartListenerCollection* pChartCollection = rDoc.GetChartListenerCollection() )
     {
-        ::std::auto_ptr< ::std::vector< ScSharedTokenRef > > xRefTokens( new ::std::vector< ScSharedTokenRef > );
+        ::std::auto_ptr< ::std::vector< ScTokenRef > > xRefTokens( new ::std::vector< ScTokenRef > );
         for( XclImpChSeriesVec::const_iterator aIt = maSeries.begin(), aEnd = maSeries.end(); aIt != aEnd; ++aIt )
             (*aIt)->FillAllSourceLinks( *xRefTokens );
         if( !xRefTokens->empty() )
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 54e8344..ee664c8 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -430,7 +430,7 @@ public:
     XFormattedStringSeq CreateStringSequence( const XclImpChRoot& rRoot,
                             sal_uInt16 nLeadFontIdx, const Color& rLeadFontColor ) const;
 
-    void                FillSourceLink(::std::vector<ScSharedTokenRef>& rTokens) const;
+    void                FillSourceLink(::std::vector<ScTokenRef>& rTokens) const;
 
 private:
     XclChSourceLink     maData;             /// Contents of the CHSOURCELINK record.
@@ -843,7 +843,7 @@ public:
     /** Creates a data series object with initialized source links. */
     XDataSeriesRef      CreateDataSeries() const;
 
-    void                FillAllSourceLinks(::std::vector<ScSharedTokenRef>& rTokens) const;
+    void                FillAllSourceLinks(::std::vector<ScTokenRef>& rTokens) const;
 
 private:
     /** Reads a CHSOURCELINK record. */
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx
index adf41f8..1e452e5 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.cxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx
@@ -93,7 +93,7 @@ void ScMyShapeResizer::CreateChartListener(ScDocument* pDoc,
     if (!pCollection)
         return;
 
-    auto_ptr< vector<ScSharedTokenRef> > pRefTokens(new vector<ScSharedTokenRef>);
+    auto_ptr< vector<ScTokenRef> > pRefTokens(new vector<ScTokenRef>);
     ScRefTokenHelper::compileRangeRepresentation(*pRefTokens, aRangeStr, pDoc);
     if (!pRefTokens->empty())
     {
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index e264f08..c940a93 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -541,11 +541,11 @@ BOOL ScDocFunc::DetectiveRefresh( BOOL bAutomatic )
 }
 
 static void lcl_collectAllPredOrSuccRanges(
-    const ScRangeList& rSrcRanges, vector<ScSharedTokenRef>& rRefTokens, ScDocShell& rDocShell,
+    const ScRangeList& rSrcRanges, vector<ScTokenRef>& rRefTokens, ScDocShell& rDocShell,
     bool bPred)
 {
     ScDocument* pDoc = rDocShell.GetDocument();
-    vector<ScSharedTokenRef> aRefTokens;
+    vector<ScTokenRef> aRefTokens;
     ScRangeList aSrcRanges(rSrcRanges);
     if ( aSrcRanges.empty() )
         return;
@@ -569,12 +569,12 @@ static void lcl_collectAllPredOrSuccRanges(
     rRefTokens.swap(aRefTokens);
 }
 
-void ScDocFunc::DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, vector<ScSharedTokenRef>& rRefTokens)
+void ScDocFunc::DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, vector<ScTokenRef>& rRefTokens)
 {
     lcl_collectAllPredOrSuccRanges(rSrcRanges, rRefTokens, rDocShell, true);
 }
 
-void ScDocFunc::DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, vector<ScSharedTokenRef>& rRefTokens)
+void ScDocFunc::DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, vector<ScTokenRef>& rRefTokens)
 {
     lcl_collectAllPredOrSuccRanges(rSrcRanges, rRefTokens, rDocShell, false);
 }
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 422a716..dee079f 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -80,8 +80,8 @@ public:
     BOOL            DetectiveMarkInvalid(SCTAB nTab);
     BOOL            DetectiveDelAll(SCTAB nTab);
     BOOL            DetectiveRefresh(BOOL bAutomatic = FALSE);
-    void            DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, ::std::vector<ScSharedTokenRef>& rRefTokens);
-    void            DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, ::std::vector<ScSharedTokenRef>& rRefTokens);
+    void            DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, ::std::vector<ScTokenRef>& rRefTokens);
+    void            DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, ::std::vector<ScTokenRef>& rRefTokens);
 
     BOOL            DeleteContents( const ScMarkData& rMark, USHORT nFlags,
                                     BOOL bRecord, BOOL bApi );
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 604dc5a..b3a0140 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -204,19 +204,19 @@ struct TokenTable
         return nRet;
     }
 
-    vector<ScSharedTokenRef>* getColRanges(SCCOL nCol) const;
-    vector<ScSharedTokenRef>* getRowRanges(SCROW nRow) const;
-    vector<ScSharedTokenRef>* getAllRanges() const;
+    vector<ScTokenRef>* getColRanges(SCCOL nCol) const;
+    vector<ScTokenRef>* getRowRanges(SCROW nRow) const;
+    vector<ScTokenRef>* getAllRanges() const;
 };
 
-vector<ScSharedTokenRef>* TokenTable::getColRanges(SCCOL nCol) const
+vector<ScTokenRef>* TokenTable::getColRanges(SCCOL nCol) const
 {
     if (nCol >= mnColCount)
         return NULL;
     if( mnRowCount<=0 )
         return NULL;
 
-    auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
+    auto_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>);
     sal_uInt32 nLast = getIndex(nCol, mnRowCount-1);
     for (sal_uInt32 i = getIndex(nCol, 0); i <= nLast; ++i)
     {
@@ -224,20 +224,20 @@ vector<ScSharedTokenRef>* TokenTable::getColRanges(SCCOL nCol) const
         if (!p)
             continue;
 
-        ScSharedTokenRef pCopy(static_cast<ScToken*>(p->Clone()));
+        ScTokenRef pCopy(static_cast<ScToken*>(p->Clone()));
         ScRefTokenHelper::join(*pTokens, pCopy);
     }
     return pTokens.release();
 }
 
-vector<ScSharedTokenRef>* TokenTable::getRowRanges(SCROW nRow) const
+vector<ScTokenRef>* TokenTable::getRowRanges(SCROW nRow) const
 {
     if (nRow >= mnRowCount)
         return NULL;
     if( mnColCount<=0 )
         return NULL;
 
-    auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
+    auto_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>);
     sal_uInt32 nLast = getIndex(mnColCount-1, nRow);
     for (sal_uInt32 i = getIndex(0, nRow); i <= nLast; i += mnRowCount)
     {
@@ -245,15 +245,15 @@ vector<ScSharedTokenRef>* TokenTable::getRowRanges(SCROW nRow) const
         if (!p)
             continue;
 
-        ScSharedTokenRef p2(static_cast<ScToken*>(p->Clone()));
+        ScTokenRef p2(static_cast<ScToken*>(p->Clone()));
         ScRefTokenHelper::join(*pTokens, p2);
     }
     return pTokens.release();
 }
 
-vector<ScSharedTokenRef>* TokenTable::getAllRanges() const
+vector<ScTokenRef>* TokenTable::getAllRanges() const
 {
-    auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
+    auto_ptr< vector<ScTokenRef> > pTokens(new vector<ScTokenRef>);
     sal_uInt32 nStop = mnColCount*mnRowCount;
     for (sal_uInt32 i = 0; i < nStop; i++)
     {
@@ -261,7 +261,7 @@ vector<ScSharedTokenRef>* TokenTable::getAllRanges() const
         if (!p)
             continue;
 
-        ScSharedTokenRef p2(static_cast<ScToken*>(p->Clone()));
+        ScTokenRef p2(static_cast<ScToken*>(p->Clone()));
         ScRefTokenHelper::join(*pTokens, p2);
     }
     return pTokens.release();
@@ -280,15 +280,15 @@ public:
     SCCOL getDataColCount() const { return mnDataColCount; }
     SCROW getDataRowCount() const { return mnDataRowCount; }
 
-    vector<ScSharedTokenRef>* getLeftUpperCornerRanges() const;
-    vector<ScSharedTokenRef>* getAllColHeaderRanges() const;
-    vector<ScSharedTokenRef>* getAllRowHeaderRanges() const;
+    vector<ScTokenRef>* getLeftUpperCornerRanges() const;
+    vector<ScTokenRef>* getAllColHeaderRanges() const;
+    vector<ScTokenRef>* getAllRowHeaderRanges() const;
 
-    vector<ScSharedTokenRef>* getColHeaderRanges(SCCOL nChartCol) const;
-    vector<ScSharedTokenRef>* getRowHeaderRanges(SCROW nChartRow) const;
+    vector<ScTokenRef>* getColHeaderRanges(SCCOL nChartCol) const;
+    vector<ScTokenRef>* getRowHeaderRanges(SCROW nChartRow) const;
 
-    vector<ScSharedTokenRef>* getDataColRanges(SCCOL nCol) const;
-    vector<ScSharedTokenRef>* getDataRowRanges(SCROW nRow) const;
+    vector<ScTokenRef>* getDataColRanges(SCCOL nCol) const;
+    vector<ScTokenRef>* getDataRowRanges(SCROW nRow) const;
 
 private:
     SCCOL mnDataColCount;
@@ -333,7 +333,7 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount,  SCROW nAllRowCount,
                         StackVar eType = pToken->GetType();
                         if( eType==svExternal || eType==svExternalSingleRef || eType==svExternalDoubleRef || eType==svExternalName )
                             bExternal = true;//lllll todo correct?
-                        ScSharedTokenRef pSharedToken(static_cast<ScToken*>(pToken->Clone()));
+                        ScTokenRef pSharedToken(static_cast<ScToken*>(pToken->Clone()));
                         ScRefTokenHelper::getRangeFromToken(aRange, pSharedToken, bExternal );
                         SCCOL nCol1=0, nCol2=0;
                         SCROW nRow1=0, nRow2=0;
@@ -415,33 +415,33 @@ Chart2PositionMap::~Chart2PositionMap()
     maData.clear();
 }
 
-vector<ScSharedTokenRef>* Chart2PositionMap::getLeftUpperCornerRanges() const
+vector<ScTokenRef>* Chart2PositionMap::getLeftUpperCornerRanges() const
 {
     return maLeftUpperCorner.getAllRanges();
 }
-vector<ScSharedTokenRef>* Chart2PositionMap::getAllColHeaderRanges() const
+vector<ScTokenRef>* Chart2PositionMap::getAllColHeaderRanges() const
 {
     return maColHeaders.getAllRanges();
 }
-vector<ScSharedTokenRef>* Chart2PositionMap::getAllRowHeaderRanges() const
+vector<ScTokenRef>* Chart2PositionMap::getAllRowHeaderRanges() const
 {
     return maRowHeaders.getAllRanges();
 }
-vector<ScSharedTokenRef>* Chart2PositionMap::getColHeaderRanges(SCCOL nCol) const
+vector<ScTokenRef>* Chart2PositionMap::getColHeaderRanges(SCCOL nCol) const
 {
     return maColHeaders.getColRanges( nCol);
 }
-vector<ScSharedTokenRef>* Chart2PositionMap::getRowHeaderRanges(SCROW nRow) const
+vector<ScTokenRef>* Chart2PositionMap::getRowHeaderRanges(SCROW nRow) const
 {
     return maRowHeaders.getRowRanges( nRow);
 }
 
-vector<ScSharedTokenRef>* Chart2PositionMap::getDataColRanges(SCCOL nCol) const
+vector<ScTokenRef>* Chart2PositionMap::getDataColRanges(SCCOL nCol) const
 {
     return maData.getColRanges( nCol);
 }
 
-vector<ScSharedTokenRef>* Chart2PositionMap::getDataRowRanges(SCROW nRow) const
+vector<ScTokenRef>* Chart2PositionMap::getDataRowRanges(SCROW nRow) const
 {
     return maData.getRowRanges( nRow);
 }
@@ -464,8 +464,8 @@ class Chart2Positioner
     };
 
 public:
-    Chart2Positioner(ScDocument* pDoc, const vector<ScSharedTokenRef>& rRefTokens) :
-        mpRefTokens(new vector<ScSharedTokenRef>(rRefTokens)),
+    Chart2Positioner(ScDocument* pDoc, const vector<ScTokenRef>& rRefTokens) :
+        mpRefTokens(new vector<ScTokenRef>(rRefTokens)),
         mpPositionMap(NULL),
         meGlue(GLUETYPE_NA),
         mpDoc(pDoc),
@@ -502,7 +502,7 @@ private:
     void createPositionMap();
 
 private:
-    shared_ptr< vector<ScSharedTokenRef> >  mpRefTokens;
+    shared_ptr< vector<ScTokenRef> >  mpRefTokens;
     auto_ptr<Chart2PositionMap>             mpPositionMap;
     GlueType    meGlue;
     SCCOL       mnStartCol;
@@ -527,7 +527,7 @@ void Chart2Positioner::glueState()
     mbDummyUpperLeft = false;
     if (mpRefTokens->size() <= 1)
     {
-        const ScSharedTokenRef& p = mpRefTokens->front();
+        const ScTokenRef& p = mpRefTokens->front();
         ScComplexRefData aData;
         if (ScRefTokenHelper::getDoubleRefDataFromToken(aData, p))
         {
@@ -554,7 +554,7 @@ void Chart2Positioner::glueState()
 
     SCCOL nMaxCols = 0, nEndCol = 0;
     SCROW nMaxRows = 0, nEndRow = 0;
-    for (vector<ScSharedTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end()
+    for (vector<ScTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end()
          ; itr != itrEnd; ++itr)
     {
         ScRefTokenHelper::getDoubleRefDataFromToken(aData, *itr);
@@ -618,7 +618,7 @@ void Chart2Positioner::glueState()
     const sal_uInt8 nGlue = 3;
 
     vector<sal_uInt8> aCellStates(nCR);
-    for (vector<ScSharedTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end();
+    for (vector<ScTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end();
           itr != itrEnd; ++itr)
     {
         ScRefTokenHelper::getDoubleRefDataFromToken(aData, *itr);
@@ -720,10 +720,10 @@ void Chart2Positioner::createPositionMap()
     auto_ptr<Table> pNewRowTable(new Table);
     Table* pCol = NULL;
     SCROW nNoGlueRow = 0;
-    for (vector<ScSharedTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end();
+    for (vector<ScTokenRef>::const_iterator itr = mpRefTokens->begin(), itrEnd = mpRefTokens->end();
           itr != itrEnd; ++itr)
     {
-        const ScSharedTokenRef& pToken = *itr;
+        const ScTokenRef& pToken = *itr;
 
         bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
         sal_uInt16 nFileId = bExternal ? pToken->GetIndex() : 0;
@@ -837,7 +837,7 @@ void Chart2Positioner::createPositionMap()
 /** 
  * Function object to create a range string from a token list.
  */
-class Tokens2RangeString : public unary_function<ScSharedTokenRef, void>
+class Tokens2RangeString : public unary_function<ScTokenRef, void>
 {
 public:
     Tokens2RangeString(ScDocument* pDoc, FormulaGrammar::Grammar eGram, sal_Unicode cRangeSep) :
@@ -858,7 +858,7 @@ public:
     {
     }
 
-    void operator() (const ScSharedTokenRef& rToken)
+    void operator() (const ScTokenRef& rToken)
     {
         ScCompiler aCompiler(mpDoc, ScAddress(0,0,0));
         aCompiler.SetGrammar(meGrammar);
@@ -895,7 +895,7 @@ private:
  * 
  * and each address doesn't include any '$' symbols.
  */
-class Tokens2RangeStringXML : public unary_function<ScSharedTokenRef, void>
+class Tokens2RangeStringXML : public unary_function<ScTokenRef, void>
 {
 public:
     Tokens2RangeStringXML(ScDocument* pDoc) :
@@ -916,14 +916,14 @@ public:
     {
     }
 
-    void operator() (const ScSharedTokenRef& rToken)
+    void operator() (const ScTokenRef& rToken)
     {
         if (mbFirst)
             mbFirst = false;
         else
             mpRangeStr->append(mcRangeSep);
 
-        ScSharedTokenRef aStart, aEnd;
+        ScTokenRef aStart, aEnd;
         splitRangeToken(rToken, aStart, aEnd);
         ScCompiler aCompiler(mpDoc, ScAddress(0,0,0));
         aCompiler.SetGrammar(FormulaGrammar::GRAM_ENGLISH);
@@ -948,7 +948,7 @@ public:
 private:
     Tokens2RangeStringXML(); // disabled
 
-    void splitRangeToken(const ScSharedTokenRef& pToken, ScSharedTokenRef& rStart, ScSharedTokenRef& rEnd) const
+    void splitRangeToken(const ScTokenRef& pToken, ScTokenRef& rStart, ScTokenRef& rEnd) const
     {
         ScComplexRefData aData;
         ScRefTokenHelper::getDoubleRefDataFromToken(aData, pToken);
@@ -989,7 +989,7 @@ private:
     bool                mbFirst;
 };
 
-void lcl_convertTokensToString(OUString& rStr, const vector<ScSharedTokenRef>& rTokens, ScDocument* pDoc)
+void lcl_convertTokensToString(OUString& rStr, const vector<ScTokenRef>& rTokens, ScDocument* pDoc)
 {
     const sal_Unicode cRangeSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
     FormulaGrammar::Grammar eGrammar = pDoc->GetGrammar();
@@ -1044,7 +1044,7 @@ void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
         }
     }
 
-    vector<ScSharedTokenRef> aTokens;
+    vector<ScTokenRef> aTokens;
     ScRefTokenHelper::compileRangeRepresentation(aTokens, aRangeRepresentation, m_pDocument, m_pDocument->GetGrammar());
     return !aTokens.empty();
 }
@@ -1052,7 +1052,7 @@ void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
 namespace
 {
 
-ScChart2LabeledDataSequence* lcl_createScChart2DataSequenceFromTokens( auto_ptr< vector<ScSharedTokenRef> > pValueTokens, auto_ptr< vector<ScSharedTokenRef> > pLabelTokens,
+ScChart2LabeledDataSequence* lcl_createScChart2DataSequenceFromTokens( auto_ptr< vector<ScTokenRef> > pValueTokens, auto_ptr< vector<ScTokenRef> > pLabelTokens,
                         ScDocument* pDoc, const uno::Reference < chart2::data::XDataProvider >& xDP, bool bIncludeHiddenCells )
 {
     ScChart2LabeledDataSequence* pRet = 0;
@@ -1085,7 +1085,7 @@ ScChart2LabeledDataSequence* lcl_createScChart2DataSequenceFromTokens( auto_ptr<
  * 
  * @return true if the corner was added, false otherwise.
  */
-bool lcl_addUpperLeftCornerIfMissing(vector<ScSharedTokenRef>& rRefTokens,
+bool lcl_addUpperLeftCornerIfMissing(vector<ScTokenRef>& rRefTokens,
             SCROW nCornerRowCount=1, SCCOL nCornerColumnCount=1)
 {
     using ::std::max;
@@ -1104,10 +1104,10 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScSharedTokenRef>& rRefTokens,
     String aExtTabName;
     bool bExternal = false;
 
-    vector<ScSharedTokenRef>::const_iterator itr = rRefTokens.begin(), itrEnd = rRefTokens.end();
+    vector<ScTokenRef>::const_iterator itr = rRefTokens.begin(), itrEnd = rRefTokens.end();
 
     // Get the first ref token.
-    ScSharedTokenRef pToken = *itr;
+    ScTokenRef pToken = *itr;
     switch (pToken->GetType())
     {
         case svSingleRef:
@@ -1324,13 +1324,13 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScSharedTokenRef>& rRefTokens,
     {
         if (bExternal)
         {
-            ScSharedTokenRef pCorner(
+            ScTokenRef pCorner(
                 new ScExternalSingleRefToken(nFileId, aExtTabName, aData));
             ScRefTokenHelper::join(rRefTokens, pCorner);
         }
         else
         {
-            ScSharedTokenRef pCorner(new ScSingleRefToken(aData));
+            ScTokenRef pCorner(new ScSingleRefToken(aData));
             ScRefTokenHelper::join(rRefTokens, pCorner);
         }
     }
@@ -1344,13 +1344,13 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScSharedTokenRef>& rRefTokens,
         r.Ref2=aDataEnd;
         if (bExternal)
         {
-            ScSharedTokenRef pCorner(
+            ScTokenRef pCorner(
                 new ScExternalDoubleRefToken(nFileId, aExtTabName, r));
             ScRefTokenHelper::join(rRefTokens, pCorner);
         }
         else
         {
-            ScSharedTokenRef pCorner(new ScDoubleRefToken(r));
+            ScTokenRef pCorner(new ScDoubleRefToken(r));
             ScRefTokenHelper::join(rRefTokens, pCorner);
         }
     }
@@ -1407,7 +1407,7 @@ ScChart2DataProvider::createDataSource(
         }
     }
 
-    vector<ScSharedTokenRef> aRefTokens;
+    vector<ScTokenRef> aRefTokens;
     ScRefTokenHelper::compileRangeRepresentation(aRefTokens, aRangeRepresentation, m_pDocument, m_pDocument->GetGrammar());
     if (aRefTokens.empty())
         // Invalid range representation.  Bail out.
@@ -1433,13 +1433,13 @@ ScChart2DataProvider::createDataSource(
     // Fill Categories
     if( bCategories )
     {
-        auto_ptr< vector<ScSharedTokenRef> > pValueTokens(NULL);
+        auto_ptr< vector<ScTokenRef> > pValueTokens(NULL);
         if (bOrientCol)
             pValueTokens.reset(pChartMap->getAllRowHeaderRanges());
         else
             pValueTokens.reset(pChartMap->getAllColHeaderRanges());
 
-        auto_ptr< vector<ScSharedTokenRef> > pLabelTokens(NULL);
+        auto_ptr< vector<ScTokenRef> > pLabelTokens(NULL);
             pLabelTokens.reset(pChartMap->getLeftUpperCornerRanges());
 
         ScChart2LabeledDataSequence* pCategories = lcl_createScChart2DataSequenceFromTokens( pValueTokens, pLabelTokens, m_pDocument, this, m_bIncludeHiddenCells );//ownership of pointers is transfered!
@@ -1451,8 +1451,8 @@ ScChart2DataProvider::createDataSource(
     sal_Int32 nCount = bOrientCol ? pChartMap->getDataColCount() : pChartMap->getDataRowCount();
     for (sal_Int32 i = 0; i < nCount; ++i)
     {
-        auto_ptr< vector<ScSharedTokenRef> > pValueTokens(NULL);
-        auto_ptr< vector<ScSharedTokenRef> > pLabelTokens(NULL);
+        auto_ptr< vector<ScTokenRef> > pValueTokens(NULL);
+        auto_ptr< vector<ScTokenRef> > pLabelTokens(NULL);
         if (bOrientCol)
         {
             pValueTokens.reset(pChartMap->getDataColRanges(static_cast<SCCOL>(i)));
@@ -1512,7 +1512,7 @@ namespace
 /** 
  * Function object to create a list of table numbers from a token list.
  */
-class InsertTabNumber : public unary_function<ScSharedTokenRef, void>
+class InsertTabNumber : public unary_function<ScTokenRef, void>
 {
 public:
     InsertTabNumber() :
@@ -1525,7 +1525,7 @@ public:
     {
     }
 
-    void operator() (const ScSharedTokenRef& pToken) const
+    void operator() (const ScTokenRef& pToken) const
     {
         if (!ScRefTokenHelper::isRef(pToken))
             return;
@@ -1546,7 +1546,7 @@ class RangeAnalyzer
 {
 public:
     RangeAnalyzer();
-    void initRangeAnalyzer( const vector<ScSharedTokenRef>& rTokens );
+    void initRangeAnalyzer( const vector<ScTokenRef>& rTokens );
     void analyzeRange( sal_Int32& rnDataInRows, sal_Int32& rnDataInCols,
             bool& rbRowSourceAmbiguous ) const;
     bool inSameSingleRow( RangeAnalyzer& rOther );
@@ -1574,7 +1574,7 @@ RangeAnalyzer::RangeAnalyzer()
 {
 }
 
-void RangeAnalyzer::initRangeAnalyzer( const vector<ScSharedTokenRef>& rTokens )
+void RangeAnalyzer::initRangeAnalyzer( const vector<ScTokenRef>& rTokens )
 {
     mnRowCount=0;
     mnColumnCount=0;
@@ -1588,10 +1588,10 @@ void RangeAnalyzer::initRangeAnalyzer( const vector<ScSharedTokenRef>& rTokens )
     }
     mbEmpty=false;
     
-    vector<ScSharedTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
+    vector<ScTokenRef>::const_iterator itr = rTokens.begin(), itrEnd = rTokens.end();
     for (; itr != itrEnd ; ++itr)
     {
-        ScSharedTokenRef aRefToken = *itr;
+        ScTokenRef aRefToken = *itr;
         StackVar eVar = aRefToken->GetType();
         if (eVar == svDoubleRef || eVar == svExternalDoubleRef)
         {
@@ -1681,12 +1681,12 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
     ::rtl::OUString sRangeRep;
 
     bool bHasCategoriesLabels = false;
-    vector<ScSharedTokenRef> aAllCategoriesValuesTokens;
-    vector<ScSharedTokenRef> aAllSeriesLabelTokens;
+    vector<ScTokenRef> aAllCategoriesValuesTokens;
+    vector<ScTokenRef> aAllSeriesLabelTokens;
     
     chart::ChartDataRowSource eRowSource = chart::ChartDataRowSource_COLUMNS;
 
-    vector<ScSharedTokenRef> aAllTokens;
+    vector<ScTokenRef> aAllTokens;
 
     // parse given data source and collect infos
     {
@@ -1723,10 +1723,10 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
                 if( xLabel.is())
                 {
                     bFirstCellAsLabel = true;
-                    vector<ScSharedTokenRef> aTokens;
+                    vector<ScTokenRef> aTokens;
                     ScRefTokenHelper::compileRangeRepresentation( aTokens, xLabel->getSourceRangeRepresentation(), m_pDocument, m_pDocument->GetGrammar() );
                     aLabel.initRangeAnalyzer(aTokens);
-                    vector<ScSharedTokenRef>::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end();
+                    vector<ScTokenRef>::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end();
                     for (; itr != itrEnd; ++itr)
                     {
                         ScRefTokenHelper::join(aAllTokens, *itr);
@@ -1740,10 +1740,10 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
                 Reference< chart2::data::XDataSequence > xValues( xLS->getValues());
                 if( xValues.is())
                 {
-                    vector<ScSharedTokenRef> aTokens;
+                    vector<ScTokenRef> aTokens;
                     ScRefTokenHelper::compileRangeRepresentation( aTokens, xValues->getSourceRangeRepresentation(), m_pDocument, m_pDocument->GetGrammar() );
                     aValues.initRangeAnalyzer(aTokens);
-                    vector<ScSharedTokenRef>::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end();
+                    vector<ScTokenRef>::const_iterator itr = aTokens.begin(), itrEnd = aTokens.end();
                     for (; itr != itrEnd; ++itr)
                     {
                         ScRefTokenHelper::join(aAllTokens, *itr);
@@ -1947,7 +1947,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
     if( ! m_pDocument )
         return false;
 
-    vector<ScSharedTokenRef> aTokens;
+    vector<ScTokenRef> aTokens;
     ScRefTokenHelper::compileRangeRepresentation(aTokens, aRangeRepresentation, m_pDocument, m_pDocument->GetGrammar());
     return !aTokens.empty();
 }
@@ -1971,13 +1971,13 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL
     // method to allow the client code to directly pass tokens representing
     // ranges.
 
-    vector<ScSharedTokenRef> aRefTokens;
+    vector<ScTokenRef> aRefTokens;
     ScRefTokenHelper::compileRangeRepresentation(aRefTokens, aRangeRepresentation, m_pDocument);
     if (aRefTokens.empty())
         return xResult;
 
     // ScChart2DataSequence manages the life cycle of pRefTokens.
-    vector<ScSharedTokenRef>* pRefTokens = new vector<ScSharedTokenRef>();
+    vector<ScTokenRef>* pRefTokens = new vector<ScTokenRef>();
     pRefTokens->swap(aRefTokens);
     xResult.set(new ScChart2DataSequence(m_pDocument, this, pRefTokens, m_bIncludeHiddenCells));
 
@@ -2009,7 +2009,7 @@ rtl::OUString SAL_CALL ScChart2DataProvider::convertRangeToXML( const rtl::OUStr
         // Empty data range is allowed.
         return aRet;
 
-    vector<ScSharedTokenRef> aRefTokens;
+    vector<ScTokenRef> aRefTokens;
     ScRefTokenHelper::compileRangeRepresentation(aRefTokens, sRangeRepresentation, m_pDocument, m_pDocument->GetGrammar());
     if (aRefTokens.empty())
         throw lang::IllegalArgumentException();
@@ -2334,7 +2334,7 @@ void ScChart2DataSequence::HiddenRangeListener::notify()
 
 ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
         const uno::Reference < chart2::data::XDataProvider >& xDP, 
-        vector<ScSharedTokenRef>* pTokens,
+        vector<ScTokenRef>* pTokens,
         bool bIncludeHiddenCells )
     : m_bIncludeHiddenCells( bIncludeHiddenCells)
     , m_nObjectId( 0 )
@@ -2402,7 +2402,7 @@ void ScChart2DataSequence::RefChanged()
                     pCLC->EndListeningHiddenRange(m_pHiddenListener.get());
             }
 
-            vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
+            vector<ScTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
             for (; itr != itrEnd; ++itr)
             {
                 ScRange aRange;
@@ -2436,7 +2436,7 @@ void ScChart2DataSequence::BuildDataCache()
     sal_Int32 nDataCount = 0;
     sal_Int32 nHiddenValueCount = 0;
     
-    for (vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
+    for (vector<ScTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
           itr != itrEnd; ++itr)
     {
         if (ScRefTokenHelper::isExternalRef(*itr))
@@ -2547,7 +2547,7 @@ void ScChart2DataSequence::RebuildDataCache()
     }
 }
 
-sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScSharedTokenRef& pToken)
+sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScTokenRef& pToken)
 {
     ScExternalRefManager* pRefMgr = m_pDocument->GetExternalRefManager();
     ScRange aRange;
@@ -2637,7 +2637,7 @@ void ScChart2DataSequence::UpdateTokensFromRanges(const ScRangeList& rRanges)
 
     for ( size_t i = 0, nCount = rRanges.size(); i < nCount; ++i )
     {
-        ScSharedTokenRef pToken;
+        ScTokenRef pToken;
         const ScRange* pRange = rRanges[i];
         DBG_ASSERT(pRange, "range object is NULL.");
 
@@ -2753,8 +2753,8 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
 
         ScRangeList aRanges;
         m_pRangeIndices.reset(new vector<sal_uInt32>());
-        vector<ScSharedTokenRef>::const_iterator itrBeg = m_pTokens->begin(), itrEnd = m_pTokens->end();
-        for (vector<ScSharedTokenRef>::const_iterator itr = itrBeg ;itr != itrEnd; ++itr)
+        vector<ScTokenRef>::const_iterator itrBeg = m_pTokens->begin(), itrEnd = m_pTokens->end();
+        for (vector<ScTokenRef>::const_iterator itr = itrBeg ;itr != itrEnd; ++itr)
         {
             if (!ScRefTokenHelper::isExternalRef(*itr))
             {
@@ -2981,7 +2981,7 @@ namespace {
  * This function object is used to accumulatively count the numbers of
  * columns and rows in all reference tokens.
  */
-class AccumulateRangeSize : public unary_function<ScSharedTokenRef, void>
+class AccumulateRangeSize : public unary_function<ScTokenRef, void>
 {
 public:
     AccumulateRangeSize() :
@@ -2990,7 +2990,7 @@ public:
     AccumulateRangeSize(const AccumulateRangeSize& r) :
         mnCols(r.mnCols), mnRows(r.mnRows) {}
 
-    void operator() (const ScSharedTokenRef& pToken)
+    void operator() (const ScTokenRef& pToken)
     {
         ScRange r;
         bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
@@ -3011,7 +3011,7 @@ private:
  * This function object is used to generate label strings from a list of
  * reference tokens.
  */
-class GenerateLabelStrings : public unary_function<ScSharedTokenRef, void>
+class GenerateLabelStrings : public unary_function<ScTokenRef, void>
 {
 public:
     GenerateLabelStrings(sal_Int32 nSize, chart2::data::LabelOrigin eOrigin, bool bColumn) :
@@ -3026,7 +3026,7 @@ public:
         mnCount(r.mnCount),
         mbColumn(r.mbColumn) {}
 
-    void operator() (const ScSharedTokenRef& pToken)
+    void operator() (const ScTokenRef& pToken)
     {
         bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
         ScRange aRange;
@@ -3213,16 +3213,16 @@ uno::Reference< util::XCloneable > SAL_CALL ScChart2DataSequence::createClone()
 {
     SolarMutexGuard aGuard;
 
-    auto_ptr< vector<ScSharedTokenRef> > pTokensNew;
+    auto_ptr< vector<ScTokenRef> > pTokensNew;
     if (m_pTokens.get())
     {
         // Clone tokens.
-        pTokensNew.reset(new vector<ScSharedTokenRef>);
+        pTokensNew.reset(new vector<ScTokenRef>);
         pTokensNew->reserve(m_pTokens->size());
-        vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
+        vector<ScTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
         for (; itr != itrEnd; ++itr)
         {
-            ScSharedTokenRef p(static_cast<ScToken*>((*itr)->Clone()));
+            ScTokenRef p(static_cast<ScToken*>((*itr)->Clone()));
             pTokensNew->push_back(p);
         }
     }
@@ -3261,7 +3261,7 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti
         if( m_pDocument )
         {
             ScChartListenerCollection* pCLC = m_pDocument->GetChartListenerCollection();
-            vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
+            vector<ScTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
             for (; itr != itrEnd; ++itr)
             {
                 ScRange aRange;
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index 51e0179..cd5b5ed 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -209,14 +209,14 @@ void ScViewFunc::DetectiveMarkPred()
     else
         aRanges.Append(aCurPos);
 
-    vector<ScSharedTokenRef> aRefTokens;
+    vector<ScTokenRef> aRefTokens;
     pDocSh->GetDocFunc().DetectiveCollectAllPreds(aRanges, aRefTokens);
 
     if (aRefTokens.empty())
         // No precedents found.  Nothing to do.
         return;
 
-    ScSharedTokenRef p = aRefTokens.front();
+    ScTokenRef p = aRefTokens.front();
     if (ScRefTokenHelper::isExternalRef(p))
     {
         // This is external.  Open the external document if available, and
@@ -274,7 +274,7 @@ void ScViewFunc::DetectiveMarkSucc()
     else
         aRanges.Append(aCurPos);
 
-    vector<ScSharedTokenRef> aRefTokens;
+    vector<ScTokenRef> aRefTokens;
     pDocSh->GetDocFunc().DetectiveCollectAllSuccs(aRanges, aRefTokens);
 
     if (aRefTokens.empty())


More information about the Libreoffice-commits mailing list