[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - sc/source
Eike Rathke
erack at redhat.com
Thu Feb 15 01:07:50 UTC 2018
sc/source/core/data/documentimport.cxx | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
New commits:
commit f4ba47543baf2b63444752ba08f4712d2806adef
Author: Eike Rathke <erack at redhat.com>
Date: Tue Feb 13 18:08:28 2018 +0100
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/49732
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index 1062cc893cd7..713f72615ded 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>
@@ -278,9 +279,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)
@@ -294,9 +300,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)
@@ -310,6 +321,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);
@@ -334,6 +348,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