diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-05-23 16:51:28 +0200 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-05-23 17:16:11 +0200 |
commit | 28207c36c3b68af1d09f68e1ae022b21cda976c5 (patch) | |
tree | 05cc98b1345717909d43f44f7cf6ebb3324b45b0 | |
parent | fafe3063bf4aac2e373e3178c12f5969da092203 (diff) |
sw: Properly embed .xls sheets in .docx documents
Word requires exactly the right relationship and content types to open
embedded documents properly. The case of xls sheets is different from
xlsx so we added it to the exporter.
We know if the file is a xls or xlsx using the ProgID field:
ProgID="Excel.Sheet.8" -> Excel version 8 -> xls
ProgID="Excel.Sheet.12" -> Excel version 12 -> xlsx
Change-Id: I80bae0eadd4af2fb9793c8f6581b3f288fb42c09
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 8a2ac9d391ca..8e3a43551b3f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4197,12 +4197,18 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S aObjectsInteropList[i].Value >>= sProgID; break; } - if( sProgID.startsWith("Excel.Sheet") ) + if( sProgID == "Excel.Sheet.12" ) { sMediaType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"; sFileExtension = "xlsx"; } + else if( sProgID.startsWith("Excel.Sheet") ) + { + sMediaType = "application/vnd.ms-excel"; + sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"; + sFileExtension = "xls"; + } else if( sProgID.startsWith("PowerPoint.Show") ) { sMediaType = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; |