diff options
author | Eike Rathke <erack@redhat.com> | 2018-02-09 15:17:35 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-02-09 15:18:50 +0100 |
commit | c7dd72b2bd6a7988e4e1074e9a85222b53ba84ac (patch) | |
tree | f6a5ec65bfec42a1a26081477e88cec58dfb7eb5 /sc | |
parent | 2a7be4a49ca52fc10975fa9fff8befcfdc50e59a (diff) |
CheckLinkFormulaNeedingCheck() for .csv import
Change-Id: I89be713531436f10b38d38f9e0fa527db1e036cd
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/documentimport.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx index 5f8370180c2c..c86065b881ed 100644 --- a/sc/source/core/data/documentimport.cxx +++ b/sc/source/core/data/documentimport.cxx @@ -209,6 +209,7 @@ void ScDocumentImport::setAutoInput(const ScAddress& rPos, const OUString& rStr, pBlockPos->miCellPos = rCells.set(pBlockPos->miCellPos, rPos.Row(), aCell.mfValue); break; case CELLTYPE_FORMULA: + mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *aCell.mpFormula->GetCode()); // This formula cell instance is directly placed in the document without copying. pBlockPos->miCellPos = rCells.set(pBlockPos->miCellPos, rPos.Row(), aCell.mpFormula); aCell.mpFormula = nullptr; diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 56004800a96c..3088c50efe29 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1216,7 +1216,18 @@ static bool lcl_PutString( if ( bUseDocImport ) rDocImport.setAutoInput(ScAddress(nCol, nRow, nTab), rStr, &aParam); else + { pDoc->SetString( nCol, nRow, nTab, rStr, &aParam ); + // ScColumn::ParseString() is strict about the first character + // having to be '=' for formula, so we can use that here and don't + // need to obtain the created cell for each and every value. + if (rStr.getLength() > 1 && rStr[0] == '=') + { + const ScFormulaCell* pFC = pDoc->GetFormulaCell( ScAddress( nCol, nRow, nTab)); + if (pFC) + pDoc->CheckLinkFormulaNeedingCheck( *pFC->GetCode()); + } + } } else { |