summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-02-14 12:53:19 +0100
committerEike Rathke <erack@redhat.com>2018-02-14 12:54:24 +0100
commitf41c14706c6bf8aa5c3df220c706669f1ec6e1f6 (patch)
treeb03a66661ebf3bcfa856df310d4404c0d0bc1805 /sc
parentf841dada1a5018897cce29ccf972da33ece4738c (diff)
More CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell()
and ScDocumentImport::setMatrixCells() Change-Id: Id3303fb71889c760424459daa79feca0f2510a3c
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documentimport.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index a4161d9071f1..3db030880f1b 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -319,6 +319,8 @@ void ScDocumentImport::setFormulaCell(
std::unique_ptr<ScFormulaCell> pFC =
o3tl::make_unique<ScFormulaCell>(&mpImpl->mrDoc, rPos, rFormula, eGrammar);
+ mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pFC->GetCode());
+
// Set cached result to this formula cell.
pFC->SetHybridString(mpImpl->mrDoc.GetSharedStringPool().intern(rResult));
@@ -338,9 +340,14 @@ void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScTokenArray* pArra
if (!pBlockPos)
return;
+ std::unique_ptr<ScFormulaCell> pFC =
+ o3tl::make_unique<ScFormulaCell>(&mpImpl->mrDoc, rPos, pArray);
+
+ mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pFC->GetCode());
+
sc::CellStoreType& rCells = pTab->aCol[rPos.Col()].maCells;
pBlockPos->miCellPos =
- rCells.set(pBlockPos->miCellPos, rPos.Row(), new ScFormulaCell(&mpImpl->mrDoc, rPos, pArray));
+ rCells.set(pBlockPos->miCellPos, rPos.Row(), pFC.release());
}
void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScFormulaCell* pCell)
@@ -354,6 +361,9 @@ void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScFormulaCell* pCel
if (!pBlockPos)
return;
+ if (pCell)
+ mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pCell->GetCode());
+
sc::CellStoreType& rCells = pTab->aCol[rPos.Col()].maCells;
pBlockPos->miCellPos =
rCells.set(pBlockPos->miCellPos, rPos.Row(), pCell);
@@ -378,6 +388,8 @@ void ScDocumentImport::setMatrixCells(
// Set the master cell.
ScFormulaCell* pCell = new ScFormulaCell(&mpImpl->mrDoc, rBasePos, rArray, eGram, ScMatrixMode::Formula);
+ mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pCell->GetCode());
+
pBlockPos->miCellPos =
rCells.set(pBlockPos->miCellPos, rBasePos.Row(), pCell);