Patch for regarding internal parse error in ppt
amit aggarwal <amitcs06 <at> gmail.com>
2010-04-01 11:41:41 GMT
Hello,
I am attaching the patch files one for mso.xml and other koffice for
regarding internal parse error in ppt.
Please verify it and commit this patch in mso.
--
Thanks
Amit Aggarwal
Index: tools/scripts/downloadMSOfficeDocuments.pl
===================================================================
--- tools/scripts/downloadMSOfficeDocuments.pl (revision 1109940)
+++ tools/scripts/downloadMSOfficeDocuments.pl (working copy)
<at> <at> -27,6 +27,9 <at> <at>
my %mimetypes = (
"ppt", "application/vnd.ms-powerpoint",
"pdf", "application/pdf",
+ "pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation" ,
+ "xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ "docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"doc", "application/msword",
"xls", "application/vnd.ms-excel",
"rtf", "application/rtf",
Index: filters/libmso/generated/simpleParser.cpp
===================================================================
--- filters/libmso/generated/simpleParser.cpp (revision 1109940)
+++ filters/libmso/generated/simpleParser.cpp (working copy)
<at> <at> -1623,6 +1623,24 <at> <at>
throw IncorrectValueException(in.getPosition(), "((quint32)_s.reserved4) == 0");
}
}
+void MSO::parseDummy(LEInputStream& in, Dummy& _s) {
+ _s.streamOffset = in.getPosition();
+ int _c;
+ LEInputStream::Mark _m;
+ parseOfficeArtRecordHeader(in, _s.rh);
+ if (!(_s.rh.recVer == 3)) {
+ throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 3");
+ }
+ if (!(_s.rh.recInstance == 9)) {
+ throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 9");
+ }
+ if (!(_s.rh.recType == 0x0)) {
+ throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0");
+ }
+ _c = _s.rh.recLen;
+ _s.dummyData.resize(_c);
+ in.readBytes(_s.dummyData);
+}
void MSO::parseTextHeaderAtom(LEInputStream& in, TextHeaderAtom& _s) {
_s.streamOffset = in.getPosition();
parseRecordHeader(in, _s.rh);
<at> <at> -9087,6 +9105,28 <at> <at>
}
_m = in.setMark();
try {
+ OfficeArtRecordHeader _optionCheck(&_s);
+ parseOfficeArtRecordHeader(in, _optionCheck);
+ _possiblyPresent = (_optionCheck.recVer == 3)&&(_optionCheck.recInstance ==
9)&&(_optionCheck.recType == 0x0);
+ } catch(EOFException _e) {
+ _possiblyPresent = false;
+ }
+ in.rewind(_m);
+ _m = in.setMark();
+ if (_possiblyPresent) {
+ try {
+ _s.dummy = QSharedPointer<Dummy>(new Dummy(&_s));
+ parseDummy(in, *_s.dummy.data());
+ } catch(IncorrectValueException _e) {
+ _s.dummy.clear();
+ in.rewind(_m);
+ } catch(EOFException _e) {
+ _s.dummy.clear();
+ in.rewind(_m);
+ }
+ }
+ _m = in.setMark();
+ try {
RecordHeader _optionCheck(&_s);
parseRecordHeader(in, _optionCheck);
_possiblyPresent = (_optionCheck.recVer == 0x0)&&(_optionCheck.recInstance ==
0x0)&&(_optionCheck.recType == 0xFAA);
Index: filters/libmso/generated/simpleParser.h
===================================================================
--- filters/libmso/generated/simpleParser.h (revision 1109940)
+++ filters/libmso/generated/simpleParser.h (working copy)
<at> <at> -140,6 +140,8 <at> <at>
void parseNotesListWithTextContainer(LEInputStream& in, NotesListWithTextContainer& _s);
class NotesPersistAtom;
void parseNotesPersistAtom(LEInputStream& in, NotesPersistAtom& _s);
+class Dummy;
+void parseDummy(LEInputStream& in, Dummy& _s);
class TextHeaderAtom;
void parseTextHeaderAtom(LEInputStream& in, TextHeaderAtom& _s);
class TextCharsAtom;
<at> <at> -1345,6 +1347,12 <at> <at>
quint32 reserved4;
NotesPersistAtom(void* /*dummy*/ = 0) {}
};
+class Dummy : public StreamOffset {
+public:
+ OfficeArtRecordHeader rh;
+ QByteArray dummyData;
+ Dummy(void* /*dummy*/ = 0) {}
+};
class TextHeaderAtom : public StreamOffset {
public:
RecordHeader rh;
<at> <at> -4247,6 +4255,7 <at> <at>
QSharedPointer<MasterTextPropAtom> master;
QList<TextBookmarkAtom> bookmark;
QSharedPointer<TextRulerAtom> textRuler;
+ QSharedPointer<Dummy> dummy;
QSharedPointer<TextSpecialInfoAtom> specialinfo;
QList<TextContainerInteractiveInfo> interactive;
QSharedPointer<TextSpecialInfoAtom> specialinfo2;
diff --git a/src/mso.xml b/src/mso.xml
index d14468f..948a23d 100644
--- a/src/mso.xml
+++ b/src/mso.xml
<at> <at> -1416,6 +1415,8 <at> <at>
<type name="bookmark" type="TextBookmarkAtom" array="true" />
<!-- this textRuler is not according to the specification -->
<type name="textRuler" type="TextRulerAtom" optional="true" />
+ <!-- this textRuler is not according to the specification -->
+ <type name="dummy" type="Dummy" optional="true" />
<type name="specialinfo" type="TextSpecialInfoAtom" optional="true" />
<type name="interactive" type="TextContainerInteractiveInfo"
array="true" />
<at> <at> -1423,6 +1424,15 <at> <at>
<type name="specialinfo2" type="TextSpecialInfoAtom" optional="true" />
</struct>
<!-- our own invention -->
+ <struct name="Dummy">
+ <type name="rh" type="OfficeArtRecordHeader">
+ <limitation name="recVer" value="3" />
+ <limitation name="recInstance" value="9" />
+ <limitation name="recType" value="0x0" />
+ </type>
+ <uint8 name="dummyData" count="rh.recLen"/>
+ </struct>
+ <!-- our own invention -->
<struct name="TextContainerMeta">
<choice name="meta">
<type type="SlideNumberMCAtom" />
<at> <at> -2357,8 +2367,8 <at> <at>
<type name="rh" type="RecordHeader">
<limitation name="recVer" value="0" />
<limitation name="recInstance" value="0" />
- <limitation name="recType" value="0x2EE6" />
- <limitation name="recLen" value="0" />
+ <limitation name="recType" value="0x2EE7" />
+ <limitation name="recLen" value="8" />
</type>
<uint32 name="linkedSlideIdRef" />
<int32 name="clinkedShapes" />
<at> <at> -2367,7 +2377,7 <at> <at>
<type name="rh" type="RecordHeader">
<limitation name="recVer" value="0" />
<limitation name="recInstance" value="0" />
- <limitation name="recType" value="0x2EE7" />
+ <limitation name="recType" value="0x2EE6" />
<limitation name="recLen" value="8" />
</type>
<uint32 name="shapeIdRef" />
_______________________________________________
koffice-devel mailing list
koffice-devel <at> kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel