summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-02-13 18:08:28 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2018-02-15 02:07:39 +0100
commitc9cfcd5f56fb2395a281df7466e5a2d9a2cf309e (patch)
treead38331310fb0c65cb26705371b8cbbf4d099a77 /sc
parent6be2c684effd6732c92df7ef75581772adb6dac3 (diff)
CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell()
and ScDocumentImport::setMatrixCells() This is a combination of 2 commits. CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell() (cherry picked from commit bcd62f2050336951ad56892d6e0a42f63c59a674) Conflicts: sc/source/core/data/documentimport.cxx More CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell() and ScDocumentImport::setMatrixCells() (cherry picked from commit f41c14706c6bf8aa5c3df220c706669f1ec6e1f6) Conflicts: sc/source/core/data/documentimport.cxx d3303fb71889c760424459daa79feca0f2510a3c Change-Id: I1587be914b390b2597185dd5af870d1d785010a4 Reviewed-on: https://gerrit.libreoffice.org/49735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documentimport.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index 95d38ee08f51..c0e4d3c9e60f 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -25,6 +25,7 @@
#include <svl/sharedstringpool.hxx>
#include <svl/languageoptions.hxx>
+#include <o3tl/make_unique.hxx>
#include <memory>
#include <vector>
@@ -276,9 +277,14 @@ void ScDocumentImport::setFormulaCell(
if (!pBlockPos)
return;
+ std::unique_ptr<ScFormulaCell> pFC =
+ o3tl::make_unique<ScFormulaCell>(&mpImpl->mrDoc, rPos, rFormula, eGrammar);
+
+ 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, rFormula, eGrammar));
+ rCells.set(pBlockPos->miCellPos, rPos.Row(), pFC.release());
}
void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScTokenArray* pArray)
@@ -292,9 +298,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)
@@ -308,6 +319,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);
@@ -332,6 +346,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);