diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-12-22 06:18:07 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-01-07 14:03:39 +0000 |
commit | 0095c410c5a47aef2fa28b69412067a8aa6a89a1 (patch) | |
tree | 38b729e4f1e3fa44759213816d9c987e51c130f0 | |
parent | 5a93387b70e563fe1b5191d20524dd1d0dfec11b (diff) |
fix OOXML validation error, related fdo#40746
e.g. fdo40746-2.ods exported to OOXML
Change-Id: I48bc7a7d21ddc00eceaeb09970a2b1a60330fbf0
Reviewed-on: https://gerrit.libreoffice.org/13587
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/source/filter/excel/xelink.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index bd34008f0967..d9c2196ef57d 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1667,14 +1667,18 @@ void XclExpSupbook::SaveXml( XclExpXmlStream& rStrm ) FSNS(XML_r, XML_id), XclXmlUtils::ToOString( sId ).getStr(), FSEND); - pExternalLink->startElement( XML_sheetNames, FSEND); - for (size_t nPos = 0, nSize = maXctList.GetSize(); nPos < nSize; ++nPos) + if (!maXctList.IsEmpty()) { - pExternalLink->singleElement( XML_sheetName, - XML_val, XclXmlUtils::ToOString( maXctList.GetRecord( nPos )->GetTabName()).getStr(), - FSEND); + pExternalLink->startElement( XML_sheetNames, FSEND); + for (size_t nPos = 0, nSize = maXctList.GetSize(); nPos < nSize; ++nPos) + { + pExternalLink->singleElement( XML_sheetName, + XML_val, XclXmlUtils::ToOString( maXctList.GetRecord( nPos )->GetTabName()).getStr(), + FSEND); + } + pExternalLink->endElement( XML_sheetNames); + } - pExternalLink->endElement( XML_sheetNames); pExternalLink->startElement( XML_sheetDataSet, FSEND); |