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-08 13:27:50 +0000 |
commit | 1eb1d5a643f3526d540abe783edac78c8ded476b (patch) | |
tree | 910e1a603c8bd5cc40dc54a7f80af18e68b3e2ba | |
parent | 995a06e212c1a5ca6b5f29ad01d445a1c0d460f1 (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/13589
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 234e65b4c225..3de8363fc9d6 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1671,14 +1671,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); |