sc/inc/grouparealistener.hxx              |   10 ---
 sc/source/core/tool/grouparealistener.cxx |   91 ------------------------------
 2 files changed, 1 insertion(+), 100 deletions(-)

New commits:
commit e8184b4bda4f8ce0bfa676d592e1f493ca9e3eeb
Author: Kohei Yoshida <kohei.yosh...@collabora.com>
Date:   Fri Nov 14 17:47:42 2014 -0500

    We don't need 2 variants of this method.  One is enough.
    
    Change-Id: I001c388669737e9cf1d92f1fbb1e64fb9f4b05c3

diff --git a/sc/inc/grouparealistener.hxx b/sc/inc/grouparealistener.hxx
index 6301023..28e8f43 100644
--- a/sc/inc/grouparealistener.hxx
+++ b/sc/inc/grouparealistener.hxx
@@ -39,16 +39,6 @@ public:
     virtual void Notify( const SfxHint& rHint ) SAL_OVERRIDE;
 
     /**
-     * Given the position of a changed cell, collect all formula cells that
-     * need to be notified of the change.
-     *
-     * @param rPos position of changed cell.
-     * @param rCells all formula cells that need to be notified are put into
-     *               this container.
-     */
-    void collectFormulaCells( const ScAddress& rPos, 
std::vector<ScFormulaCell*>& rCells ) const;
-
-    /**
      * Given the row span of changed cells within a single column, collect all
      * formula cells that need to be notified of the change.
      *
diff --git a/sc/source/core/tool/grouparealistener.cxx 
b/sc/source/core/tool/grouparealistener.cxx
index e682d61..7a83461 100644
--- a/sc/source/core/tool/grouparealistener.cxx
+++ b/sc/source/core/tool/grouparealistener.cxx
@@ -125,95 +125,6 @@ void FormulaGroupAreaListener::notifyBulkChange( const 
BulkDataHint& rHint )
     std::for_each(aCells.begin(), aCells.end(), Notifier(aHint));
 }
 
-void FormulaGroupAreaListener::collectFormulaCells( const ScAddress& rPos, 
std::vector<ScFormulaCell*>& rCells ) const
-{
-    if (rPos.Tab() < maRange.aStart.Tab() || maRange.aEnd.Tab() < rPos.Tab())
-        // Wrong sheet.
-        return;
-
-    if (rPos.Col() < maRange.aStart.Col() || maRange.aEnd.Col() < rPos.Col())
-        // Outside the column range.
-        return;
-
-    ScFormulaCell** pp = mppTopCell;
-    ScFormulaCell** ppEnd = pp + mnGroupLen;
-
-    if (mbStartFixed)
-    {
-        if (mbEndFixed)
-        {
-            // Both top and bottom row positions are absolute.  Use the 
original range as-is.
-            SCROW nRow1 = maRange.aStart.Row();
-            SCROW nRow2 = maRange.aEnd.Row();
-            if (rPos.Row() < nRow1 || nRow2 < rPos.Row())
-                return;
-
-            for (; pp != ppEnd; ++pp)
-                rCells.push_back(*pp);
-        }
-        else
-        {
-            // Only the end row is relative.
-            SCROW nRow1 = maRange.aStart.Row();
-            SCROW nRow2 = maRange.aEnd.Row();
-            SCROW nMaxRow = nRow2 + mnGroupLen - 1;
-            if (rPos.Row() < nRow1 || nMaxRow < rPos.Row())
-                return;
-
-            if (nRow2 < rPos.Row())
-            {
-                // Skip ahead to the first hit.
-                SCROW nSkip = rPos.Row() - nRow2;
-                pp += nSkip;
-                nRow2 += nSkip;
-            }
-
-            // Notify the first hit cell and all subsequent ones.
-            for (; pp != ppEnd; ++pp)
-                rCells.push_back(*pp);
-        }
-    }
-    else if (mbEndFixed)
-    {
-        // Only the start row is relative.
-        SCROW nRow1 = maRange.aStart.Row();
-        SCROW nRow2 = maRange.aEnd.Row();
-
-        if (rPos.Row() < nRow1 || nRow2 < rPos.Row())
-            return;
-
-        for (; pp != ppEnd && nRow1 <= nRow2; ++pp, ++nRow1)
-            rCells.push_back(*pp);
-    }
-    else
-    {
-        // Both top and bottom row positions are relative.
-        SCROW nRow1 = maRange.aStart.Row();
-        SCROW nRow2 = maRange.aEnd.Row();
-        SCROW nMaxRow = nRow2 + mnGroupLen - 1;
-        if (nMaxRow < rPos.Row())
-            return;
-
-        if (nRow2 < rPos.Row())
-        {
-            // Skip ahead.
-            SCROW nSkip = rPos.Row() - nRow2;
-            pp += nSkip;
-            nRow1 += nSkip;
-            nRow2 += nSkip;
-        }
-
-        for (; pp != ppEnd; ++pp, ++nRow1, ++nRow2)
-        {
-            if (rPos.Row() < nRow1 || nRow2 < rPos.Row())
-                // Changed cell is outside the range.
-                continue;
-
-            rCells.push_back(*pp);
-        }
-    }
-}
-
 void FormulaGroupAreaListener::collectFormulaCells(
     SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2, 
std::vector<ScFormulaCell*>& rCells ) const
 {
@@ -312,7 +223,7 @@ void FormulaGroupAreaListener::notifyCellChange( const 
SfxHint& rHint, const ScA
 {
     // Determine which formula cells within the group need to be notified of 
this change.
     std::vector<ScFormulaCell*> aCells;
-    collectFormulaCells(rPos, aCells);
+    collectFormulaCells(rPos.Tab(), rPos.Col(), rPos.Row(), rPos.Row(), 
aCells);
     std::for_each(aCells.begin(), aCells.end(), Notifier(rHint));
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to