summaryrefslogtreecommitdiff
path: root/sc/source/core/data/column3.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-11-19 22:05:32 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-11-19 22:07:35 -0500
commit797db638870f5c6192e72c0b4669b471788e16ea (patch)
tree75e395b7fefc972b0147cafcb17fdbc23525de55 /sc/source/core/data/column3.cxx
parentd273a60bfdbf9bb7623bed38667ec0647753157c (diff)
Use group area listener when entering a new single formula cell.
Change-Id: I01dc4537919b69a312e92ede2ae00fbe7d781bd7
Diffstat (limited to 'sc/source/core/data/column3.cxx')
-rw-r--r--sc/source/core/data/column3.cxx22
1 files changed, 16 insertions, 6 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 150d6097fb7e..8b6fa92f7f92 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -375,13 +375,13 @@ sc::CellStoreType::iterator ScColumn::GetPositionToInsert( const sc::CellStoreTy
}
void ScColumn::AttachNewFormulaCell(
- const sc::CellStoreType::iterator& itPos, SCROW nRow, ScFormulaCell& rCell, bool bJoin )
+ const sc::CellStoreType::iterator& itPos, SCROW nRow, ScFormulaCell& rCell, bool bJoin, bool bSingle )
{
- AttachNewFormulaCell(maCells.position(itPos, nRow), rCell, bJoin);
+ AttachNewFormulaCell(maCells.position(itPos, nRow), rCell, bJoin, bSingle);
}
void ScColumn::AttachNewFormulaCell(
- const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell, bool bJoin )
+ const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell, bool bJoin, bool bSingle )
{
if (bJoin)
// See if this new formula cell can join an existing shared formula group.
@@ -394,7 +394,17 @@ void ScColumn::AttachNewFormulaCell(
// After Import we call CalcAfterLoad and in there Listening.
if (!pDocument->IsClipOrUndo() && !pDocument->IsInsertingFromOtherDoc())
{
- rCell.StartListeningTo(pDocument);
+ if (bSingle)
+ {
+ boost::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*pDocument));
+ sc::StartListeningContext aStartCxt(*pDocument, pPosSet);
+ sc::EndListeningContext aEndCxt(*pDocument, pPosSet);
+ SCROW nRow = aPos.first->position + aPos.second;
+ StartListeningFormulaCells(aStartCxt, aEndCxt, nRow, nRow);
+ }
+ else
+ rCell.StartListeningTo(pDocument);
+
if (!pDocument->IsCalcingAfterLoad())
rCell.SetDirty();
}
@@ -1822,7 +1832,7 @@ void ScColumn::SetFormula( SCROW nRow, const OUString& rFormula, formula::Formul
AttachNewFormulaCell(it, nRow, *pCell);
}
-ScFormulaCell* ScColumn::SetFormulaCell( SCROW nRow, ScFormulaCell* pCell )
+ScFormulaCell* ScColumn::SetFormulaCell( SCROW nRow, ScFormulaCell* pCell, bool bSingle )
{
sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
sal_uInt32 nCellFormat = GetNumberFormat(nRow);
@@ -1833,7 +1843,7 @@ ScFormulaCell* ScColumn::SetFormulaCell( SCROW nRow, ScFormulaCell* pCell )
CellStorageModified();
- AttachNewFormulaCell(it, nRow, *pCell);
+ AttachNewFormulaCell(it, nRow, *pCell, true, bSingle);
return pCell;
}