summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-01-31 20:18:42 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-01-31 21:08:14 -0500
commit34ebbc6418e0953cd857c35e6d63a7aaae74dfda (patch)
tree2cf43f9b6dd652bfd272d75913fd63ffba3bff81 /sc/source
parentaf6116179f33c1ee714eb2b2b326d329267a0cb2 (diff)
Move this to its own method.
Change-Id: Ief8356bc8e0d3d791c97849b8b00ece4ede0b803
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/table4.cxx82
1 files changed, 47 insertions, 35 deletions
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 71fb74cc6dba..16fd34f29529 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1133,6 +1133,51 @@ bool HiddenRowColumn(ScTable* pTable, SCCOLROW nRowColumn, bool bVertical, SCCOL
}
+void ScTable::FillFormulaVertical(
+ const ScFormulaCell& rSrcCell,
+ SCCOLROW& rInner, SCCOL nCol, SCROW nRow1, SCROW nRow2,
+ ScProgress* pProgress, sal_uLong& rProgress )
+{
+ bool bHidden = false;
+ SCCOLROW nHiddenLast = -1;
+
+ SCCOLROW nRowStart = -1, nRowEnd = -1;
+ std::vector<sc::RowSpan> aSpans;
+ for (rInner = nRow1; rInner <= nRow2; ++rInner)
+ {
+ if (rInner > nHiddenLast)
+ bHidden = HiddenRowColumn(this, rInner, true, nHiddenLast);
+
+ if (bHidden)
+ {
+ if (nRowStart >= 0)
+ {
+ nRowEnd = rInner - 1;
+ aSpans.push_back(sc::RowSpan(nRowStart, nRowEnd));
+ nRowStart = -1;
+ }
+ rInner = nHiddenLast;
+ continue;
+ }
+
+ if (nRowStart < 0)
+ nRowStart = rInner;
+ }
+
+ if (nRowStart >= 0)
+ {
+ nRowEnd = rInner - 1;
+ aSpans.push_back(sc::RowSpan(nRowStart, nRowEnd));
+ }
+
+ aCol[nCol].DeleteRanges(aSpans, IDF_CONTENTS, false);
+ aCol[nCol].CloneFormulaCell(rSrcCell, aSpans);
+
+ rProgress += nRow2 - nRow1 + 1;
+ if (pProgress)
+ pProgress->SetStateOnPercent(rProgress);
+}
+
void ScTable::FillSeriesSimple(
ScCellValue& rSrcCell, SCCOLROW& rInner, SCCOLROW nIMin, SCCOLROW nIMax,
SCCOLROW& rCol, SCCOLROW& rRow, bool bVertical, ScProgress* pProgress, sal_uLong& rProgress )
@@ -1146,41 +1191,8 @@ void ScTable::FillSeriesSimple(
{
case CELLTYPE_FORMULA:
{
- SCCOLROW nRowStart = -1, nRowEnd = -1;
- std::vector<sc::RowSpan> aSpans;
- for (rInner = nIMin; rInner <= nIMax; ++rInner)
- {
- if (rInner > nHiddenLast)
- bHidden = HiddenRowColumn(this, rInner, bVertical, nHiddenLast);
-
- if (bHidden)
- {
- if (nRowStart >= 0)
- {
- nRowEnd = rInner - 1;
- aSpans.push_back(sc::RowSpan(nRowStart, nRowEnd));
- nRowStart = -1;
- }
- rInner = nHiddenLast;
- continue;
- }
-
- if (nRowStart < 0)
- nRowStart = rInner;
- }
-
- if (nRowStart >= 0)
- {
- nRowEnd = rInner - 1;
- aSpans.push_back(sc::RowSpan(nRowStart, nRowEnd));
- }
-
- aCol[rCol].DeleteRanges(aSpans, IDF_CONTENTS, false);
- aCol[rCol].CloneFormulaCell(*rSrcCell.mpFormula, aSpans);
-
- rProgress += nIMax - nIMin + 1;
- if (pProgress)
- pProgress->SetStateOnPercent(rProgress);
+ FillFormulaVertical(
+ *rSrcCell.mpFormula, rInner, rCol, nIMin, nIMax, pProgress, rProgress);
}
break;
default: