sc/source/filter/xml/xmlcelli.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
New commits: commit 7f3e71d2a6e34e33d04739bdf48ea3c18beef1be Author: Eike Rathke <er...@redhat.com> Date: Fri Jan 6 17:16:25 2017 +0100 display error constants written by 5.3+ in the for 5.2 usual way, tdf#105024 Change-Id: I5b61ed58144ae1583d74056389478e9d5c86d2cb Reviewed-on: https://gerrit.libreoffice.org/32794 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 5c8a4f1..4670aed 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1404,11 +1404,26 @@ void ScXMLTableRowCellContext::PutFormulaCell( const ScAddress& rCellPos ) sal_uInt32 nEnglish = pFormatter->GetStandardIndex(LANGUAGE_ENGLISH_US); double fVal; if ( pFormatter->IsNumberFormat( aText, nEnglish, fVal ) ) + { rDoc.setNumericCell(rCellPos, fVal); - //the (english) number format will not be set - //search matching local format and apply it + //the (english) number format will not be set + //search matching local format and apply it + } else + { + // Error constants are stored as "#ERRxxx!" by 5.3+, error + // numbers are sal_uInt16 so at most 5 decimal digits, no + // other expression must be present. + if (aText.startsWithIgnoreAsciiCase("#ERR") && aText.getLength() <= 10 && + aText[aText.getLength()-1] == '!') + { + // Display error constants written by 5.3+ in the for 5.2 usual way. + sal_uInt32 nErr = aText.copy( 4, aText.getLength() - 5).toUInt32(); + if (0 < nErr && nErr <= SAL_MAX_UINT16) + aText = ScGlobal::GetErrorString(nErr); + } rDoc.setStringCell(rCellPos, aText); + } } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits