From 8c51532289db36337c4984baec1bf5a7ca9e40af Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 12 Aug 2014 13:53:11 +0200 Subject: do not write empty externalReferences element, fdo#45286 follow-up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OOXML validation spewed - (xl/workbook.xml:2 col:700) cvc-complex-type.2.4.b: The content of element ´externalReferences´ is not complete. One of ´{"http://schemas.openxmlformats.org/spreadsheetml/2006/main":externalReference}´ is expected. Change-Id: I80552a0e9ffcc201d0462ac20ce37f6657e43587 --- sc/source/filter/excel/excdoc.cxx | 2 -- sc/source/filter/excel/xelink.cxx | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'sc') diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 8dd2b15fe6bd..416e4111f16d 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -371,11 +371,9 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList ) // COUNTRY - in BIFF8 in workbook globals Add( new XclExpCountry( GetRoot() ) ); - aRecList.AppendNewRecord( new XclExpXmlStartElementRecord( XML_externalReferences ) ); // link table: SUPBOOK, XCT, CRN, EXTERNNAME, EXTERNSHEET, NAME aRecList.AppendRecord( CreateRecord( EXC_ID_EXTERNSHEET ) ); aRecList.AppendRecord( CreateRecord( EXC_ID_NAME ) ); - aRecList.AppendNewRecord( new XclExpXmlEndElementRecord( XML_externalReferences ) ); if( GetOutput() != EXC_OUTPUT_BINARY ) lcl_AddCalcPr( aRecList, *this ); diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 0a54a6fc65fe..f4c4224cc776 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -2454,9 +2454,14 @@ void XclExpLinkManagerImpl8::SaveXml( XclExpXmlStream& rStrm ) { if( !maXtiVec.empty() ) { + sax_fastparser::FSHelperPtr pWorkbook = rStrm.GetCurrentStream(); + pWorkbook->startElement( XML_externalReferences, FSEND); + // externalLink, externalBook, sheetNames, sheetDataSet, externalName maSBBuffer.SaveXml( rStrm ); + pWorkbook->endElement( XML_externalReferences); + // TODO: equivalent for EXTERNSHEET in OOXML? #if 0 for( XclExpXtiVec::const_iterator aIt = maXtiVec.begin(), aEnd = maXtiVec.end(); aIt != aEnd; ++aIt ) -- cgit v1.2.3