summaryrefslogtreecommitdiff
path: root/sc/source/core/data/column4.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-11-17 13:06:51 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-11-18 08:31:56 -0500
commit550f0797e64e38a4ef5721857f5057f692680118 (patch)
treed7acb75b32b7847d93926bc3fa3c238c08122926 /sc/source/core/data/column4.cxx
parent34c8c0bb878be82a25cdaf1d7e623843f00fed6c (diff)
Avoid area listeners and such during formula cell paste replication.
All formula cells get marked dirty and start area-listening at the very end of CopyFromClip. No need to do it in CloneFormulaCells. Change-Id: I9faf48fd722c2ebcf4b74d5e523317b5d9c71a22
Diffstat (limited to 'sc/source/core/data/column4.cxx')
-rw-r--r--sc/source/core/data/column4.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 94634dd12769..2d6609db9649 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -213,7 +213,7 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
std::vector<sc::RowSpan> aRanges;
aRanges.reserve(1);
aRanges.push_back(sc::RowSpan(nRow1, nRow2));
- CloneFormulaCell(*rSrcCell.mpFormula, aRanges);
+ CloneFormulaCell(*rSrcCell.mpFormula, aRanges, NULL);
}
break;
default:
@@ -473,11 +473,11 @@ void ScColumn::DeleteRanges( const std::vector<sc::RowSpan>& rRanges, InsertDele
DeleteArea(itSpan->mnRow1, itSpan->mnRow2, nDelFlag, bBroadcast);
}
-void ScColumn::CloneFormulaCell( const ScFormulaCell& rSrc, const std::vector<sc::RowSpan>& rRanges )
+void ScColumn::CloneFormulaCell(
+ const ScFormulaCell& rSrc, const std::vector<sc::RowSpan>& rRanges, sc::StartListeningContext* pCxt )
{
sc::CellStoreType::iterator itPos = maCells.begin();
sc::CellTextAttrStoreType::iterator itAttrPos = maCellTextAttrs.begin();
- sc::StartListeningContext aCxt(*pDocument);
std::vector<ScFormulaCell*> aFormulas;
std::vector<sc::RowSpan>::const_iterator itSpan = rRanges.begin(), itSpanEnd = rRanges.end();
@@ -495,8 +495,11 @@ void ScColumn::CloneFormulaCell( const ScFormulaCell& rSrc, const std::vector<sc
{
// Single, ungrouped formula cell.
ScFormulaCell* pCell = new ScFormulaCell(rSrc, *pDocument, aPos);
- pCell->StartListeningTo(aCxt);
- pCell->SetDirty();
+ if (pCxt)
+ {
+ pCell->StartListeningTo(*pCxt);
+ pCell->SetDirty();
+ }
aFormulas.push_back(pCell);
}
else
@@ -513,8 +516,11 @@ void ScColumn::CloneFormulaCell( const ScFormulaCell& rSrc, const std::vector<sc
xGroup->mpTopCell = pCell;
xGroup->mnLength = nLen;
}
- pCell->StartListeningTo(aCxt);
- pCell->SetDirty();
+ if (pCxt)
+ {
+ pCell->StartListeningTo(*pCxt);
+ pCell->SetDirty();
+ }
aFormulas.push_back(pCell);
}
}