summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2016-08-20 23:11:24 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-08-22 21:26:13 +0000
commitfb37ba7df28ee9eb81c1dc21c55baabe56c474b3 (patch)
tree33cc8836b7fd87ec9305f0115b1466d7c7dc2341
parent3770f3e5881831093ed54cbc7e9136c1efe59784 (diff)
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 <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 6b056a08fd55..3f73c091a5ea 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 );