Ticket #327: ppt2007.patch
File ppt2007.patch, 2.1 KB (added by , 16 years ago) |
---|
-
.cc
old new (this hunk was shorter than expected) 351 351 cout << "\"" << cmd << "\" failed - skipping\n"; 352 352 return; 353 353 } 354 + 355 // Start: PowerPoint 2007 .pptx 356 } else if (startswith(mimetype, "application/vnd.openxmlformats-officedocument.presentationml.")) 357 { 358 // Inspired by http://mjr.towers.org.uk/comp/sxw2text 359 string safefile = shell_protect(file); 360 string cmd = "unzip -p " + safefile + " ppt/slides/slide*.xml"; 361 try { 362 XmlParser xmlparser; 363 xmlparser.parse_html(stdout_to_string(cmd)); 364 dump = xmlparser.dump; 365 } catch (ReadError) { 366 cout << "\"" << cmd << "\" failed - skipping\n"; 367 return; 368 } 369 // End: PowerPoint 2007 .pptx 354 370 } else if (mimetype == "application/vnd.wordperfect") { 355 371 // Looking at the source of wpd2html and wpd2text I think both output 356 372 // utf-8, but it's hard to be sure without sample Unicode .wpd files … … (this hunk was shorter than expected) 362 409 cout << "\"" << cmd << "\" failed - skipping\n"; 363 410 return; 364 411 } 365 412 } else if (mimetype == "application/vnd.ms-works") { 366 413 // wps2text produces UTF-8 output from the sample files I've tested. 367 414 string cmd = "wps2text " + shell_protect(file); … … (this hunk was shorter than expected) 730 788 // Some other word processor formats: 731 789 mime_map["doc"] = "application/msword"; 732 790 mime_map["dot"] = "application/msword"; // Word template 733 791 mime_map["wpd"] = "application/vnd.wordperfect"; 734 792 mime_map["wps"] = "application/vnd.ms-works"; 735 793 mime_map["wpt"] = "application/vnd.ms-works"; // Works template … … 740 799 mime_map["xls"] = "application/vnd.ms-excel"; 741 800 mime_map["xlb"] = "application/vnd.ms-excel"; 742 801 mime_map["xlt"] = "application/vnd.ms-excel"; // Excel template 743 802 mime_map["ppt"] = "application/vnd.ms-powerpoint"; 744 803 mime_map["pps"] = "application/vnd.ms-powerpoint"; // Powerpoint slideshow 804 mime_map["pptx"] = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; //PowerPoint 2007 745 805 // Perl: 746 806 mime_map["pl"] = "text/x-perl"; 747 807 mime_map["pm"] = "text/x-perl";