[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/source

Jacobo Aragunde Pérez jaragunde at igalia.com
Mon May 26 04:34:57 PDT 2014


 sw/source/filter/ww8/docxattributeoutput.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 1c39664145d8e9623fd0c0b838aa73dd40bf3485
Author: Jacobo Aragunde Pérez <jaragunde at igalia.com>
Date:   Fri May 23 16:51:28 2014 +0200

    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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 96602c3..5ab2683 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4130,12 +4130,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";


More information about the Libreoffice-commits mailing list