[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/filters
From:       Lassi Taneli Nieminen <lassniem () gmail ! com>
Date:       2010-08-06 13:10:26
Message-ID: 20100806131026.DB3C5AC7CA () svn ! kde ! org
[Download RAW message or body]

SVN commit 1159894 by lassin:

Added support for PDF unpacking from ole.


 M  +9 -5      kpresenter/pptx/PptxXmlSlideReader.cpp  
 M  +5 -0      libmsooxml/MsooXmlUtils.cpp  


--- trunk/koffice/filters/kpresenter/pptx/PptxXmlSlideReader.cpp #1159893:1159894
@@ -718,6 +718,11 @@
         }
         QString destinationName;
 
+        body->startElement("draw:object-ole");
+        RETURN_IF_ERROR( copyFile(sourceName, "", destinationName))
+        body->addAttribute("xlink:href", destinationName);
+        body->endElement(); // draw:object-ole
+
         if (progId == "Paint.Picture") {
             body->startElement("draw:image");
             RETURN_IF_ERROR( copyFile(sourceName, QLatin1String("Pictures/"), \
destinationName, true) ) @@ -733,12 +738,11 @@
             body->addAttribute("xlink:href", destinationName);
             body->endElement(); // draw:plugin
         }
-        else {
-            body->startElement("draw:object-ole");
-            // In this case the file might already be in ole format, thus it's \
                safest to leave it like that
-            RETURN_IF_ERROR( copyFile(sourceName, "", destinationName ))
+        else if (progId.contains("AcroExch")) { // PDF
+            body->startElement("draw:object"); // The mimetype is not told by the \
ole container, this is best guess +            RETURN_IF_ERROR( copyFile(sourceName, \
"", destinationName, true ))  body->addAttribute("xlink:href", destinationName);
-            body->endElement(); // draw:object-ole
+            body->endElement(); // draw:object
         }
     }
 
--- trunk/koffice/filters/libmsooxml/MsooXmlUtils.cpp #1159893:1159894
@@ -272,7 +272,10 @@
         if (QString((*it).c_str()).contains("Ole10Native")) {
             oleType = "Ole10Native";
         }
+        else if (QString((*it).c_str()).contains("CONTENTS")) {
+            oleType = "CONTENTS";
     }
+    }
 
     POLE::Stream stream(&storage, oleType);
     QByteArray array;
@@ -284,8 +287,10 @@
         return KoFilter::WrongFormat;
     }
 
+    if (oleType == "Contents" || oleType == "Ole10Native") {
     // Removing first 4 bytes which are the size
     array = array.right(array.length() - 4);
+    }
 
     // Uncomment to write any ole file for testing
     //POLE::Stream streamTemp(&storage, "Ole");


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic