[ooo-build-commit] .: patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Mar 4 18:38:41 PST 2010


 patches/dev300/apply                                |    3 
 patches/dev300/calc-extref-simple-ref-tracking.diff |  609 ++++++++++++++++++++
 2 files changed, 612 insertions(+)

New commits:
commit d45bfd4425837361c929327ab07c470176cb63b4
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Mar 4 21:35:55 2010 -0500

    Break links turn formulas with external refs into static values.
    
    * patches/dev300/apply:
    * patches/dev300/calc-extref-simple-ref-tracking.diff: simplify
      the way to track cells including external references.  Also,
      breaking link to external documents now turn affected formula
      cells into static values. (n#585094)

diff --git a/patches/dev300/apply b/patches/dev300/apply
index b6c560f..9c9f4fb 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3573,6 +3573,9 @@ calc-insert-current-time-sc.diff,        kohei
 calc-insert-current-time-svx.diff,       kohei
 calc-insert-current-time-vcl.diff,       kohei
 
+# Simplify external ref cell tracking & break links turn ref cells into static values.
+calc-extref-simple-ref-tracking.diff, n#585094, kohei
+
 [ GentooExperimental ]
 SectionOwner => hmth
 # jemalloc, FreeBSD 7 allocator
diff --git a/patches/dev300/calc-extref-simple-ref-tracking.diff b/patches/dev300/calc-extref-simple-ref-tracking.diff
new file mode 100644
index 0000000..ff223ef
--- /dev/null
+++ b/patches/dev300/calc-extref-simple-ref-tracking.diff
@@ -0,0 +1,609 @@
+diff --git sc/inc/externalrefmgr.hxx sc/inc/externalrefmgr.hxx
+index 2906113..36e1e8f 100644
+--- sc/inc/externalrefmgr.hxx
++++ sc/inc/externalrefmgr.hxx
+@@ -46,6 +46,7 @@
+ #include <boost/shared_ptr.hpp>
+ #include <vector>
+ #include <list>
++#include <set>
+ #include <formula/ExternalReferenceHelper.hxx>
+ 
+ class ScDocument;
+@@ -59,6 +60,7 @@ class ScTokenArray;
+ class String;
+ class SfxObjectShellRef;
+ class Window;
++class ScFormulaCell;
+ 
+ class ScExternalRefCache;
+ 
+@@ -354,58 +356,8 @@ class SC_DLLPUBLIC ScExternalRefManager : public formula::ExternalReferenceHelpe
+ {
+ public:
+ 
+-    // SUNWS needs a forward declared friend, otherwise types and members
+-    // of the outer class are not accessible.
+-    class RefCells;
+-    friend class ScExternalRefManager::RefCells;
+-
+-    /** 
+-     *  Collection of cell addresses that contain external references. This
+-     *  data is used for link updates.
+-     */
+-    class RefCells
+-    {
+-    public:
+-        RefCells();
+-        ~RefCells();
+-
+-        void insertCell(const ScAddress& rAddr);
+-        void removeCell(const ScAddress& rAddr);
+-        void moveTable(SCTAB nOldTab, SCTAB nNewTab, bool bCopy);
+-        void insertTable(SCTAB nPos);
+-        void removeTable(SCTAB nPos);
+-        void refreshAllCells(ScExternalRefManager& rRefMgr);
+-    private:
+-
+-        typedef ::std::hash_set<SCROW>              RowSet;
+-        typedef ::std::hash_map<SCCOL, RowSet>      ColSet;
+-
+-        // SUNWS needs a forward declared friend, otherwise types and members
+-        // of the outer class are not accessible.
+-        struct TabItem;
+-        friend struct ScExternalRefManager::RefCells::TabItem;
+-
+-        struct TabItem
+-        {
+-            SCTAB       mnIndex;
+-            ColSet      maCols;
+-            explicit TabItem(SCTAB nIndex);
+-            explicit TabItem(const TabItem& r);
+-        };
+-        typedef ::boost::shared_ptr<TabItem>        TabItemRef;
+-
+-        /** 
+-         * Return the position that points either to the specified table 
+-         * position or to the position where a new table would be inserted in 
+-         * case the specified table is not present.
+-         *  
+-         * @param nTab index of the desired table 
+-         */
+-        ::std::list<TabItemRef>::iterator getTabPos(SCTAB nTab);
+-
+-        // This list must be sorted by the table index at all times.
+-        ::std::list<TabItemRef> maTables;
+-    };
++    typedef ::std::set<ScFormulaCell*>                      RefCellSet;
++    typedef ::std::hash_map<sal_uInt16, RefCellSet>         RefCellMap;
+ 
+     enum LinkUpdateType { LINK_MODIFIED, LINK_BROKEN };
+ 
+@@ -441,7 +393,6 @@ private:
+     typedef ::std::hash_map<sal_uInt16, SrcShell>           DocShellMap;
+     typedef ::std::hash_map<sal_uInt16, bool>               LinkedDocMap;
+ 
+-    typedef ::std::hash_map<sal_uInt16, RefCells>           RefCellMap;
+     typedef ::std::hash_map<sal_uInt16, SvNumberFormatterMergeMap> NumFmtMap;
+ 
+ 
+@@ -668,32 +619,12 @@ public:
+     void resetSrcFileData(const String& rBaseFileUrl);
+ 
+     /** 
+-     * Update a single referencing cell position.
+-     *
+-     * @param rOldPos old position
+-     * @param rNewPos new position
+-     */
+-    void updateRefCell(const ScAddress& rOldPos, const ScAddress& rNewPos, bool bCopy);
+-
+-    /** 
+-     * Update referencing cells affected by sheet movement.
+-     *
+-     * @param nOldTab old sheet position
+-     * @param nNewTab new sheet position
+-     * @param bCopy whether this is a sheet move (false) or sheet copy (true)
+-     */
+-    void updateRefMoveTable(SCTAB nOldTab, SCTAB nNewTab, bool bCopy);
+-
+-    /** 
+-     * Update referencing cells affected by sheet insertion.
+-     *
+-     * @param nPos sheet insertion position.  All sheets to the right 
+-     *             including the one at the insertion poistion shift to the
+-     *             right by one.
++     * Stop tracking a specific formula cell. 
++     *  
++     * @param pCell pointer to cell that formerly contained external 
++     *              reference.
+      */
+-    void updateRefInsertTable(SCTAB nPos);
+-
+-    void updateRefDeleteTable(SCTAB nPos);
++    void removeRefCell(ScFormulaCell* pCell);
+ 
+     /** 
+      * Register a new link listener to a specified external document.  Note 
+diff --git sc/source/core/data/cell.cxx sc/source/core/data/cell.cxx
+index 312ad38..b781747 100644
+--- sc/source/core/data/cell.cxx
++++ sc/source/core/data/cell.cxx
+@@ -833,6 +833,9 @@ ScFormulaCell::~ScFormulaCell()
+     if (pCode->HasOpCode(ocMacro))
+         pDocument->GetMacroManager()->RemoveDependentCell(this);
+ 
++    if (pDocument->HasExternalRefManager())
++        pDocument->GetExternalRefManager()->removeRefCell(this);
++
+     delete pCode;
+ #ifdef DBG_UTIL
+     eCellType = CELLTYPE_DESTROYED;
+diff --git sc/source/core/data/cell2.cxx sc/source/core/data/cell2.cxx
+index 32a0fa5..033ad58 100644
+--- sc/source/core/data/cell2.cxx
++++ sc/source/core/data/cell2.cxx
+@@ -1133,17 +1133,6 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
+ 
+         delete pOld;
+     }
+-
+-    pCode->Reset();
+-    for ( formula::FormulaToken* t = pCode->GetNextReferenceOrName(); t; t = pCode->GetNextReferenceOrName() )
+-    {
+-        StackVar sv = t->GetType();
+-        if (sv == svExternalSingleRef || sv == svExternalDoubleRef || sv == svExternalName)
+-        {
+-            pDocument->GetExternalRefManager()->updateRefCell(aOldPos, aPos, eUpdateRefMode == URM_COPY);
+-            break;
+-        }
+-    }
+ }
+ 
+ void ScFormulaCell::UpdateInsertTab(SCTAB nTable)
+diff --git sc/source/core/data/documen2.cxx sc/source/core/data/documen2.cxx
+index cbcd57a..6dfb1c5 100644
+--- sc/source/core/data/documen2.cxx
++++ sc/source/core/data/documen2.cxx
+@@ -811,10 +811,6 @@ BOOL ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos )
+                 if (pDrawLayer)
+                     DrawMovePage( static_cast<sal_uInt16>(nOldPos), static_cast<sal_uInt16>(nNewPos) );
+ 
+-                // Update cells containing external references.
+-                if (pExternalRefMgr.get())
+-                    pExternalRefMgr->updateRefMoveTable(nOldPos, nNewPos, false);
+-
+                 bValid = TRUE;
+             }
+         }
+@@ -932,10 +928,6 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
+ 
+         pTab[nNewPos]->SetPageStyle( pTab[nOldPos]->GetPageStyle() );
+         pTab[nNewPos]->SetPendingRowHeights( pTab[nOldPos]->IsPendingRowHeights() );
+-
+-        // Update cells containing external references.
+-        if (pExternalRefMgr.get())
+-            pExternalRefMgr->updateRefMoveTable(nOldPos, nNewPos, true);
+     }
+     else
+         SetAutoCalc( bOldAutoCalc );
+diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
+index 91abb1b..7471be0 100644
+--- sc/source/core/data/document.cxx
++++ sc/source/core/data/document.cxx
+@@ -392,10 +392,6 @@ BOOL ScDocument::InsertTab( SCTAB nPos, const String& rName,
+                 if ( pChartListenerCollection )
+                     pChartListenerCollection->UpdateScheduledSeriesRanges();
+ 
+-                // Update cells containing external references.
+-                if (pExternalRefMgr.get())
+-                    pExternalRefMgr->updateRefInsertTable(nPos);
+-
+                 SetDirty();
+                 bValid = TRUE;
+             }
+@@ -487,11 +483,6 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
+                 // #81844# sheet names of references are not valid until sheet is deleted
+                 pChartListenerCollection->UpdateScheduledSeriesRanges();
+ 
+-
+-                // Update cells containing external references.
+-                if (pExternalRefMgr.get())
+-                    pExternalRefMgr->updateRefDeleteTable(nTab);
+-
+                 SetAutoCalc( bOldAutoCalc );
+                 bValid = TRUE;
+             }
+diff --git sc/source/ui/docshell/externalrefmgr.cxx sc/source/ui/docshell/externalrefmgr.cxx
+index 9081d07..f6ab979 100644
+--- sc/source/ui/docshell/externalrefmgr.cxx
++++ sc/source/ui/docshell/externalrefmgr.cxx
+@@ -140,6 +140,71 @@ private:
+     ScExternalRefManager::LinkUpdateType meType;
+ };
+ 
++struct UpdateFormulaCell : public unary_function<ScFormulaCell*, void>
++{
++    void operator() (ScFormulaCell* pCell) const
++    {
++        // Check to make sure the cell really contains ocExternalRef.
++        // External names, external cell and range references all have a
++        // ocExternalRef token.
++        const ScTokenArray* pCode = pCell->GetCode();
++        if (!pCode->HasOpCode( ocExternalRef))
++            return;
++
++        ScTokenArray* pArray = pCell->GetCode();
++        if (pArray)
++            // Clear the error code, or a cell with error won't get re-compiled.
++            pArray->SetCodeError(0);
++
++        pCell->SetCompile(true);
++        pCell->CompileTokenArray();
++        pCell->SetDirty();
++    }
++};
++
++class RemoveFormulaCell : public unary_function<pair<const sal_uInt16, ScExternalRefManager::RefCellSet>, void>
++{
++public:
++    explicit RemoveFormulaCell(ScFormulaCell* p) : mpCell(p) {}
++    void operator() (pair<const sal_uInt16, ScExternalRefManager::RefCellSet>& r) const
++    {
++        r.second.erase(mpCell);
++    }
++private:
++    ScFormulaCell* mpCell;
++};
++
++class ConvertFormulaToStatic : public unary_function<ScFormulaCell*, void>
++{
++public:
++    explicit ConvertFormulaToStatic(ScDocument* pDoc) : mpDoc(pDoc) {}
++    void operator() (ScFormulaCell* pCell) const
++    {
++        String aStr;
++        pCell->aPos.Format(aStr, SCA_VALID);
++        ScAddress aPos = pCell->aPos;
++
++        // We don't check for empty cells because empty external cells are 
++        // treated as having a value of 0.
++
++        if (pCell->IsValue())
++        {
++            // Turn this into value cell.
++            double fVal = pCell->GetValue();
++            mpDoc->PutCell(aPos, new ScValueCell(fVal));
++        }
++        else
++        {
++            // string cell otherwise.
++            String aVal;
++            pCell->GetString(aVal);
++            mpDoc->PutCell(aPos, new ScStringCell(aVal));
++        }
++    }
++private:
++    ScDocument* mpDoc;
++};
++
+ }
+ 
+ // ============================================================================
+@@ -1417,230 +1482,6 @@ ScExternalRefCache::TableTypeRef ScExternalRefManager::getCacheTable(sal_uInt16
+ 
+ // ============================================================================
+ 
+-ScExternalRefManager::RefCells::TabItem::TabItem(SCTAB nIndex) :
+-    mnIndex(nIndex)
+-{
+-}
+-
+-ScExternalRefManager::RefCells::TabItem::TabItem(const TabItem& r) :
+-    mnIndex(r.mnIndex),
+-    maCols(r.maCols)
+-{
+-}
+-
+-ScExternalRefManager::RefCells::RefCells()
+-{
+-}
+-
+-ScExternalRefManager::RefCells::~RefCells()
+-{
+-}
+-
+-list<ScExternalRefManager::RefCells::TabItemRef>::iterator ScExternalRefManager::RefCells::getTabPos(SCTAB nTab)
+-{
+-    list<TabItemRef>::iterator itr = maTables.begin(), itrEnd = maTables.end();
+-    for (; itr != itrEnd; ++itr)
+-        if ((*itr)->mnIndex >= nTab)
+-            return itr;
+-    // Not found.  return the end position.
+-    return itrEnd;
+-}
+-
+-void ScExternalRefManager::RefCells::insertCell(const ScAddress& rAddr)
+-{
+-    SCTAB nTab = rAddr.Tab();
+-    SCCOL nCol = rAddr.Col();
+-    SCROW nRow = rAddr.Row();
+-
+-    // Search by table index.
+-    list<TabItemRef>::iterator itrTab = getTabPos(nTab);
+-    TabItemRef xTabRef;
+-    if (itrTab == maTables.end())
+-    {
+-        // All previous tables come before the specificed table.
+-        xTabRef.reset(new TabItem(nTab));
+-        maTables.push_back(xTabRef);
+-    }
+-    else if ((*itrTab)->mnIndex > nTab)
+-    {
+-        // Insert at the current iterator position.
+-        xTabRef.reset(new TabItem(nTab));
+-        maTables.insert(itrTab, xTabRef);
+-    }
+-    else if ((*itrTab)->mnIndex == nTab)
+-    {
+-        // The table found.
+-        xTabRef = *itrTab;
+-    }
+-    ColSet& rCols = xTabRef->maCols;
+-
+-    // Then by column index.
+-    ColSet::iterator itrCol = rCols.find(nCol);
+-    if (itrCol == rCols.end())
+-    {
+-        RowSet aRows;
+-        pair<ColSet::iterator, bool> r = rCols.insert(ColSet::value_type(nCol, aRows));
+-        if (!r.second)
+-            // column insertion failed.
+-            return;
+-        itrCol = r.first;
+-    }
+-    RowSet& rRows = itrCol->second;
+-
+-    // Finally, insert the row index.
+-    rRows.insert(nRow);
+-}
+-
+-void ScExternalRefManager::RefCells::removeCell(const ScAddress& rAddr)
+-{
+-    SCTAB nTab = rAddr.Tab();
+-    SCCOL nCol = rAddr.Col();
+-    SCROW nRow = rAddr.Row();
+-
+-    // Search by table index.
+-    list<TabItemRef>::iterator itrTab = getTabPos(nTab);
+-    if (itrTab == maTables.end() || (*itrTab)->mnIndex != nTab)
+-        // No such table.
+-        return;
+-
+-    ColSet& rCols = (*itrTab)->maCols;
+-
+-    // Then by column index.
+-    ColSet::iterator itrCol = rCols.find(nCol);
+-    if (itrCol == rCols.end())
+-        // No such column
+-        return;
+-
+-    RowSet& rRows = itrCol->second;
+-    rRows.erase(nRow);
+-}
+-
+-void ScExternalRefManager::RefCells::moveTable(SCTAB nOldTab, SCTAB nNewTab, bool bCopy)
+-{
+-    if (nOldTab == nNewTab)
+-        // Nothing to do here.
+-        return;
+-
+-    list<TabItemRef>::iterator itrOld = getTabPos(nOldTab);
+-    if (itrOld == maTables.end() || (*itrOld)->mnIndex != nOldTab)
+-        // No table to move or copy.
+-        return;
+-
+-    list<TabItemRef>::iterator itrNew = getTabPos(nNewTab);
+-    if (bCopy)
+-    {
+-        // Simply make a duplicate of the original table, insert it at the
+-        // new tab position, and increment the table index for all tables
+-        // that come after that inserted table.
+-
+-        TabItemRef xNewTab(new TabItem(*(*itrOld)));
+-        xNewTab->mnIndex = nNewTab;
+-        maTables.insert(itrNew, xNewTab);
+-        list<TabItemRef>::iterator itr = itrNew, itrEnd = maTables.end();
+-        if (itr != itrEnd)  // #i99807# check that itr is not at end already
+-            for (++itr; itr != itrEnd; ++itr)
+-                (*itr)->mnIndex += 1;
+-    }
+-    else
+-    {
+-        if (itrOld == itrNew)
+-        {
+-            // No need to move the table.  Just update the table index.
+-            (*itrOld)->mnIndex = nNewTab;
+-            return;
+-        }
+-
+-        if (nOldTab < nNewTab)
+-        {
+-            // Iterate from the old tab position to the new tab position (not
+-            // inclusive of the old tab itself), and decrement their tab
+-            // index by one.
+-            list<TabItemRef>::iterator itr = itrOld;
+-            for (++itr; itr != itrNew; ++itr)
+-                (*itr)->mnIndex -= 1;
+-
+-            // Insert a duplicate of the original table.  This does not
+-            // invalidate the iterators.
+-            (*itrOld)->mnIndex = nNewTab - 1;
+-            if (itrNew == maTables.end())
+-                maTables.push_back(*itrOld);
+-            else
+-                maTables.insert(itrNew, *itrOld);
+-
+-            // Remove the original table.
+-            maTables.erase(itrOld);
+-        }
+-        else
+-        {
+-            // nNewTab < nOldTab
+-
+-            // Iterate from the new tab position to the one before the old tab
+-            // position, and increment their tab index by one.
+-            list<TabItemRef>::iterator itr = itrNew;
+-            for (++itr; itr != itrOld; ++itr)
+-                (*itr)->mnIndex += 1;
+-
+-            (*itrOld)->mnIndex = nNewTab;
+-            maTables.insert(itrNew, *itrOld);
+-
+-            // Remove the original table.
+-            maTables.erase(itrOld);
+-        }
+-    }
+-}
+-
+-void ScExternalRefManager::RefCells::insertTable(SCTAB nPos)
+-{
+-    TabItemRef xNewTab(new TabItem(nPos));
+-    list<TabItemRef>::iterator itr = getTabPos(nPos);
+-    if (itr == maTables.end())
+-        maTables.push_back(xNewTab);
+-    else
+-        maTables.insert(itr, xNewTab);
+-}
+-
+-void ScExternalRefManager::RefCells::removeTable(SCTAB nPos)
+-{
+-    list<TabItemRef>::iterator itr = getTabPos(nPos);
+-    if (itr == maTables.end())
+-        // nothing to remove.
+-        return;
+-
+-    maTables.erase(itr);
+-}
+-
+-void ScExternalRefManager::RefCells::refreshAllCells(ScExternalRefManager& rRefMgr)
+-{
+-    // Get ALL the cell positions for re-compilation.
+-    for (list<TabItemRef>::iterator itrTab = maTables.begin(), itrTabEnd = maTables.end();
+-          itrTab != itrTabEnd; ++itrTab)
+-    {
+-        SCTAB nTab = (*itrTab)->mnIndex;
+-        ColSet& rCols = (*itrTab)->maCols;
+-        for (ColSet::iterator itrCol = rCols.begin(), itrColEnd = rCols.end();
+-              itrCol != itrColEnd; ++itrCol)
+-        {
+-            SCCOL nCol = itrCol->first;
+-            RowSet& rRows = itrCol->second;
+-            RowSet aNewRows;
+-            for (RowSet::iterator itrRow = rRows.begin(), itrRowEnd = rRows.end();
+-                  itrRow != itrRowEnd; ++itrRow)
+-            {
+-                SCROW nRow = *itrRow;
+-                ScAddress aCell(nCol, nRow, nTab);
+-                if (rRefMgr.compileTokensByCell(aCell))
+-                    // This cell still contains an external refernce.
+-                    aNewRows.insert(nRow);
+-            }
+-            // Update the rows so that cells with no external references are
+-            // no longer tracked.
+-            rRows.swap(aNewRows);
+-        }
+-    }
+-}
+-
+-// ----------------------------------------------------------------------------
+-
+ ScExternalRefManager::LinkListener::LinkListener()
+ {
+ }
+@@ -1985,8 +1826,8 @@ void ScExternalRefManager::refreshAllRefCells(sal_uInt16 nFileId)
+     if (itrFile == maRefCells.end())
+         return;
+ 
+-    RefCells& rRefCells = itrFile->second;
+-    rRefCells.refreshAllCells(*this);
++    RefCellSet& rRefCells = itrFile->second;
++    for_each(rRefCells.begin(), rRefCells.end(), UpdateFormulaCell());
+ 
+     ScViewData* pViewData = ScDocShell::GetViewData();
+     if (!pViewData)
+@@ -2007,7 +1848,7 @@ void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rC
+     RefCellMap::iterator itr = maRefCells.find(nFileId);
+     if (itr == maRefCells.end())
+     {
+-        RefCells aRefCells;
++        RefCellSet aRefCells;
+         pair<RefCellMap::iterator, bool> r = maRefCells.insert(
+             RefCellMap::value_type(nFileId, aRefCells));
+         if (!r.second)
+@@ -2016,7 +1857,10 @@ void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rC
+ 
+         itr = r.first;
+     }
+-    itr->second.insertCell(rCell);
++
++    ScBaseCell* pCell = mpDoc->GetCell(rCell);
++    if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA)
++        itr->second.insert(static_cast<ScFormulaCell*>(pCell));
+ }
+ 
+ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
+@@ -2352,6 +2196,18 @@ void ScExternalRefManager::refreshNames(sal_uInt16 nFileId)
+ 
+ void ScExternalRefManager::breakLink(sal_uInt16 nFileId)
+ {
++    // Turn all formula cells referencing this external document into static
++    // cells.
++    RefCellMap::iterator itrRefs = maRefCells.find(nFileId);
++    if (itrRefs != maRefCells.end())
++    {
++        // Make a copy because removing the formula cells below will modify
++        // the original container.
++        RefCellSet aSet = itrRefs->second;
++        for_each(aSet.begin(), aSet.end(), ConvertFormulaToStatic(mpDoc));
++        maRefCells.erase(nFileId);
++    }
++
+     lcl_removeByFileId(nFileId, maDocShells);
+ 
+     if (maDocShells.empty())
+@@ -2423,32 +2279,9 @@ void ScExternalRefManager::resetSrcFileData(const String& rBaseFileUrl)
+     }
+ }
+ 
+-void ScExternalRefManager::updateRefCell(const ScAddress& rOldPos, const ScAddress& rNewPos, bool bCopy)
+-{
+-    for (RefCellMap::iterator itr = maRefCells.begin(), itrEnd = maRefCells.end(); itr != itrEnd; ++itr)
+-    {
+-        if (!bCopy)
+-            itr->second.removeCell(rOldPos);
+-        itr->second.insertCell(rNewPos);
+-    }
+-}
+-
+-void ScExternalRefManager::updateRefMoveTable(SCTAB nOldTab, SCTAB nNewTab, bool bCopy)
+-{
+-    for (RefCellMap::iterator itr = maRefCells.begin(), itrEnd = maRefCells.end(); itr != itrEnd; ++itr)
+-        itr->second.moveTable(nOldTab, nNewTab, bCopy);
+-}
+-
+-void ScExternalRefManager::updateRefInsertTable(SCTAB nPos)
+-{
+-    for (RefCellMap::iterator itr = maRefCells.begin(), itrEnd = maRefCells.end(); itr != itrEnd; ++itr)
+-        itr->second.insertTable(nPos);
+-}
+-
+-void ScExternalRefManager::updateRefDeleteTable(SCTAB nPos)
++void ScExternalRefManager::removeRefCell(ScFormulaCell* pCell)
+ {
+-    for (RefCellMap::iterator itr = maRefCells.begin(), itrEnd = maRefCells.end(); itr != itrEnd; ++itr)
+-        itr->second.removeTable(nPos);
++    for_each(maRefCells.begin(), maRefCells.end(), RemoveFormulaCell(pCell));
+ }
+ 
+ void ScExternalRefManager::addLinkListener(sal_uInt16 nFileId, LinkListener* pListener)


More information about the ooo-build-commit mailing list