sc/source/filter/xml/xmlcelli.cxx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
New commits: commit cb7ab49dde0ae21c472300f126cce4555a3e0ae5 Author: Eike Rathke <er...@redhat.com> Date: Fri Jan 6 18:28:42 2017 +0100 recognize the broken "Err:xxx" written by 5.2 and earlier, tdf#105024 related ... and handle same as "#ERRxxx!" if present. Change-Id: I1ebb31d628b080c52b450a8fe624c20e9e1188b7 (cherry picked from commit 75d963bc7bb87429f304d29138c27178880c039a) Reviewed-on: https://gerrit.libreoffice.org/32793 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 3b38ac4..8fd7eda 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1357,11 +1357,22 @@ void ScXMLTableRowCellContext::PutFormulaCell( const ScAddress& rCellPos ) } else { - OUString aFormulaNmsp = maFormula->second; - if( eGrammar != formula::FormulaGrammar::GRAM_EXTERNAL ) - aFormulaNmsp.clear(); - pCode->AssignXMLString( aText, aFormulaNmsp ); - rDoc.getDoc().IncXMLImportedFormulaCount( aText.getLength() ); + // 5.2 and earlier wrote broken "Err:xxx" as formula to designate + // an error formula cell. + if (aText.startsWithIgnoreAsciiCase("Err:") && aText.getLength() <= 9 && + ((nError = + GetScImport().GetFormulaErrorConstant( "#ERR" + aText.copy(4) + "!")) != FormulaError::NONE)) + { + pCode->SetCodeError(nError); + } + else + { + OUString aFormulaNmsp = maFormula->second; + if( eGrammar != formula::FormulaGrammar::GRAM_EXTERNAL ) + aFormulaNmsp.clear(); + pCode->AssignXMLString( aText, aFormulaNmsp ); + rDoc.getDoc().IncXMLImportedFormulaCount( aText.getLength() ); + } } ScFormulaCell* pNewCell = new ScFormulaCell(pDoc, rCellPos, pCode, eGrammar, MM_NONE); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits