[Libreoffice-commits] core.git: sc/source
Eike Rathke
erack at redhat.com
Wed Feb 14 11:54:50 UTC 2018
sc/source/core/data/documentimport.cxx | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
New commits:
commit f41c14706c6bf8aa5c3df220c706669f1ec6e1f6
Author: Eike Rathke <erack at redhat.com>
Date: Wed Feb 14 12:53:19 2018 +0100
More CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell()
and ScDocumentImport::setMatrixCells()
Change-Id: Id3303fb71889c760424459daa79feca0f2510a3c
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);
More information about the Libreoffice-commits
mailing list