sc/source/filter/oox/stylesbuffer.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
New commits: commit fb37ba7df28ee9eb81c1dc21c55baabe56c474b3 Author: Bartosz Kosiorek <gan...@poczta.onet.pl> Date: Sat Aug 20 23:11:24 2016 +0200 tdf#70565 Set correct default values to "0" of xfId attribute When xfId is not exist during .xlsx import it must have values set to "0". It is not impacts spreadsheets created with MS Excel, as xfId attribute is always created during export to .xlsx Not setting "0" value is causing wrong .xlsx import by LibreOffice, for spreadsheets created by external applications (ex. SAP BI). Change-Id: I1fb685f7ad38bcdb6cce78e6cf49e1825330f661 Reviewed-on: https://gerrit.libreoffice.org/28266 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 6b056a0..3f73c09 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -2072,7 +2072,21 @@ Xf::Xf( const WorkbookHelper& rHelper ) : void Xf::importXf( const AttributeList& rAttribs, bool bCellXf ) { maModel.mbCellXf = bCellXf; - maModel.mnStyleXfId = rAttribs.getInteger( XML_xfId, -1 ); + // tdf#70565 Set proper default value to "0" of xfId attribute + // When xfId is not exist during .xlsx import + // it must have values set to "0". + // Is is not impacts spreadsheets created with MS Excel, + // as xfId attribute is always created during export to .xlsx + // Not setting "0" value is causing wrong .xlsx import by LibreOffice, + // for spreadsheets created by external applications (ex. SAP BI). + if ( maModel.mbCellXf ) + { + maModel.mnStyleXfId = rAttribs.getInteger( XML_xfId, 0 ); + } + else + { + maModel.mnStyleXfId = rAttribs.getInteger( XML_xfId, -1 ); + } maModel.mnFontId = rAttribs.getInteger( XML_fontId, -1 ); maModel.mnNumFmtId = rAttribs.getInteger( XML_numFmtId, -1 ); maModel.mnBorderId = rAttribs.getInteger( XML_borderId, -1 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits