summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-11-14 17:47:42 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-11-18 08:31:56 -0500
commitc55a5b242585824d3c6c217f813dc9acfc3228b2 (patch)
treec0524e7f60e919e188dd4e25883fe05584284cf5 /sc
parent2030b9ac6c68ba6f15b0283e0b4e57ae49bd67b0 (diff)
We don't need 2 variants of this method. One is enough.
Change-Id: I001c388669737e9cf1d92f1fbb1e64fb9f4b05c3
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/grouparealistener.hxx10
-rw-r--r--sc/source/core/tool/grouparealistener.cxx91
2 files changed, 1 insertions, 100 deletions
diff --git a/sc/inc/grouparealistener.hxx b/sc/inc/grouparealistener.hxx
index 6301023d8093..28e8f4320ad4 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 e682d613d0ec..7a834614b5e7 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));
}