sc/source/core/data/documentimport.cxx | 1 + sc/source/ui/docshell/impex.cxx | 11 +++++++++++ 2 files changed, 12 insertions(+)
New commits: commit c7dd72b2bd6a7988e4e1074e9a85222b53ba84ac Author: Eike Rathke <er...@redhat.com> Date: Fri Feb 9 15:17:35 2018 +0100 CheckLinkFormulaNeedingCheck() for .csv import Change-Id: I89be713531436f10b38d38f9e0fa527db1e036cd 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 { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits