File indexing completed on 2024-12-08 12:55:50
0001 /* This code was generated by msoscheme (http://gitorious.org/msoscheme) */ 0002 /* version aca4fd06f1ad330ecadf05b9e862d7c91338f051 */ 0003 #include "simpleParser.h" 0004 using namespace MSO; 0005 #include "leinputstream.h" 0006 void MSO::parseRecordHeader(LEInputStream& in, RecordHeader& _s) { 0007 _s.streamOffset = in.getPosition(); 0008 _s.recVer = in.readuint4(); 0009 _s.recInstance = in.readuint12(); 0010 _s.recType = in.readuint16(); 0011 _s.recLen = in.readuint32(); 0012 } 0013 void MSO::parseCurrentUserAtom(LEInputStream& in, CurrentUserAtom& _s) { 0014 _s.streamOffset = in.getPosition(); 0015 int _c; 0016 LEInputStream::Mark _m; 0017 parseRecordHeader(in, _s.rh); 0018 if (!(_s.rh.recVer == 0)) { 0019 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0020 } 0021 if (!(_s.rh.recInstance == 0)) { 0022 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0023 } 0024 if (!(_s.rh.recType == 0x0FF6)) { 0025 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FF6"); 0026 } 0027 _s.size = in.readuint32(); 0028 if (!(((quint32)_s.size) == 0x14)) { 0029 throw IncorrectValueException(in.getPosition(), "((quint32)_s.size) == 0x14"); 0030 } 0031 _s.headerToken = in.readuint32(); 0032 if (!(((quint32)_s.headerToken) == 0xE391C05F || ((quint32)_s.headerToken) == 0xF3D1C4DF)) { 0033 throw IncorrectValueException(in.getPosition(), "((quint32)_s.headerToken) == 0xE391C05F || ((quint32)_s.headerToken) == 0xF3D1C4DF"); 0034 } 0035 _s.offsetToCurrentEdit = in.readuint32(); 0036 _s.lenUserName = in.readuint16(); 0037 if (!(((quint16)_s.lenUserName)<=255)) { 0038 throw IncorrectValueException(in.getPosition(), "((quint16)_s.lenUserName)<=255"); 0039 } 0040 _s.docFileVersion = in.readuint16(); 0041 if (!(((quint16)_s.docFileVersion) == 0x03F4)) { 0042 throw IncorrectValueException(in.getPosition(), "((quint16)_s.docFileVersion) == 0x03F4"); 0043 } 0044 _s.majorVersion = in.readuint8(); 0045 if (!(((quint8)_s.majorVersion) == 0x03)) { 0046 throw IncorrectValueException(in.getPosition(), "((quint8)_s.majorVersion) == 0x03"); 0047 } 0048 _s.minorVersion = in.readuint8(); 0049 if (!(((quint8)_s.minorVersion) == 0x00)) { 0050 throw IncorrectValueException(in.getPosition(), "((quint8)_s.minorVersion) == 0x00"); 0051 } 0052 _s.unused = in.readuint16(); 0053 _c = _s.lenUserName; 0054 _s.ansiUserName.resize(_c); 0055 in.readBytes(_s.ansiUserName); 0056 _s.relVersion = in.readuint32(); 0057 if (!(((quint32)_s.relVersion) == 0x8 || ((quint32)_s.relVersion) == 0x9)) { 0058 throw IncorrectValueException(in.getPosition(), "((quint32)_s.relVersion) == 0x8 || ((quint32)_s.relVersion) == 0x9"); 0059 } 0060 _s._has_unicodeUserName = _s.rh.recLen>3*_s.lenUserName+0x18; 0061 if (_s._has_unicodeUserName) { 0062 _c = _s.lenUserName; 0063 _s.unicodeUserName.resize(_c); 0064 for (int _i=0; _i<_c; ++_i) { 0065 _s.unicodeUserName[_i] = in.readuint16(); 0066 } 0067 } 0068 _s._has_unknown = _s.rh.recLen-0x18-3*_s.lenUserName>0; 0069 if (_s._has_unknown) { 0070 _c = _s.rh.recLen-0x18-3*_s.lenUserName; 0071 _s.unknown.resize(_c); 0072 in.readBytes(_s.unknown); 0073 } 0074 } 0075 void MSO::parseTODOS(LEInputStream& in, TODOS& _s) { 0076 _s.streamOffset = in.getPosition(); 0077 LEInputStream::Mark _m; 0078 bool _atend; 0079 _atend = false; 0080 while (!_atend) { 0081 _m = in.setMark(); 0082 try { 0083 _s.anon.append(Byte(&_s)); 0084 parseByte(in, _s.anon.last()); 0085 } catch(IncorrectValueException _e) { 0086 _s.anon.removeLast(); 0087 _atend = true; 0088 in.rewind(_m); 0089 } catch(EOFException _e) { 0090 _s.anon.removeLast(); 0091 _atend = true; 0092 in.rewind(_m); 0093 } 0094 } 0095 } 0096 void MSO::parseByte(LEInputStream& in, Byte& _s) { 0097 _s.streamOffset = in.getPosition(); 0098 _s.b = in.readuint8(); 0099 } 0100 void MSO::parseZeroByte(LEInputStream& in, ZeroByte& _s) { 0101 _s.streamOffset = in.getPosition(); 0102 _s.b = in.readuint8(); 0103 if (!(((quint8)_s.b) == 0)) { 0104 throw IncorrectValueException(in.getPosition(), "((quint8)_s.b) == 0"); 0105 } 0106 } 0107 void MSO::parseCurrentUserStream(LEInputStream& in, CurrentUserStream& _s) { 0108 _s.streamOffset = in.getPosition(); 0109 LEInputStream::Mark _m; 0110 bool _atend; 0111 parseCurrentUserAtom(in, _s.anon1); 0112 _atend = false; 0113 while (!_atend) { 0114 _m = in.setMark(); 0115 try { 0116 _s.trailing.append(Byte(&_s)); 0117 parseByte(in, _s.trailing.last()); 0118 } catch(IncorrectValueException _e) { 0119 _s.trailing.removeLast(); 0120 _atend = true; 0121 in.rewind(_m); 0122 } catch(EOFException _e) { 0123 _s.trailing.removeLast(); 0124 _atend = true; 0125 in.rewind(_m); 0126 } 0127 } 0128 } 0129 void MSO::parseOfficeArtBStoreDelay(LEInputStream& in, OfficeArtBStoreDelay& _s) { 0130 _s.streamOffset = in.getPosition(); 0131 LEInputStream::Mark _m; 0132 bool _atend; 0133 _atend = false; 0134 while (!_atend) { 0135 _m = in.setMark(); 0136 try { 0137 _s.rgfb.append(OfficeArtBStoreContainerFileBlock(&_s)); 0138 parseOfficeArtBStoreContainerFileBlock(in, _s.rgfb.last()); 0139 } catch(IncorrectValueException _e) { 0140 _s.rgfb.removeLast(); 0141 _atend = true; 0142 in.rewind(_m); 0143 } catch(EOFException _e) { 0144 _s.rgfb.removeLast(); 0145 _atend = true; 0146 in.rewind(_m); 0147 } 0148 } 0149 } 0150 void MSO::parseOfficeArtRecordHeader(LEInputStream& in, OfficeArtRecordHeader& _s) { 0151 _s.streamOffset = in.getPosition(); 0152 _s.recVer = in.readuint4(); 0153 _s.recInstance = in.readuint12(); 0154 _s.recType = in.readuint16(); 0155 _s.recLen = in.readuint32(); 0156 } 0157 void MSO::parseOfficeArtBlipJPEG(LEInputStream& in, OfficeArtBlipJPEG& _s) { 0158 _s.streamOffset = in.getPosition(); 0159 int _c; 0160 LEInputStream::Mark _m; 0161 parseOfficeArtRecordHeader(in, _s.rh); 0162 if (!(_s.rh.recVer == 0)) { 0163 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0164 } 0165 if (!(_s.rh.recInstance == 0x46A || _s.rh.recInstance == 0x46B || _s.rh.recInstance == 0x6E2 || _s.rh.recInstance == 0x6E3)) { 0166 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x46A || _s.rh.recInstance == 0x46B || _s.rh.recInstance == 0x6E2 || _s.rh.recInstance == 0x6E3"); 0167 } 0168 if (!(_s.rh.recType == 0xF01D)) { 0169 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF01D"); 0170 } 0171 _c = 16; 0172 _s.rgbUid1.resize(_c); 0173 in.readBytes(_s.rgbUid1); 0174 _s._has_rgbUid2 = _s.rh.recInstance == 0x46B || _s.rh.recInstance == 0x6E3; 0175 if (_s._has_rgbUid2) { 0176 _c = 16; 0177 _s.rgbUid2.resize(_c); 0178 in.readBytes(_s.rgbUid2); 0179 } 0180 _s.tag = in.readuint8(); 0181 _c = _s.rh.recLen-((_s.rh.recInstance == 0x46A || _s.rh.recInstance == 0x6E2)?17:33); 0182 _s.BLIPFileData.resize(_c); 0183 in.readBytes(_s.BLIPFileData); 0184 } 0185 void MSO::parseOfficeArtBlipPNG(LEInputStream& in, OfficeArtBlipPNG& _s) { 0186 _s.streamOffset = in.getPosition(); 0187 int _c; 0188 LEInputStream::Mark _m; 0189 parseOfficeArtRecordHeader(in, _s.rh); 0190 if (!(_s.rh.recVer == 0)) { 0191 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0192 } 0193 if (!(_s.rh.recInstance == 0x6E0 || _s.rh.recInstance == 0x6E1)) { 0194 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x6E0 || _s.rh.recInstance == 0x6E1"); 0195 } 0196 if (!(_s.rh.recType == 0xF01E)) { 0197 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF01E"); 0198 } 0199 _c = 16; 0200 _s.rgbUid1.resize(_c); 0201 in.readBytes(_s.rgbUid1); 0202 _s._has_rgbUid2 = _s.rh.recInstance == 0x6E1; 0203 if (_s._has_rgbUid2) { 0204 _c = 16; 0205 _s.rgbUid2.resize(_c); 0206 in.readBytes(_s.rgbUid2); 0207 } 0208 _s.tag = in.readuint8(); 0209 _c = _s.rh.recLen-((_s.rh.recInstance==0x6E0)?17:33); 0210 _s.BLIPFileData.resize(_c); 0211 in.readBytes(_s.BLIPFileData); 0212 } 0213 void MSO::parseOfficeArtBlipDIB(LEInputStream& in, OfficeArtBlipDIB& _s) { 0214 _s.streamOffset = in.getPosition(); 0215 int _c; 0216 LEInputStream::Mark _m; 0217 parseOfficeArtRecordHeader(in, _s.rh); 0218 if (!(_s.rh.recVer == 0)) { 0219 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0220 } 0221 if (!(_s.rh.recInstance == 0x7A8 || _s.rh.recInstance == 0x7A9)) { 0222 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x7A8 || _s.rh.recInstance == 0x7A9"); 0223 } 0224 if (!(_s.rh.recType == 0xF01F)) { 0225 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF01F"); 0226 } 0227 _c = 16; 0228 _s.rgbUid1.resize(_c); 0229 in.readBytes(_s.rgbUid1); 0230 _s._has_rgbUid2 = _s.rh.recInstance == 0x7A9; 0231 if (_s._has_rgbUid2) { 0232 _c = 16; 0233 _s.rgbUid2.resize(_c); 0234 in.readBytes(_s.rgbUid2); 0235 } 0236 _s.tag = in.readuint8(); 0237 _c = _s.rh.recLen-((_s.rh.recInstance==0x7A8)?17:33); 0238 _s.BLIPFileData.resize(_c); 0239 in.readBytes(_s.BLIPFileData); 0240 } 0241 void MSO::parseOfficeArtBlipTIFF(LEInputStream& in, OfficeArtBlipTIFF& _s) { 0242 _s.streamOffset = in.getPosition(); 0243 int _c; 0244 LEInputStream::Mark _m; 0245 parseOfficeArtRecordHeader(in, _s.rh); 0246 if (!(_s.rh.recVer == 0)) { 0247 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0248 } 0249 if (!(_s.rh.recInstance == 0x6E4 || _s.rh.recInstance == 0x6E5)) { 0250 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x6E4 || _s.rh.recInstance == 0x6E5"); 0251 } 0252 if (!(_s.rh.recType == 0xF020)) { 0253 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF020"); 0254 } 0255 _c = 16; 0256 _s.rgbUid1.resize(_c); 0257 in.readBytes(_s.rgbUid1); 0258 _s._has_rgbUid2 = _s.rh.recInstance == 0x6E5; 0259 if (_s._has_rgbUid2) { 0260 _c = 16; 0261 _s.rgbUid2.resize(_c); 0262 in.readBytes(_s.rgbUid2); 0263 } 0264 _s.tag = in.readuint8(); 0265 _c = _s.rh.recLen-((_s.rh.recInstance==0x6E4)?17:33); 0266 _s.BLIPFileData.resize(_c); 0267 in.readBytes(_s.BLIPFileData); 0268 } 0269 void MSO::parseRECT(LEInputStream& in, RECT& _s) { 0270 _s.streamOffset = in.getPosition(); 0271 _s.left = in.readint32(); 0272 _s.top = in.readint32(); 0273 _s.right = in.readint32(); 0274 _s.bottom = in.readint32(); 0275 } 0276 void MSO::parsePOINT(LEInputStream& in, POINT& _s) { 0277 _s.streamOffset = in.getPosition(); 0278 _s.x = in.readint32(); 0279 _s.y = in.readint32(); 0280 } 0281 void MSO::parsePowerPointStructs(LEInputStream& in, PowerPointStructs& _s) { 0282 _s.streamOffset = in.getPosition(); 0283 LEInputStream::Mark _m; 0284 bool _atend; 0285 _atend = false; 0286 while (!_atend) { 0287 _m = in.setMark(); 0288 try { 0289 _s.anon.append(PowerPointStruct(&_s)); 0290 parsePowerPointStruct(in, _s.anon.last()); 0291 } catch(IncorrectValueException _e) { 0292 _s.anon.removeLast(); 0293 _atend = true; 0294 in.rewind(_m); 0295 } catch(EOFException _e) { 0296 _s.anon.removeLast(); 0297 _atend = true; 0298 in.rewind(_m); 0299 } 0300 } 0301 } 0302 void MSO::parseSoundCollectionAtom(LEInputStream& in, SoundCollectionAtom& _s) { 0303 _s.streamOffset = in.getPosition(); 0304 parseRecordHeader(in, _s.rh); 0305 if (!(_s.rh.recVer == 0)) { 0306 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0307 } 0308 if (!(_s.rh.recInstance == 0)) { 0309 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0310 } 0311 if (!(_s.rh.recType == 0x7e5)) { 0312 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x7e5"); 0313 } 0314 if (!(_s.rh.recLen == 4)) { 0315 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 0316 } 0317 _s.soundIdSeed = in.readuint32(); 0318 } 0319 void MSO::parseHeadersFootersAtom(LEInputStream& in, HeadersFootersAtom& _s) { 0320 _s.streamOffset = in.getPosition(); 0321 parseRecordHeader(in, _s.rh); 0322 if (!(_s.rh.recVer == 0)) { 0323 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0324 } 0325 if (!(_s.rh.recInstance == 0)) { 0326 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0327 } 0328 if (!(_s.rh.recType == 0xFDA)) { 0329 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFDA"); 0330 } 0331 if (!(_s.rh.recLen == 4)) { 0332 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 0333 } 0334 _s.formatId = in.readint16(); 0335 if (!(((qint16)_s.formatId)>=0)) { 0336 throw IncorrectValueException(in.getPosition(), "((qint16)_s.formatId)>=0"); 0337 } 0338 if (!(((qint16)_s.formatId)<=13)) { 0339 throw IncorrectValueException(in.getPosition(), "((qint16)_s.formatId)<=13"); 0340 } 0341 _s.fHasDate = in.readbit(); 0342 _s.fHasTodayDate = in.readbit(); 0343 _s.fHasUserDate = in.readbit(); 0344 _s.fHasSlideNumber = in.readbit(); 0345 _s.fHasHeader = in.readbit(); 0346 _s.fHasFooter = in.readbit(); 0347 _s.reserved1 = in.readuint2(); 0348 _s.reserved2 = in.readuint8(); 0349 } 0350 void MSO::parseUserDateAtom(LEInputStream& in, UserDateAtom& _s) { 0351 _s.streamOffset = in.getPosition(); 0352 int _c; 0353 LEInputStream::Mark _m; 0354 parseRecordHeader(in, _s.rh); 0355 if (!(_s.rh.recVer == 0)) { 0356 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0357 } 0358 if (!(_s.rh.recInstance == 0)) { 0359 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0360 } 0361 if (!(_s.rh.recType == 0xFBA)) { 0362 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 0363 } 0364 if (!(_s.rh.recLen%2==0)) { 0365 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 0366 } 0367 if (!(_s.rh.recLen<=510)) { 0368 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen<=510"); 0369 } 0370 _c = _s.rh.recLen/2; 0371 _s.userDate.resize(_c); 0372 for (int _i=0; _i<_c; ++_i) { 0373 _s.userDate[_i] = in.readuint16(); 0374 } 0375 } 0376 void MSO::parseHeaderAtom(LEInputStream& in, HeaderAtom& _s) { 0377 _s.streamOffset = in.getPosition(); 0378 int _c; 0379 LEInputStream::Mark _m; 0380 parseRecordHeader(in, _s.rh); 0381 if (!(_s.rh.recVer == 0)) { 0382 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0383 } 0384 if (!(_s.rh.recInstance == 1)) { 0385 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 1"); 0386 } 0387 if (!(_s.rh.recType == 0xFBA)) { 0388 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 0389 } 0390 if (!(_s.rh.recLen%2==0)) { 0391 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 0392 } 0393 _c = _s.rh.recLen/2; 0394 _s.header.resize(_c); 0395 for (int _i=0; _i<_c; ++_i) { 0396 _s.header[_i] = in.readuint16(); 0397 } 0398 } 0399 void MSO::parseFooterAtom(LEInputStream& in, FooterAtom& _s) { 0400 _s.streamOffset = in.getPosition(); 0401 int _c; 0402 LEInputStream::Mark _m; 0403 parseRecordHeader(in, _s.rh); 0404 if (!(_s.rh.recVer == 0)) { 0405 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0406 } 0407 if (!(_s.rh.recInstance == 2)) { 0408 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 2"); 0409 } 0410 if (!(_s.rh.recType == 0xFBA)) { 0411 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 0412 } 0413 if (!(_s.rh.recLen%2==0)) { 0414 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 0415 } 0416 _c = _s.rh.recLen/2; 0417 _s.footer.resize(_c); 0418 for (int _i=0; _i<_c; ++_i) { 0419 _s.footer[_i] = in.readuint16(); 0420 } 0421 } 0422 void MSO::parsePerSlideHeadersFootersContainer(LEInputStream& in, PerSlideHeadersFootersContainer& _s) { 0423 _s.streamOffset = in.getPosition(); 0424 LEInputStream::Mark _m; 0425 bool _possiblyPresent; 0426 parseRecordHeader(in, _s.rh); 0427 if (!(_s.rh.recVer == 0xF)) { 0428 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 0429 } 0430 if (!(_s.rh.recInstance == 0)) { 0431 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0432 } 0433 if (!(_s.rh.recType == 0xFD9)) { 0434 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFD9"); 0435 } 0436 parseHeadersFootersAtom(in, _s.hfAtom); 0437 _m = in.setMark(); 0438 try { 0439 RecordHeader _optionCheck(&_s); 0440 parseRecordHeader(in, _optionCheck); 0441 _possiblyPresent = (_optionCheck.recVer == 0)&&(_optionCheck.recInstance == 0)&&(_optionCheck.recType == 0xFBA)&&(_optionCheck.recLen%2==0)&&(_optionCheck.recLen<=510); 0442 } catch(EOFException _e) { 0443 _possiblyPresent = false; 0444 } 0445 in.rewind(_m); 0446 _m = in.setMark(); 0447 if (_possiblyPresent) { 0448 try { 0449 _s.userDateAtom = QSharedPointer<UserDateAtom>(new UserDateAtom(&_s)); 0450 parseUserDateAtom(in, *_s.userDateAtom.data()); 0451 } catch(IncorrectValueException _e) { 0452 _s.userDateAtom.clear(); 0453 in.rewind(_m); 0454 } catch(EOFException _e) { 0455 _s.userDateAtom.clear(); 0456 in.rewind(_m); 0457 } 0458 } 0459 _m = in.setMark(); 0460 try { 0461 RecordHeader _optionCheck(&_s); 0462 parseRecordHeader(in, _optionCheck); 0463 _possiblyPresent = (_optionCheck.recVer == 0)&&(_optionCheck.recInstance == 1)&&(_optionCheck.recType == 0xFBA)&&(_optionCheck.recLen%2==0); 0464 } catch(EOFException _e) { 0465 _possiblyPresent = false; 0466 } 0467 in.rewind(_m); 0468 _m = in.setMark(); 0469 if (_possiblyPresent) { 0470 try { 0471 _s.headerAtom = QSharedPointer<HeaderAtom>(new HeaderAtom(&_s)); 0472 parseHeaderAtom(in, *_s.headerAtom.data()); 0473 } catch(IncorrectValueException _e) { 0474 _s.headerAtom.clear(); 0475 in.rewind(_m); 0476 } catch(EOFException _e) { 0477 _s.headerAtom.clear(); 0478 in.rewind(_m); 0479 } 0480 } 0481 _m = in.setMark(); 0482 try { 0483 RecordHeader _optionCheck(&_s); 0484 parseRecordHeader(in, _optionCheck); 0485 _possiblyPresent = (_optionCheck.recVer == 0)&&(_optionCheck.recInstance == 2)&&(_optionCheck.recType == 0xFBA)&&(_optionCheck.recLen%2==0); 0486 } catch(EOFException _e) { 0487 _possiblyPresent = false; 0488 } 0489 in.rewind(_m); 0490 _m = in.setMark(); 0491 if (_possiblyPresent) { 0492 try { 0493 _s.footerAtom = QSharedPointer<FooterAtom>(new FooterAtom(&_s)); 0494 parseFooterAtom(in, *_s.footerAtom.data()); 0495 } catch(IncorrectValueException _e) { 0496 _s.footerAtom.clear(); 0497 in.rewind(_m); 0498 } catch(EOFException _e) { 0499 _s.footerAtom.clear(); 0500 in.rewind(_m); 0501 } 0502 } 0503 _m = in.setMark(); 0504 try { 0505 RecordHeader _optionCheck(&_s); 0506 parseRecordHeader(in, _optionCheck); 0507 _possiblyPresent = (_optionCheck.recVer == 0)&&(_optionCheck.recInstance == 0)&&(_optionCheck.recType == 0xFBA)&&(_optionCheck.recLen%2==0)&&(_optionCheck.recLen<=510); 0508 } catch(EOFException _e) { 0509 _possiblyPresent = false; 0510 } 0511 in.rewind(_m); 0512 _m = in.setMark(); 0513 if (_possiblyPresent) { 0514 try { 0515 _s.userDateAtom2 = QSharedPointer<UserDateAtom>(new UserDateAtom(&_s)); 0516 parseUserDateAtom(in, *_s.userDateAtom2.data()); 0517 } catch(IncorrectValueException _e) { 0518 _s.userDateAtom2.clear(); 0519 in.rewind(_m); 0520 } catch(EOFException _e) { 0521 _s.userDateAtom2.clear(); 0522 in.rewind(_m); 0523 } 0524 } 0525 } 0526 void MSO::parseEndDocumentAtom(LEInputStream& in, EndDocumentAtom& _s) { 0527 _s.streamOffset = in.getPosition(); 0528 parseRecordHeader(in, _s.rh); 0529 if (!(_s.rh.recVer == 0)) { 0530 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0531 } 0532 if (!(_s.rh.recInstance == 0)) { 0533 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0534 } 0535 if (!(_s.rh.recType == 0x3EA)) { 0536 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x3EA"); 0537 } 0538 if (!(_s.rh.recLen == 0)) { 0539 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0"); 0540 } 0541 } 0542 void MSO::parseDocInfoListContainer(LEInputStream& in, DocInfoListContainer& _s) { 0543 _s.streamOffset = in.getPosition(); 0544 LEInputStream::Mark _m; 0545 bool _atend; 0546 parseRecordHeader(in, _s.rh); 0547 if (!(_s.rh.recVer == 0xF)) { 0548 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 0549 } 0550 if (!(_s.rh.recInstance == 0)) { 0551 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0552 } 0553 if (!(_s.rh.recType == 0x7D0)) { 0554 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x7D0"); 0555 } 0556 _atend = false; 0557 while (!_atend) { 0558 _m = in.setMark(); 0559 try { 0560 _s.rgChildRec.append(DocInfoListSubContainerOrAtom(&_s)); 0561 parseDocInfoListSubContainerOrAtom(in, _s.rgChildRec.last()); 0562 } catch(IncorrectValueException _e) { 0563 _s.rgChildRec.removeLast(); 0564 _atend = true; 0565 in.rewind(_m); 0566 } catch(EOFException _e) { 0567 _s.rgChildRec.removeLast(); 0568 _atend = true; 0569 in.rewind(_m); 0570 } 0571 } 0572 } 0573 void MSO::parseSlideViewInfoAtom(LEInputStream& in, SlideViewInfoAtom& _s) { 0574 _s.streamOffset = in.getPosition(); 0575 parseRecordHeader(in, _s.rh); 0576 if (!(_s.rh.recVer == 0)) { 0577 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0578 } 0579 if (!(_s.rh.recInstance == 0)) { 0580 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0581 } 0582 if (!(_s.rh.recType == 0x3FE)) { 0583 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x3FE"); 0584 } 0585 if (!(_s.rh.recLen == 3)) { 0586 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 3"); 0587 } 0588 _s.unused1 = in.readuint8(); 0589 _s.fSnapToGrid = in.readuint8(); 0590 _s.fSnapToShape = in.readuint8(); 0591 } 0592 void MSO::parseGuideAtom(LEInputStream& in, GuideAtom& _s) { 0593 _s.streamOffset = in.getPosition(); 0594 parseRecordHeader(in, _s.rh); 0595 if (!(_s.rh.recVer == 0)) { 0596 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0597 } 0598 if (!(_s.rh.recInstance == 7)) { 0599 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 7"); 0600 } 0601 if (!(_s.rh.recType == 0x3FB)) { 0602 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x3FB"); 0603 } 0604 if (!(_s.rh.recLen == 8)) { 0605 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 0606 } 0607 _s.type = in.readuint32(); 0608 if (!(((quint32)_s.type) == 0 || ((quint32)_s.type) == 1)) { 0609 throw IncorrectValueException(in.getPosition(), "((quint32)_s.type) == 0 || ((quint32)_s.type) == 1"); 0610 } 0611 _s.pos = in.readint32(); 0612 if (!(((qint32)_s.pos)>=-15840)) { 0613 throw IncorrectValueException(in.getPosition(), "((qint32)_s.pos)>=-15840"); 0614 } 0615 if (!(((qint32)_s.pos)<=32255)) { 0616 throw IncorrectValueException(in.getPosition(), "((qint32)_s.pos)<=32255"); 0617 } 0618 } 0619 void MSO::parseDocProgTagsContainer(LEInputStream& in, DocProgTagsContainer& _s) { 0620 _s.streamOffset = in.getPosition(); 0621 LEInputStream::Mark _m; 0622 bool _atend; 0623 parseRecordHeader(in, _s.rh); 0624 if (!(_s.rh.recVer == 0xF)) { 0625 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 0626 } 0627 if (!(_s.rh.recInstance == 0 || _s.rh.recInstance == 1)) { 0628 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0 || _s.rh.recInstance == 1"); 0629 } 0630 if (!(_s.rh.recType == 0x1388)) { 0631 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1388"); 0632 } 0633 qint64 _startPos = in.getPosition(); 0634 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 0635 _atend = in.getPosition() - _startPos >= _totalSize; 0636 while (!_atend) { 0637 _s.rgChildRec.append(DocProgTagsSubContainerOrAtom(&_s)); 0638 parseDocProgTagsSubContainerOrAtom(in, _s.rgChildRec.last()); 0639 _atend = in.getPosition() - _startPos >= _totalSize; 0640 } 0641 } 0642 void MSO::parseTextAutoNumberScheme(LEInputStream& in, TextAutoNumberScheme& _s) { 0643 _s.streamOffset = in.getPosition(); 0644 _s.scheme = in.readuint16(); 0645 if (!(((quint16)_s.scheme)<=40)) { 0646 throw IncorrectValueException(in.getPosition(), "((quint16)_s.scheme)<=40"); 0647 } 0648 _s.startNum = in.readuint16(); 0649 if (!(((quint16)_s.startNum)>=1)) { 0650 throw IncorrectValueException(in.getPosition(), "((quint16)_s.startNum)>=1"); 0651 } 0652 } 0653 void MSO::parseBlipCollection9Container(LEInputStream& in, BlipCollection9Container& _s) { 0654 _s.streamOffset = in.getPosition(); 0655 LEInputStream::Mark _m; 0656 bool _atend; 0657 parseRecordHeader(in, _s.rh); 0658 if (!(_s.rh.recVer == 0xF)) { 0659 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 0660 } 0661 if (!(_s.rh.recInstance == 0x0)) { 0662 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 0663 } 0664 if (!(_s.rh.recType == 0x07F8)) { 0665 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x07F8"); 0666 } 0667 qint64 _startPos = in.getPosition(); 0668 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 0669 _atend = in.getPosition() - _startPos >= _totalSize; 0670 while (!_atend) { 0671 _s.rgBlipEntityAtom.append(BlipEntityAtom(&_s)); 0672 parseBlipEntityAtom(in, _s.rgBlipEntityAtom.last()); 0673 _atend = in.getPosition() - _startPos >= _totalSize; 0674 } 0675 } 0676 void MSO::parseKinsoku9Atom(LEInputStream& in, Kinsoku9Atom& _s) { 0677 _s.streamOffset = in.getPosition(); 0678 parseRecordHeader(in, _s.rh); 0679 if (!(_s.rh.recVer == 0x0)) { 0680 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 0681 } 0682 if (!(_s.rh.recInstance == 0x3)) { 0683 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x3"); 0684 } 0685 if (!(_s.rh.recType == 0x0FD2)) { 0686 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FD2"); 0687 } 0688 if (!(_s.rh.recLen == 0x0004)) { 0689 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x0004"); 0690 } 0691 _s.korLevel = in.readuint2(); 0692 if (!(((quint8)_s.korLevel) == 0x0 || ((quint8)_s.korLevel) == 0x2)) { 0693 throw IncorrectValueException(in.getPosition(), "((quint8)_s.korLevel) == 0x0 || ((quint8)_s.korLevel) == 0x2"); 0694 } 0695 _s.scLevel = in.readuint2(); 0696 if (!(((quint8)_s.scLevel) == 0x0 || ((quint8)_s.scLevel) == 0x2)) { 0697 throw IncorrectValueException(in.getPosition(), "((quint8)_s.scLevel) == 0x0 || ((quint8)_s.scLevel) == 0x2"); 0698 } 0699 _s.tcLevel = in.readuint2(); 0700 if (!(((quint8)_s.tcLevel) == 0x0 || ((quint8)_s.tcLevel) == 0x2)) { 0701 throw IncorrectValueException(in.getPosition(), "((quint8)_s.tcLevel) == 0x0 || ((quint8)_s.tcLevel) == 0x2"); 0702 } 0703 _s.jpnLevel = in.readuint2(); 0704 if (!(((quint8)_s.jpnLevel) == 0x0 || ((quint8)_s.jpnLevel) == 0x1 || ((quint8)_s.jpnLevel) == 0x2)) { 0705 throw IncorrectValueException(in.getPosition(), "((quint8)_s.jpnLevel) == 0x0 || ((quint8)_s.jpnLevel) == 0x1 || ((quint8)_s.jpnLevel) == 0x2"); 0706 } 0707 _s.reserveda = in.readuint4(); 0708 if (!(((quint8)_s.reserveda) == 0)) { 0709 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserveda) == 0"); 0710 } 0711 _s.reservedb = in.readuint20(); 0712 if (!(((quint32)_s.reservedb) == 0)) { 0713 throw IncorrectValueException(in.getPosition(), "((quint32)_s.reservedb) == 0"); 0714 } 0715 } 0716 void MSO::parseExHyperlink9Container(LEInputStream& in, ExHyperlink9Container& _s) { 0717 _s.streamOffset = in.getPosition(); 0718 int _c; 0719 LEInputStream::Mark _m; 0720 parseRecordHeader(in, _s.rh); 0721 if (!(_s.rh.recVer == 0xF)) { 0722 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 0723 } 0724 if (!(_s.rh.recInstance == 0)) { 0725 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0726 } 0727 if (!(_s.rh.recType == 0xFE4)) { 0728 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFE4"); 0729 } 0730 _c = _s.rh.recLen; 0731 _s.todo.resize(_c); 0732 in.readBytes(_s.todo); 0733 } 0734 void MSO::parsePresAdvisorFlags9Atom(LEInputStream& in, PresAdvisorFlags9Atom& _s) { 0735 _s.streamOffset = in.getPosition(); 0736 parseRecordHeader(in, _s.rh); 0737 if (!(_s.rh.recVer == 0x0)) { 0738 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 0739 } 0740 if (!(_s.rh.recInstance == 0)) { 0741 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0742 } 0743 if (!(_s.rh.recType == 0x177A)) { 0744 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x177A"); 0745 } 0746 if (!(_s.rh.recLen == 0x4)) { 0747 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x4"); 0748 } 0749 _s.fDisableCaseStyleTitleRule = in.readbit(); 0750 _s.fDisableCaseStyleBodyRule = in.readbit(); 0751 _s.fDisableEndPunctuationTitleRule = in.readbit(); 0752 _s.fDisableEndPunctuationBodyRule = in.readbit(); 0753 _s.fDisableTooManyBulletsRule = in.readbit(); 0754 _s.fDisableFontSizeTitleRule = in.readbit(); 0755 _s.fDisableFontSizeBodyRule = in.readbit(); 0756 _s.fDisableNumberOfLinesTitleRule = in.readbit(); 0757 _s.fDisableNumberOfLinesBodyRule = in.readbit(); 0758 _s.fDisableTooManyFontsRule = in.readbit(); 0759 _s.fDisablePrintTip = in.readbit(); 0760 _s.reserveda = in.readuint5(); 0761 if (!(((quint8)_s.reserveda) == 0)) { 0762 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserveda) == 0"); 0763 } 0764 _s.reservedb = in.readuint16(); 0765 if (!(((quint16)_s.reservedb) == 0)) { 0766 throw IncorrectValueException(in.getPosition(), "((quint16)_s.reservedb) == 0"); 0767 } 0768 } 0769 void MSO::parseEnvelopeData9Atom(LEInputStream& in, EnvelopeData9Atom& _s) { 0770 _s.streamOffset = in.getPosition(); 0771 int _c; 0772 LEInputStream::Mark _m; 0773 parseRecordHeader(in, _s.rh); 0774 if (!(_s.rh.recVer == 0x0)) { 0775 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 0776 } 0777 if (!(_s.rh.recInstance == 0)) { 0778 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0779 } 0780 if (!(_s.rh.recType == 0x1785)) { 0781 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1785"); 0782 } 0783 _c = _s.rh.recLen; 0784 _s.todo.resize(_c); 0785 in.readBytes(_s.todo); 0786 } 0787 void MSO::parseEnvelopeFlags9Atom(LEInputStream& in, EnvelopeFlags9Atom& _s) { 0788 _s.streamOffset = in.getPosition(); 0789 parseRecordHeader(in, _s.rh); 0790 if (!(_s.rh.recVer == 0x0)) { 0791 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 0792 } 0793 if (!(_s.rh.recInstance == 0)) { 0794 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0795 } 0796 if (!(_s.rh.recType == 0x1784)) { 0797 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1784"); 0798 } 0799 if (!(_s.rh.recLen == 4)) { 0800 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 0801 } 0802 _s.fHasEnvelope = in.readbit(); 0803 _s.fEnvelopeVisible = in.readbit(); 0804 _s.reserved1 = in.readuint2(); 0805 if (!(((quint8)_s.reserved1) == 0)) { 0806 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved1) == 0"); 0807 } 0808 _s.fEnvelopeDirty = in.readbit(); 0809 _s.reserved2a = in.readuint3(); 0810 if (!(((quint8)_s.reserved2a) == 0)) { 0811 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved2a) == 0"); 0812 } 0813 _s.reserved2b = in.readuint8(); 0814 if (!(((quint8)_s.reserved2b) == 0)) { 0815 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved2b) == 0"); 0816 } 0817 _s.reserved2c = in.readuint16(); 0818 if (!(((quint16)_s.reserved2c) == 0)) { 0819 throw IncorrectValueException(in.getPosition(), "((quint16)_s.reserved2c) == 0"); 0820 } 0821 } 0822 void MSO::parseHTMLDocInfo9Atom(LEInputStream& in, HTMLDocInfo9Atom& _s) { 0823 _s.streamOffset = in.getPosition(); 0824 parseRecordHeader(in, _s.rh); 0825 if (!(_s.rh.recVer == 0x0)) { 0826 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 0827 } 0828 if (!(_s.rh.recInstance == 0)) { 0829 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0830 } 0831 if (!(_s.rh.recType == 0x177B)) { 0832 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x177B"); 0833 } 0834 if (!(_s.rh.recLen == 0x10)) { 0835 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x10"); 0836 } 0837 _s.unused1 = in.readuint32(); 0838 _s.encoding = in.readuint32(); 0839 _s.frameColorType = in.readuint16(); 0840 if (!(((quint16)_s.frameColorType) == 0 || ((quint16)_s.frameColorType) == 1 || ((quint16)_s.frameColorType) == 2 || ((quint16)_s.frameColorType) == 3 || ((quint16)_s.frameColorType) == 4 || ((quint16)_s.frameColorType) == 5)) { 0841 throw IncorrectValueException(in.getPosition(), "((quint16)_s.frameColorType) == 0 || ((quint16)_s.frameColorType) == 1 || ((quint16)_s.frameColorType) == 2 || ((quint16)_s.frameColorType) == 3 || ((quint16)_s.frameColorType) == 4 || ((quint16)_s.frameColorType) == 5"); 0842 } 0843 _s.screenSize = in.readuint8(); 0844 _s.unused2 = in.readuint8(); 0845 _s.outputType = in.readuint8(); 0846 _s.fShowFrame = in.readbit(); 0847 _s.fResizeGraphics = in.readbit(); 0848 _s.fOrganizeInFolder = in.readbit(); 0849 _s.fUseLongFileNames = in.readbit(); 0850 _s.fRelyOnVML = in.readbit(); 0851 _s.fAllowPNG = in.readbit(); 0852 _s.fShowSlideAnimation = in.readbit(); 0853 _s.reserved1 = in.readbit(); 0854 if (!(((bool)_s.reserved1) == false)) { 0855 throw IncorrectValueException(in.getPosition(), "((bool)_s.reserved1) == false"); 0856 } 0857 _s.unused3 = in.readuint16(); 0858 } 0859 void MSO::parseHTMLPublishInfo9Container(LEInputStream& in, HTMLPublishInfo9Container& _s) { 0860 _s.streamOffset = in.getPosition(); 0861 int _c; 0862 LEInputStream::Mark _m; 0863 parseRecordHeader(in, _s.rh); 0864 if (!(_s.rh.recVer == 0xF)) { 0865 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 0866 } 0867 if (!(_s.rh.recInstance == 0x0)) { 0868 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 0869 } 0870 if (!(_s.rh.recType == 0x177D)) { 0871 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x177D"); 0872 } 0873 _c = _s.rh.recLen; 0874 _s.todo.resize(_c); 0875 in.readBytes(_s.todo); 0876 } 0877 void MSO::parseBroadcastDocInfo9Container(LEInputStream& in, BroadcastDocInfo9Container& _s) { 0878 _s.streamOffset = in.getPosition(); 0879 int _c; 0880 LEInputStream::Mark _m; 0881 parseRecordHeader(in, _s.rh); 0882 if (!(_s.rh.recVer == 0xF)) { 0883 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 0884 } 0885 if (!(_s.rh.recInstance == 0)) { 0886 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0887 } 0888 if (!(_s.rh.recType == 0x177E)) { 0889 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x177E"); 0890 } 0891 _c = _s.rh.recLen; 0892 _s.todo.resize(_c); 0893 in.readBytes(_s.todo); 0894 } 0895 void MSO::parseOutlineTextProps9Container(LEInputStream& in, OutlineTextProps9Container& _s) { 0896 _s.streamOffset = in.getPosition(); 0897 LEInputStream::Mark _m; 0898 bool _atend; 0899 parseRecordHeader(in, _s.rh); 0900 if (!(_s.rh.recVer == 0xF)) { 0901 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 0902 } 0903 if (!(_s.rh.recInstance == 0)) { 0904 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0905 } 0906 if (!(_s.rh.recType == 0x0FAE)) { 0907 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FAE"); 0908 } 0909 _atend = false; 0910 while (!_atend) { 0911 _m = in.setMark(); 0912 try { 0913 _s.rgOutlineTextProps9Entry.append(OutlineTextProps9Entry(&_s)); 0914 parseOutlineTextProps9Entry(in, _s.rgOutlineTextProps9Entry.last()); 0915 } catch(IncorrectValueException _e) { 0916 _s.rgOutlineTextProps9Entry.removeLast(); 0917 _atend = true; 0918 in.rewind(_m); 0919 } catch(EOFException _e) { 0920 _s.rgOutlineTextProps9Entry.removeLast(); 0921 _atend = true; 0922 in.rewind(_m); 0923 } 0924 } 0925 } 0926 void MSO::parseOutlineTextPropsHeaderExAtom(LEInputStream& in, OutlineTextPropsHeaderExAtom& _s) { 0927 _s.streamOffset = in.getPosition(); 0928 parseRecordHeader(in, _s.rh); 0929 if (!(_s.rh.recVer == 0)) { 0930 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0931 } 0932 if (!(_s.rh.recInstance<=5)) { 0933 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance<=5"); 0934 } 0935 if (!(_s.rh.recType == 0xFAF)) { 0936 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFAF"); 0937 } 0938 _s.slideIdRef = in.readuint32(); 0939 _s.txType = in.readuint32(); 0940 } 0941 void MSO::parseStyleTextProp9Atom(LEInputStream& in, StyleTextProp9Atom& _s) { 0942 _s.streamOffset = in.getPosition(); 0943 LEInputStream::Mark _m; 0944 bool _atend; 0945 parseRecordHeader(in, _s.rh); 0946 if (!(_s.rh.recVer == 0)) { 0947 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 0948 } 0949 if (!(_s.rh.recInstance == 0)) { 0950 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 0951 } 0952 if (!(_s.rh.recType == 0xFAC)) { 0953 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFAC"); 0954 } 0955 qint64 _startPos = in.getPosition(); 0956 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 0957 _atend = in.getPosition() - _startPos >= _totalSize; 0958 while (!_atend) { 0959 _s.rgStyleTextProp9.append(StyleTextProp9(&_s)); 0960 parseStyleTextProp9(in, _s.rgStyleTextProp9.last()); 0961 _atend = in.getPosition() - _startPos >= _totalSize; 0962 } 0963 } 0964 void MSO::parseFontCollection10Container(LEInputStream& in, FontCollection10Container& _s) { 0965 _s.streamOffset = in.getPosition(); 0966 LEInputStream::Mark _m; 0967 bool _atend; 0968 parseRecordHeader(in, _s.rh); 0969 if (!(_s.rh.recVer == 0xF)) { 0970 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 0971 } 0972 if (!(_s.rh.recInstance == 0x0)) { 0973 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 0974 } 0975 if (!(_s.rh.recType == 0x07D6)) { 0976 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x07D6"); 0977 } 0978 qint64 _startPos = in.getPosition(); 0979 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 0980 _atend = in.getPosition() - _startPos >= _totalSize; 0981 while (!_atend) { 0982 _s.rgFontCollectionEntry.append(FontCollectionEntry(&_s)); 0983 parseFontCollectionEntry(in, _s.rgFontCollectionEntry.last()); 0984 _atend = in.getPosition() - _startPos >= _totalSize; 0985 } 0986 } 0987 void MSO::parseGridSpacing10Atom(LEInputStream& in, GridSpacing10Atom& _s) { 0988 _s.streamOffset = in.getPosition(); 0989 parseRecordHeader(in, _s.rh); 0990 if (!(_s.rh.recVer == 0x0)) { 0991 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 0992 } 0993 if (!(_s.rh.recInstance == 0x0)) { 0994 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 0995 } 0996 if (!(_s.rh.recType == 0x040D)) { 0997 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x040D"); 0998 } 0999 if (!(_s.rh.recLen == 0x08)) { 1000 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x08"); 1001 } 1002 _s.x = in.readuint32(); 1003 if (!(((quint32)_s.x)>=23224)) { 1004 throw IncorrectValueException(in.getPosition(), "((quint32)_s.x)>=23224"); 1005 } 1006 if (!(((quint32)_s.x)<=1179648)) { 1007 throw IncorrectValueException(in.getPosition(), "((quint32)_s.x)<=1179648"); 1008 } 1009 _s.y = in.readuint32(); 1010 if (!(((quint32)_s.y)>=23224)) { 1011 throw IncorrectValueException(in.getPosition(), "((quint32)_s.y)>=23224"); 1012 } 1013 if (!(((quint32)_s.y)<=1179648)) { 1014 throw IncorrectValueException(in.getPosition(), "((quint32)_s.y)<=1179648"); 1015 } 1016 } 1017 void MSO::parseAuthorNameAtom(LEInputStream& in, AuthorNameAtom& _s) { 1018 _s.streamOffset = in.getPosition(); 1019 int _c; 1020 LEInputStream::Mark _m; 1021 parseRecordHeader(in, _s.rh); 1022 if (!(_s.rh.recVer == 0x0)) { 1023 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1024 } 1025 if (!(_s.rh.recInstance == 0x0)) { 1026 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1027 } 1028 if (!(_s.rh.recType == 0x0FBA)) { 1029 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 1030 } 1031 if (!(_s.rh.recLen<=104)) { 1032 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen<=104"); 1033 } 1034 if (!(_s.rh.recLen%2==0)) { 1035 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 1036 } 1037 _c = _s.rh.recLen; 1038 _s.authorName.resize(_c); 1039 in.readBytes(_s.authorName); 1040 } 1041 void MSO::parseCommentIndex10Atom(LEInputStream& in, CommentIndex10Atom& _s) { 1042 _s.streamOffset = in.getPosition(); 1043 parseRecordHeader(in, _s.rh); 1044 if (!(_s.rh.recVer == 0x0)) { 1045 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1046 } 1047 if (!(_s.rh.recInstance == 0x0)) { 1048 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1049 } 1050 if (!(_s.rh.recType == 0x2EE5)) { 1051 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2EE5"); 1052 } 1053 if (!(_s.rh.recLen == 0x08)) { 1054 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x08"); 1055 } 1056 _s.colorIndex = in.readint32(); 1057 if (!(((qint32)_s.colorIndex)>=0)) { 1058 throw IncorrectValueException(in.getPosition(), "((qint32)_s.colorIndex)>=0"); 1059 } 1060 _s.commentIndexSeed = in.readint32(); 1061 if (!(((qint32)_s.commentIndexSeed)>=0)) { 1062 throw IncorrectValueException(in.getPosition(), "((qint32)_s.commentIndexSeed)>=0"); 1063 } 1064 } 1065 void MSO::parseFontEmbedFlags10Atom(LEInputStream& in, FontEmbedFlags10Atom& _s) { 1066 _s.streamOffset = in.getPosition(); 1067 parseRecordHeader(in, _s.rh); 1068 if (!(_s.rh.recVer == 0x0)) { 1069 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1070 } 1071 if (!(_s.rh.recInstance == 0x0)) { 1072 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1073 } 1074 if (!(_s.rh.recType == 0x32C8)) { 1075 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x32C8"); 1076 } 1077 if (!(_s.rh.recLen == 0x04)) { 1078 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x04"); 1079 } 1080 _s.fSubset = in.readbit(); 1081 _s.fSubsetOptionConfirmed = in.readbit(); 1082 _s.unuseda = in.readuint14(); 1083 _s.unusedb = in.readuint16(); 1084 } 1085 void MSO::parseCopyrightAtom(LEInputStream& in, CopyrightAtom& _s) { 1086 _s.streamOffset = in.getPosition(); 1087 int _c; 1088 LEInputStream::Mark _m; 1089 parseRecordHeader(in, _s.rh); 1090 if (!(_s.rh.recVer == 0x0)) { 1091 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1092 } 1093 if (!(_s.rh.recInstance == 0x1)) { 1094 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x1"); 1095 } 1096 if (!(_s.rh.recType == 0x0FBA)) { 1097 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 1098 } 1099 if (!(_s.rh.recLen<=510)) { 1100 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen<=510"); 1101 } 1102 if (!(_s.rh.recLen%2==0)) { 1103 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 1104 } 1105 _c = _s.rh.recLen; 1106 _s.copyright.resize(_c); 1107 in.readBytes(_s.copyright); 1108 } 1109 void MSO::parseKeywordsAtom(LEInputStream& in, KeywordsAtom& _s) { 1110 _s.streamOffset = in.getPosition(); 1111 int _c; 1112 LEInputStream::Mark _m; 1113 parseRecordHeader(in, _s.rh); 1114 if (!(_s.rh.recVer == 0x0)) { 1115 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1116 } 1117 if (!(_s.rh.recInstance == 0x2)) { 1118 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x2"); 1119 } 1120 if (!(_s.rh.recType == 0x0FBA)) { 1121 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 1122 } 1123 if (!(_s.rh.recLen<=510)) { 1124 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen<=510"); 1125 } 1126 if (!(_s.rh.recLen%2==0)) { 1127 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 1128 } 1129 _c = _s.rh.recLen; 1130 _s.keywords.resize(_c); 1131 in.readBytes(_s.keywords); 1132 } 1133 void MSO::parseFilterPrivacyFlags10Atom(LEInputStream& in, FilterPrivacyFlags10Atom& _s) { 1134 _s.streamOffset = in.getPosition(); 1135 parseRecordHeader(in, _s.rh); 1136 if (!(_s.rh.recVer == 0x0)) { 1137 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1138 } 1139 if (!(_s.rh.recInstance == 0x0)) { 1140 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1141 } 1142 if (!(_s.rh.recType == 0x36B0)) { 1143 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x36B0"); 1144 } 1145 if (!(_s.rh.recLen == 0x04)) { 1146 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x04"); 1147 } 1148 _s.fRemovePII = in.readbit(); 1149 _s.reserved2a = in.readuint7(); 1150 if (!(((quint8)_s.reserved2a) == 0x0)) { 1151 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved2a) == 0x0"); 1152 } 1153 _s.reserved2b = in.readuint8(); 1154 if (!(((quint8)_s.reserved2b) == 0x0)) { 1155 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved2b) == 0x0"); 1156 } 1157 _s.reserved2c = in.readuint16(); 1158 if (!(((quint16)_s.reserved2c) == 0x0)) { 1159 throw IncorrectValueException(in.getPosition(), "((quint16)_s.reserved2c) == 0x0"); 1160 } 1161 } 1162 void MSO::parseOutlineTextProps10Container(LEInputStream& in, OutlineTextProps10Container& _s) { 1163 _s.streamOffset = in.getPosition(); 1164 LEInputStream::Mark _m; 1165 bool _atend; 1166 parseRecordHeader(in, _s.rh); 1167 if (!(_s.rh.recVer == 0xF)) { 1168 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 1169 } 1170 if (!(_s.rh.recInstance == 0)) { 1171 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1172 } 1173 if (!(_s.rh.recType == 0x0FB3)) { 1174 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FB3"); 1175 } 1176 _atend = false; 1177 while (!_atend) { 1178 _m = in.setMark(); 1179 try { 1180 _s.rgOutlineTextProps10Entry.append(OutlineTextProps10Entry(&_s)); 1181 parseOutlineTextProps10Entry(in, _s.rgOutlineTextProps10Entry.last()); 1182 } catch(IncorrectValueException _e) { 1183 _s.rgOutlineTextProps10Entry.removeLast(); 1184 _atend = true; 1185 in.rewind(_m); 1186 } catch(EOFException _e) { 1187 _s.rgOutlineTextProps10Entry.removeLast(); 1188 _atend = true; 1189 in.rewind(_m); 1190 } 1191 } 1192 } 1193 void MSO::parseStyleTextProp10Atom(LEInputStream& in, StyleTextProp10Atom& _s) { 1194 _s.streamOffset = in.getPosition(); 1195 LEInputStream::Mark _m; 1196 bool _atend; 1197 parseRecordHeader(in, _s.rh); 1198 if (!(_s.rh.recVer == 0)) { 1199 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1200 } 1201 if (!(_s.rh.recInstance == 0x0)) { 1202 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1203 } 1204 if (!(_s.rh.recType == 0xFB1)) { 1205 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFB1"); 1206 } 1207 _atend = false; 1208 while (!_atend) { 1209 _m = in.setMark(); 1210 try { 1211 _s.rgStyleTextProp10.append(TextCFException10(&_s)); 1212 parseTextCFException10(in, _s.rgStyleTextProp10.last()); 1213 } catch(IncorrectValueException _e) { 1214 _s.rgStyleTextProp10.removeLast(); 1215 _atend = true; 1216 in.rewind(_m); 1217 } catch(EOFException _e) { 1218 _s.rgStyleTextProp10.removeLast(); 1219 _atend = true; 1220 in.rewind(_m); 1221 } 1222 } 1223 } 1224 void MSO::parseDocToolbarStates10Atom(LEInputStream& in, DocToolbarStates10Atom& _s) { 1225 _s.streamOffset = in.getPosition(); 1226 parseRecordHeader(in, _s.rh); 1227 if (!(_s.rh.recVer == 0x0)) { 1228 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1229 } 1230 if (!(_s.rh.recInstance == 0)) { 1231 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1232 } 1233 if (!(_s.rh.recType == 0x36B1)) { 1234 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x36B1"); 1235 } 1236 if (!(_s.rh.recLen == 0x01)) { 1237 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x01"); 1238 } 1239 _s.fShowReviewingToolbar = in.readbit(); 1240 _s.fShowReviewingGallery = in.readbit(); 1241 _s.reserved = in.readuint6(); 1242 if (!(((quint8)_s.reserved) == 0x0)) { 1243 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved) == 0x0"); 1244 } 1245 } 1246 void MSO::parseSlideListTable10Container(LEInputStream& in, SlideListTable10Container& _s) { 1247 _s.streamOffset = in.getPosition(); 1248 int _c; 1249 LEInputStream::Mark _m; 1250 parseRecordHeader(in, _s.rh); 1251 if (!(_s.rh.recVer == 0xF)) { 1252 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 1253 } 1254 if (!(_s.rh.recInstance == 0)) { 1255 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1256 } 1257 if (!(_s.rh.recType == 0x2EF1)) { 1258 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2EF1"); 1259 } 1260 _c = _s.rh.recLen; 1261 _s.todo.resize(_c); 1262 in.readBytes(_s.todo); 1263 } 1264 void MSO::parseDiffTree10Container(LEInputStream& in, DiffTree10Container& _s) { 1265 _s.streamOffset = in.getPosition(); 1266 int _c; 1267 LEInputStream::Mark _m; 1268 parseRecordHeader(in, _s.rh); 1269 if (!(_s.rh.recVer == 0xF)) { 1270 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 1271 } 1272 if (!(_s.rh.recInstance == 0)) { 1273 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1274 } 1275 if (!(_s.rh.recType == 0x2EEC)) { 1276 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2EEC"); 1277 } 1278 _c = _s.rh.recLen; 1279 _s.todo.resize(_c); 1280 in.readBytes(_s.todo); 1281 } 1282 void MSO::parseModifyPasswordAtom(LEInputStream& in, ModifyPasswordAtom& _s) { 1283 _s.streamOffset = in.getPosition(); 1284 int _c; 1285 LEInputStream::Mark _m; 1286 parseRecordHeader(in, _s.rh); 1287 if (!(_s.rh.recVer == 0x0)) { 1288 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1289 } 1290 if (!(_s.rh.recInstance == 0x03)) { 1291 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x03"); 1292 } 1293 if (!(_s.rh.recType == 0x0FBA)) { 1294 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 1295 } 1296 if (!(_s.rh.recLen<=510)) { 1297 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen<=510"); 1298 } 1299 if (!(_s.rh.recLen%2==0)) { 1300 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 1301 } 1302 _c = _s.rh.recLen; 1303 _s.modifyPassword.resize(_c); 1304 in.readBytes(_s.modifyPassword); 1305 } 1306 void MSO::parsePhotoAlbumInfo10Atom(LEInputStream& in, PhotoAlbumInfo10Atom& _s) { 1307 _s.streamOffset = in.getPosition(); 1308 parseRecordHeader(in, _s.rh); 1309 if (!(_s.rh.recVer == 0x0)) { 1310 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1311 } 1312 if (!(_s.rh.recInstance == 0x0)) { 1313 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1314 } 1315 if (!(_s.rh.recType == 0x036B2)) { 1316 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x036B2"); 1317 } 1318 if (!(_s.rh.recLen == 0x06)) { 1319 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x06"); 1320 } 1321 _s.fUseBlackWhite = in.readuint8(); 1322 _s.fHasCaption = in.readuint8(); 1323 _s.layout = in.readuint8(); 1324 if (!(((quint8)_s.layout) == 0 || ((quint8)_s.layout) == 1 || ((quint8)_s.layout) == 2 || ((quint8)_s.layout) == 3 || ((quint8)_s.layout) == 4 || ((quint8)_s.layout) == 5 || ((quint8)_s.layout) == 6)) { 1325 throw IncorrectValueException(in.getPosition(), "((quint8)_s.layout) == 0 || ((quint8)_s.layout) == 1 || ((quint8)_s.layout) == 2 || ((quint8)_s.layout) == 3 || ((quint8)_s.layout) == 4 || ((quint8)_s.layout) == 5 || ((quint8)_s.layout) == 6"); 1326 } 1327 _s.unused = in.readuint8(); 1328 _s.frameShape = in.readuint16(); 1329 if (!(((quint16)_s.frameShape) == 0x0000 || ((quint16)_s.frameShape) == 0x0001 || ((quint16)_s.frameShape) == 0x0002 || ((quint16)_s.frameShape) == 0x0003 || ((quint16)_s.frameShape) == 0x0004 || ((quint16)_s.frameShape) == 0x0005 || ((quint16)_s.frameShape) == 0x0006)) { 1330 throw IncorrectValueException(in.getPosition(), "((quint16)_s.frameShape) == 0x0000 || ((quint16)_s.frameShape) == 0x0001 || ((quint16)_s.frameShape) == 0x0002 || ((quint16)_s.frameShape) == 0x0003 || ((quint16)_s.frameShape) == 0x0004 || ((quint16)_s.frameShape) == 0x0005 || ((quint16)_s.frameShape) == 0x0006"); 1331 } 1332 } 1333 void MSO::parseSmartTagStore11Container(LEInputStream& in, SmartTagStore11Container& _s) { 1334 _s.streamOffset = in.getPosition(); 1335 int _c; 1336 LEInputStream::Mark _m; 1337 parseRecordHeader(in, _s.rh); 1338 if (!(_s.rh.recVer == 0xF)) { 1339 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 1340 } 1341 if (!(_s.rh.recInstance == 0x0)) { 1342 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1343 } 1344 if (!(_s.rh.recType == 0x36B3)) { 1345 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x36B3"); 1346 } 1347 _c = _s.rh.recLen; 1348 _s.todo.resize(_c); 1349 in.readBytes(_s.todo); 1350 } 1351 void MSO::parseOutlineTextProps11Container(LEInputStream& in, OutlineTextProps11Container& _s) { 1352 _s.streamOffset = in.getPosition(); 1353 int _c; 1354 LEInputStream::Mark _m; 1355 parseRecordHeader(in, _s.rh); 1356 if (!(_s.rh.recVer == 0xF)) { 1357 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 1358 } 1359 if (!(_s.rh.recInstance == 0x0)) { 1360 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1361 } 1362 if (!(_s.rh.recType == 0x0FB5)) { 1363 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FB5"); 1364 } 1365 _c = _s.rh.recLen; 1366 _s.todo.resize(_c); 1367 in.readBytes(_s.todo); 1368 } 1369 void MSO::parseBinaryTagDataBlob(LEInputStream& in, BinaryTagDataBlob& _s) { 1370 _s.streamOffset = in.getPosition(); 1371 int _c; 1372 LEInputStream::Mark _m; 1373 parseRecordHeader(in, _s.rh); 1374 if (!(_s.rh.recVer == 0x0)) { 1375 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1376 } 1377 if (!(_s.rh.recInstance == 0x0)) { 1378 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1379 } 1380 if (!(_s.rh.recType == 0x138B)) { 1381 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x138B"); 1382 } 1383 _c = _s.rh.recLen; 1384 _s.data.resize(_c); 1385 in.readBytes(_s.data); 1386 } 1387 void MSO::parsePP12DocBinaryTagExtension(LEInputStream& in, PP12DocBinaryTagExtension& _s) { 1388 _s.streamOffset = in.getPosition(); 1389 int _c; 1390 LEInputStream::Mark _m; 1391 parseRecordHeader(in, _s.rh); 1392 if (!(_s.rh.recVer == 0x0)) { 1393 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1394 } 1395 if (!(_s.rh.recInstance == 0)) { 1396 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1397 } 1398 if (!(_s.rh.recType == 0x0FBA)) { 1399 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 1400 } 1401 if (!(_s.rh.recLen == 0x10)) { 1402 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x10"); 1403 } 1404 _c = 16; 1405 _s.tagName.resize(_c); 1406 in.readBytes(_s.tagName); 1407 parseRecordHeader(in, _s.rhData); 1408 if (!(_s.rhData.recVer == 0x0)) { 1409 throw IncorrectValueException(in.getPosition(), "_s.rhData.recVer == 0x0"); 1410 } 1411 if (!(_s.rhData.recInstance == 0)) { 1412 throw IncorrectValueException(in.getPosition(), "_s.rhData.recInstance == 0"); 1413 } 1414 if (!(_s.rhData.recType == 0x138B)) { 1415 throw IncorrectValueException(in.getPosition(), "_s.rhData.recType == 0x138B"); 1416 } 1417 _c = _s.rhData.recLen; 1418 _s.todo.resize(_c); 1419 in.readBytes(_s.todo); 1420 } 1421 void MSO::parseSorterViewInfoContainer(LEInputStream& in, SorterViewInfoContainer& _s) { 1422 _s.streamOffset = in.getPosition(); 1423 int _c; 1424 LEInputStream::Mark _m; 1425 parseRecordHeader(in, _s.rh); 1426 if (!(_s.rh.recVer == 0xF)) { 1427 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 1428 } 1429 if (!(_s.rh.recInstance == 1)) { 1430 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 1"); 1431 } 1432 if (!(_s.rh.recType == 0x408)) { 1433 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x408"); 1434 } 1435 _c = _s.rh.recLen; 1436 _s.todo.resize(_c); 1437 in.readBytes(_s.todo); 1438 } 1439 void MSO::parseVBAInfoAtom(LEInputStream& in, VBAInfoAtom& _s) { 1440 _s.streamOffset = in.getPosition(); 1441 parseRecordHeader(in, _s.rh); 1442 if (!(_s.rh.recVer == 2)) { 1443 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 2"); 1444 } 1445 if (!(_s.rh.recInstance == 0)) { 1446 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1447 } 1448 if (!(_s.rh.recType == 0x400)) { 1449 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x400"); 1450 } 1451 if (!(_s.rh.recLen == 0xC)) { 1452 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0xC"); 1453 } 1454 _s.persistIdRef = in.readuint32(); 1455 _s.fHasMacros = in.readuint32(); 1456 if (!(((quint32)_s.fHasMacros) == 0 || ((quint32)_s.fHasMacros) == 1)) { 1457 throw IncorrectValueException(in.getPosition(), "((quint32)_s.fHasMacros) == 0 || ((quint32)_s.fHasMacros) == 1"); 1458 } 1459 _s.version = in.readuint32(); 1460 if (!(((quint32)_s.version) == 0 || ((quint32)_s.version) == 1 || ((quint32)_s.version) == 2)) { 1461 throw IncorrectValueException(in.getPosition(), "((quint32)_s.version) == 0 || ((quint32)_s.version) == 1 || ((quint32)_s.version) == 2"); 1462 } 1463 } 1464 void MSO::parseMasterListWithTextContainer(LEInputStream& in, MasterListWithTextContainer& _s) { 1465 _s.streamOffset = in.getPosition(); 1466 int _c; 1467 LEInputStream::Mark _m; 1468 parseRecordHeader(in, _s.rh); 1469 if (!(_s.rh.recVer == 0xF)) { 1470 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 1471 } 1472 if (!(_s.rh.recInstance == 0x1)) { 1473 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x1"); 1474 } 1475 if (!(_s.rh.recType == 0x0FF0)) { 1476 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FF0"); 1477 } 1478 if (!(_s.rh.recLen%28==0)) { 1479 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%28==0"); 1480 } 1481 _c = _s.rh.recLen/28; 1482 for (int _i=0; _i<_c; ++_i) { 1483 _s.rgMasterPersistAtom.append(MasterPersistAtom(&_s)); 1484 parseMasterPersistAtom(in, _s.rgMasterPersistAtom[_i]); 1485 } 1486 } 1487 void MSO::parseMasterPersistAtom(LEInputStream& in, MasterPersistAtom& _s) { 1488 _s.streamOffset = in.getPosition(); 1489 parseRecordHeader(in, _s.rh); 1490 if (!(_s.rh.recVer == 0)) { 1491 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1492 } 1493 if (!(_s.rh.recInstance == 0)) { 1494 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1495 } 1496 if (!(_s.rh.recType == 0x3F3)) { 1497 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x3F3"); 1498 } 1499 if (!(_s.rh.recLen == 0x14)) { 1500 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x14"); 1501 } 1502 _s.persistIdRef = in.readuint32(); 1503 _s.reserved1 = in.readuint2(); 1504 if (!(((quint8)_s.reserved1) == 0)) { 1505 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved1) == 0"); 1506 } 1507 _s.fNonOutLineData = in.readbit(); 1508 _s.reserved2 = in.readuint5(); 1509 if (!(((quint8)_s.reserved2) == 0)) { 1510 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved2) == 0"); 1511 } 1512 _s.reserved3 = in.readuint8(); 1513 if (!(((quint8)_s.reserved3) == 0)) { 1514 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved3) == 0"); 1515 } 1516 _s.reserved4 = in.readuint16(); 1517 if (!(((quint16)_s.reserved4) == 0)) { 1518 throw IncorrectValueException(in.getPosition(), "((quint16)_s.reserved4) == 0"); 1519 } 1520 _s.reserved5 = in.readuint32(); 1521 if (!(((quint32)_s.reserved5) == 0)) { 1522 throw IncorrectValueException(in.getPosition(), "((quint32)_s.reserved5) == 0"); 1523 } 1524 _s.masterId = in.readuint32(); 1525 _s.reserved6 = in.readuint32(); 1526 if (!(((quint32)_s.reserved6) == 0)) { 1527 throw IncorrectValueException(in.getPosition(), "((quint32)_s.reserved6) == 0"); 1528 } 1529 } 1530 void MSO::parseSlideListWithTextContainer(LEInputStream& in, SlideListWithTextContainer& _s) { 1531 _s.streamOffset = in.getPosition(); 1532 LEInputStream::Mark _m; 1533 bool _atend; 1534 parseRecordHeader(in, _s.rh); 1535 if (!(_s.rh.recVer == 0xF)) { 1536 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 1537 } 1538 if (!(_s.rh.recInstance == 0x0)) { 1539 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 1540 } 1541 if (!(_s.rh.recType == 0x0FF0)) { 1542 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FF0"); 1543 } 1544 _atend = false; 1545 while (!_atend) { 1546 _m = in.setMark(); 1547 try { 1548 _s.rgChildRec.append(SlideListWithTextSubContainerOrAtom(&_s)); 1549 parseSlideListWithTextSubContainerOrAtom(in, _s.rgChildRec.last()); 1550 } catch(IncorrectValueException _e) { 1551 _s.rgChildRec.removeLast(); 1552 _atend = true; 1553 in.rewind(_m); 1554 } catch(EOFException _e) { 1555 _s.rgChildRec.removeLast(); 1556 _atend = true; 1557 in.rewind(_m); 1558 } 1559 } 1560 } 1561 void MSO::parseNotesListWithTextContainer(LEInputStream& in, NotesListWithTextContainer& _s) { 1562 _s.streamOffset = in.getPosition(); 1563 LEInputStream::Mark _m; 1564 bool _atend; 1565 parseRecordHeader(in, _s.rh); 1566 if (!(_s.rh.recVer == 0xF)) { 1567 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 1568 } 1569 if (!(_s.rh.recInstance == 2)) { 1570 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 2"); 1571 } 1572 if (!(_s.rh.recType == 0x0FF0)) { 1573 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FF0"); 1574 } 1575 _atend = false; 1576 while (!_atend) { 1577 _m = in.setMark(); 1578 try { 1579 _s.rgNotesPersistAtom.append(NotesPersistAtom(&_s)); 1580 parseNotesPersistAtom(in, _s.rgNotesPersistAtom.last()); 1581 } catch(IncorrectValueException _e) { 1582 _s.rgNotesPersistAtom.removeLast(); 1583 _atend = true; 1584 in.rewind(_m); 1585 } catch(EOFException _e) { 1586 _s.rgNotesPersistAtom.removeLast(); 1587 _atend = true; 1588 in.rewind(_m); 1589 } 1590 } 1591 } 1592 void MSO::parseNotesPersistAtom(LEInputStream& in, NotesPersistAtom& _s) { 1593 _s.streamOffset = in.getPosition(); 1594 parseRecordHeader(in, _s.rh); 1595 if (!(_s.rh.recVer == 0x0)) { 1596 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 1597 } 1598 if (!(_s.rh.recInstance == 0)) { 1599 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1600 } 1601 if (!(_s.rh.recType == 0x03F3)) { 1602 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x03F3"); 1603 } 1604 if (!(_s.rh.recLen == 0x14)) { 1605 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x14"); 1606 } 1607 _s.persistIdRef = in.readuint32(); 1608 _s.reserved1 = in.readuint2(); 1609 if (!(((quint8)_s.reserved1) == 0)) { 1610 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved1) == 0"); 1611 } 1612 _s.fNonOutlineData = in.readbit(); 1613 _s.reserved2a = in.readuint5(); 1614 if (!(((quint8)_s.reserved2a) == 0)) { 1615 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved2a) == 0"); 1616 } 1617 _s.reserved2b = in.readuint8(); 1618 if (!(((quint8)_s.reserved2b) == 0)) { 1619 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved2b) == 0"); 1620 } 1621 _s.reserved2c = in.readuint16(); 1622 if (!(((quint16)_s.reserved2c) == 0)) { 1623 throw IncorrectValueException(in.getPosition(), "((quint16)_s.reserved2c) == 0"); 1624 } 1625 _s.reserved3 = in.readuint32(); 1626 if (!(((quint32)_s.reserved3) == 0)) { 1627 throw IncorrectValueException(in.getPosition(), "((quint32)_s.reserved3) == 0"); 1628 } 1629 _s.notesId = in.readuint32(); 1630 _s.reserved4 = in.readuint32(); 1631 if (!(((quint32)_s.reserved4) == 0)) { 1632 throw IncorrectValueException(in.getPosition(), "((quint32)_s.reserved4) == 0"); 1633 } 1634 } 1635 void MSO::parseTextHeaderAtom(LEInputStream& in, TextHeaderAtom& _s) { 1636 _s.streamOffset = in.getPosition(); 1637 parseRecordHeader(in, _s.rh); 1638 if (!(_s.rh.recVer == 0)) { 1639 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1640 } 1641 if (!(_s.rh.recInstance == 0 || _s.rh.recInstance == 1 || _s.rh.recInstance == 2 || _s.rh.recInstance == 3 || _s.rh.recInstance == 4 || _s.rh.recInstance == 5)) { 1642 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0 || _s.rh.recInstance == 1 || _s.rh.recInstance == 2 || _s.rh.recInstance == 3 || _s.rh.recInstance == 4 || _s.rh.recInstance == 5"); 1643 } 1644 if (!(_s.rh.recType == 0xF9F)) { 1645 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF9F"); 1646 } 1647 if (!(_s.rh.recLen == 4)) { 1648 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 1649 } 1650 _s.textType = in.readuint32(); 1651 } 1652 void MSO::parseTextCharsAtom(LEInputStream& in, TextCharsAtom& _s) { 1653 _s.streamOffset = in.getPosition(); 1654 int _c; 1655 LEInputStream::Mark _m; 1656 parseRecordHeader(in, _s.rh); 1657 if (!(_s.rh.recVer == 0)) { 1658 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1659 } 1660 if (!(_s.rh.recInstance == 0)) { 1661 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1662 } 1663 if (!(_s.rh.recType == 0xFA0)) { 1664 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFA0"); 1665 } 1666 if (!(_s.rh.recLen%2==0)) { 1667 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 1668 } 1669 _c = _s.rh.recLen/2; 1670 _s.textChars.resize(_c); 1671 for (int _i=0; _i<_c; ++_i) { 1672 _s.textChars[_i] = in.readuint16(); 1673 } 1674 } 1675 void MSO::parseTextBytesAtom(LEInputStream& in, TextBytesAtom& _s) { 1676 _s.streamOffset = in.getPosition(); 1677 int _c; 1678 LEInputStream::Mark _m; 1679 parseRecordHeader(in, _s.rh); 1680 if (!(_s.rh.recVer == 0)) { 1681 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1682 } 1683 if (!(_s.rh.recInstance == 0)) { 1684 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1685 } 1686 if (!(_s.rh.recType == 0xFA8)) { 1687 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFA8"); 1688 } 1689 _c = _s.rh.recLen; 1690 _s.textChars.resize(_c); 1691 in.readBytes(_s.textChars); 1692 } 1693 void MSO::parseMasterTextPropAtom(LEInputStream& in, MasterTextPropAtom& _s) { 1694 _s.streamOffset = in.getPosition(); 1695 LEInputStream::Mark _m; 1696 bool _atend; 1697 parseRecordHeader(in, _s.rh); 1698 if (!(_s.rh.recVer == 0)) { 1699 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1700 } 1701 if (!(_s.rh.recInstance == 0)) { 1702 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1703 } 1704 if (!(_s.rh.recType == 0xFA2)) { 1705 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFA2"); 1706 } 1707 qint64 _startPos = in.getPosition(); 1708 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 1709 _atend = in.getPosition() - _startPos >= _totalSize; 1710 while (!_atend) { 1711 _s.rgMasterTextPropRun.append(MasterTextPropRun(&_s)); 1712 parseMasterTextPropRun(in, _s.rgMasterTextPropRun.last()); 1713 _atend = in.getPosition() - _startPos >= _totalSize; 1714 } 1715 } 1716 void MSO::parseMasterTextPropRun(LEInputStream& in, MasterTextPropRun& _s) { 1717 _s.streamOffset = in.getPosition(); 1718 _s.count = in.readuint32(); 1719 _s.indentLevel = in.readuint16(); 1720 if (!(((quint16)_s.indentLevel)<=4)) { 1721 throw IncorrectValueException(in.getPosition(), "((quint16)_s.indentLevel)<=4"); 1722 } 1723 } 1724 void MSO::parseStyleTextPropAtom(LEInputStream& in, StyleTextPropAtom& _s) { 1725 _s.streamOffset = in.getPosition(); 1726 int _c; 1727 LEInputStream::Mark _m; 1728 parseRecordHeader(in, _s.rh); 1729 if (!(_s.rh.recVer == 0)) { 1730 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1731 } 1732 if (!(_s.rh.recInstance == 0)) { 1733 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1734 } 1735 if (!(_s.rh.recType == 0xFA1)) { 1736 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFA1"); 1737 } 1738 } 1739 void MSO::parseSlideNumberMCAtom(LEInputStream& in, SlideNumberMCAtom& _s) { 1740 _s.streamOffset = in.getPosition(); 1741 parseRecordHeader(in, _s.rh); 1742 if (!(_s.rh.recVer == 0)) { 1743 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1744 } 1745 if (!(_s.rh.recInstance == 0)) { 1746 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1747 } 1748 if (!(_s.rh.recType == 0xFD8)) { 1749 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFD8"); 1750 } 1751 if (!(_s.rh.recLen == 4)) { 1752 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 1753 } 1754 _s.position = in.readint32(); 1755 } 1756 void MSO::parseDateTimeMCAtom(LEInputStream& in, DateTimeMCAtom& _s) { 1757 _s.streamOffset = in.getPosition(); 1758 int _c; 1759 LEInputStream::Mark _m; 1760 parseRecordHeader(in, _s.rh); 1761 if (!(_s.rh.recVer == 0)) { 1762 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1763 } 1764 if (!(_s.rh.recInstance == 0)) { 1765 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1766 } 1767 if (!(_s.rh.recType == 0xFF7)) { 1768 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFF7"); 1769 } 1770 if (!(_s.rh.recLen == 8)) { 1771 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 1772 } 1773 _s.position = in.readint32(); 1774 _s.index = in.readuint8(); 1775 _c = 3; 1776 _s.unused.resize(_c); 1777 in.readBytes(_s.unused); 1778 } 1779 void MSO::parseGenericDateMCAtom(LEInputStream& in, GenericDateMCAtom& _s) { 1780 _s.streamOffset = in.getPosition(); 1781 parseRecordHeader(in, _s.rh); 1782 if (!(_s.rh.recVer == 0)) { 1783 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1784 } 1785 if (!(_s.rh.recInstance == 0)) { 1786 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1787 } 1788 if (!(_s.rh.recType == 0xFF8)) { 1789 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFF8"); 1790 } 1791 if (!(_s.rh.recLen == 4)) { 1792 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 1793 } 1794 _s.position = in.readint32(); 1795 } 1796 void MSO::parseHeaderMCAtom(LEInputStream& in, HeaderMCAtom& _s) { 1797 _s.streamOffset = in.getPosition(); 1798 parseRecordHeader(in, _s.rh); 1799 if (!(_s.rh.recVer == 0)) { 1800 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1801 } 1802 if (!(_s.rh.recInstance == 0)) { 1803 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1804 } 1805 if (!(_s.rh.recType == 0xFF9)) { 1806 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFF9"); 1807 } 1808 if (!(_s.rh.recLen == 4)) { 1809 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 1810 } 1811 _s.position = in.readint32(); 1812 } 1813 void MSO::parseFooterMCAtom(LEInputStream& in, FooterMCAtom& _s) { 1814 _s.streamOffset = in.getPosition(); 1815 parseRecordHeader(in, _s.rh); 1816 if (!(_s.rh.recVer == 0)) { 1817 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1818 } 1819 if (!(_s.rh.recInstance == 0)) { 1820 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1821 } 1822 if (!(_s.rh.recType == 0xFFA)) { 1823 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFFA"); 1824 } 1825 if (!(_s.rh.recLen == 4)) { 1826 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 1827 } 1828 _s.position = in.readint32(); 1829 } 1830 void MSO::parseRTFDateTimeMCAtom(LEInputStream& in, RTFDateTimeMCAtom& _s) { 1831 _s.streamOffset = in.getPosition(); 1832 int _c; 1833 LEInputStream::Mark _m; 1834 parseRecordHeader(in, _s.rh); 1835 if (!(_s.rh.recVer == 0)) { 1836 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1837 } 1838 if (!(_s.rh.recInstance == 0)) { 1839 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1840 } 1841 if (!(_s.rh.recType == 0x1015)) { 1842 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1015"); 1843 } 1844 if (!(_s.rh.recLen == 0x84)) { 1845 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x84"); 1846 } 1847 _s.position = in.readint32(); 1848 _c = 128; 1849 _s.format.resize(_c); 1850 in.readBytes(_s.format); 1851 } 1852 void MSO::parseTextBookmarkAtom(LEInputStream& in, TextBookmarkAtom& _s) { 1853 _s.streamOffset = in.getPosition(); 1854 parseRecordHeader(in, _s.rh); 1855 if (!(_s.rh.recVer == 0)) { 1856 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1857 } 1858 if (!(_s.rh.recInstance == 0)) { 1859 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1860 } 1861 if (!(_s.rh.recType == 0xFA7)) { 1862 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFA7"); 1863 } 1864 if (!(_s.rh.recLen == 0xC)) { 1865 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0xC"); 1866 } 1867 _s.begin = in.readint32(); 1868 _s.end = in.readint32(); 1869 _s.bookmarkID = in.readint32(); 1870 } 1871 void MSO::parseTextRange(LEInputStream& in, TextRange& _s) { 1872 _s.streamOffset = in.getPosition(); 1873 _s.begin = in.readint32(); 1874 _s.end = in.readint32(); 1875 } 1876 void MSO::parseMouseClickTextInteractiveInfoAtom(LEInputStream& in, MouseClickTextInteractiveInfoAtom& _s) { 1877 _s.streamOffset = in.getPosition(); 1878 parseRecordHeader(in, _s.rh); 1879 if (!(_s.rh.recVer == 0)) { 1880 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1881 } 1882 if (!(_s.rh.recInstance == 0)) { 1883 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 1884 } 1885 if (!(_s.rh.recType == 0xFDF)) { 1886 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFDF"); 1887 } 1888 if (!(_s.rh.recLen == 8)) { 1889 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 1890 } 1891 parseTextRange(in, _s.range); 1892 } 1893 void MSO::parseMouseOverTextInteractiveInfoAtom(LEInputStream& in, MouseOverTextInteractiveInfoAtom& _s) { 1894 _s.streamOffset = in.getPosition(); 1895 parseRecordHeader(in, _s.rh); 1896 if (!(_s.rh.recVer == 0)) { 1897 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 1898 } 1899 if (!(_s.rh.recInstance == 1)) { 1900 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 1"); 1901 } 1902 if (!(_s.rh.recType == 0xFDF)) { 1903 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFDF"); 1904 } 1905 if (!(_s.rh.recLen == 8)) { 1906 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 1907 } 1908 parseTextRange(in, _s.range); 1909 } 1910 void MSO::parseSlideId(LEInputStream& in, SlideId& _s) { 1911 _s.streamOffset = in.getPosition(); 1912 _s.slideId = in.readuint32(); 1913 if (!(((quint32)_s.slideId)>=100)) { 1914 throw IncorrectValueException(in.getPosition(), "((quint32)_s.slideId)>=100"); 1915 } 1916 if (!(((quint32)_s.slideId)<2147483647)) { 1917 throw IncorrectValueException(in.getPosition(), "((quint32)_s.slideId)<2147483647"); 1918 } 1919 } 1920 void MSO::parseTabStops(LEInputStream& in, TabStops& _s) { 1921 _s.streamOffset = in.getPosition(); 1922 int _c; 1923 LEInputStream::Mark _m; 1924 _s.count = in.readuint16(); 1925 _c = _s.count; 1926 for (int _i=0; _i<_c; ++_i) { 1927 _s.rgTabStop.append(TabStop(&_s)); 1928 parseTabStop(in, _s.rgTabStop[_i]); 1929 } 1930 } 1931 void MSO::parseTabStop(LEInputStream& in, TabStop& _s) { 1932 _s.streamOffset = in.getPosition(); 1933 _s.position = in.readint16(); 1934 _s.type = in.readuint16(); 1935 } 1936 void MSO::parsePFWrapFlags(LEInputStream& in, PFWrapFlags& _s) { 1937 _s.streamOffset = in.getPosition(); 1938 _s.charWrap = in.readbit(); 1939 _s.wordWrap = in.readbit(); 1940 _s.overflow = in.readbit(); 1941 _s.reserved1 = in.readuint5(); 1942 _s.reserved2 = in.readuint8(); 1943 } 1944 void MSO::parseColorIndexStruct(LEInputStream& in, ColorIndexStruct& _s) { 1945 _s.streamOffset = in.getPosition(); 1946 _s.red = in.readuint8(); 1947 _s.green = in.readuint8(); 1948 _s.blue = in.readuint8(); 1949 _s.index = in.readuint8(); 1950 } 1951 void MSO::parseBulletFlags(LEInputStream& in, BulletFlags& _s) { 1952 _s.streamOffset = in.getPosition(); 1953 _s.fHasBullet = in.readbit(); 1954 _s.fBulletHasFont = in.readbit(); 1955 _s.fBulletHasColor = in.readbit(); 1956 _s.fBulletHasSize = in.readbit(); 1957 _s.reserved = in.readuint12(); 1958 } 1959 void MSO::parsePFMasks(LEInputStream& in, PFMasks& _s) { 1960 _s.streamOffset = in.getPosition(); 1961 _s.hasBullet = in.readbit(); 1962 _s.bulletHasFont = in.readbit(); 1963 _s.bulletHasColor = in.readbit(); 1964 _s.bulletHasSize = in.readbit(); 1965 _s.bulletFont = in.readbit(); 1966 _s.bulletColor = in.readbit(); 1967 _s.bulletSize = in.readbit(); 1968 _s.bulletChar = in.readbit(); 1969 _s.leftMargin = in.readbit(); 1970 _s.unused = in.readbit(); 1971 _s.indent = in.readbit(); 1972 _s.align = in.readbit(); 1973 _s.lineSpacing = in.readbit(); 1974 _s.spaceBefore = in.readbit(); 1975 _s.spaceAfter = in.readbit(); 1976 _s.defaultTabSize = in.readbit(); 1977 _s.fontAlign = in.readbit(); 1978 _s.charWrap = in.readbit(); 1979 _s.wordWrap = in.readbit(); 1980 _s.overflow = in.readbit(); 1981 _s.tabStops = in.readbit(); 1982 _s.textDirection = in.readbit(); 1983 _s.reserved = in.readbit(); 1984 _s.bulletBlip = in.readbit(); 1985 _s.bulletScheme = in.readbit(); 1986 _s.bulletHasScheme = in.readbit(); 1987 _s.reserved2 = in.readuint6(); 1988 } 1989 void MSO::parseCFMasks(LEInputStream& in, CFMasks& _s) { 1990 _s.streamOffset = in.getPosition(); 1991 _s.bold = in.readbit(); 1992 _s.italic = in.readbit(); 1993 _s.underline = in.readbit(); 1994 _s.unused1 = in.readbit(); 1995 _s.shadow = in.readbit(); 1996 _s.fehint = in.readbit(); 1997 _s.unused2 = in.readbit(); 1998 _s.kumi = in.readbit(); 1999 _s.unused3 = in.readbit(); 2000 _s.emboss = in.readbit(); 2001 _s.fHasStyle = in.readuint4(); 2002 _s.unused4 = in.readuint2(); 2003 _s.typeface = in.readbit(); 2004 _s.size = in.readbit(); 2005 _s.color = in.readbit(); 2006 _s.position = in.readbit(); 2007 _s.pp10ext = in.readbit(); 2008 _s.oldEATypeface = in.readbit(); 2009 _s.ansiTypeface = in.readbit(); 2010 _s.symbolTypeface = in.readbit(); 2011 _s.newEATypeface = in.readbit(); 2012 _s.csTypeface = in.readbit(); 2013 _s.pp11ext = in.readbit(); 2014 _s.reserved = in.readuint5(); 2015 } 2016 void MSO::parseCFStyle(LEInputStream& in, CFStyle& _s) { 2017 _s.streamOffset = in.getPosition(); 2018 _s.bold = in.readbit(); 2019 _s.italic = in.readbit(); 2020 _s.underline = in.readbit(); 2021 _s.unused1 = in.readbit(); 2022 _s.shadow = in.readbit(); 2023 _s.fehint = in.readbit(); 2024 _s.unused2 = in.readbit(); 2025 _s.kumi = in.readbit(); 2026 _s.unused3 = in.readbit(); 2027 _s.emboss = in.readbit(); 2028 _s.pp9rt = in.readuint4(); 2029 _s.unused4 = in.readuint2(); 2030 } 2031 void MSO::parseFontCollectionContainer(LEInputStream& in, FontCollectionContainer& _s) { 2032 _s.streamOffset = in.getPosition(); 2033 LEInputStream::Mark _m; 2034 bool _atend; 2035 parseRecordHeader(in, _s.rh); 2036 if (!(_s.rh.recVer == 0xF)) { 2037 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 2038 } 2039 if (!(_s.rh.recInstance == 0x0)) { 2040 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 2041 } 2042 if (!(_s.rh.recType == 0x07D5)) { 2043 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x07D5"); 2044 } 2045 qint64 _startPos = in.getPosition(); 2046 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 2047 _atend = in.getPosition() - _startPos >= _totalSize; 2048 while (!_atend) { 2049 _s.rgFontCollectionEntry.append(FontCollectionEntry(&_s)); 2050 parseFontCollectionEntry(in, _s.rgFontCollectionEntry.last()); 2051 _atend = in.getPosition() - _startPos >= _totalSize; 2052 } 2053 } 2054 void MSO::parseFontEntityAtom(LEInputStream& in, FontEntityAtom& _s) { 2055 _s.streamOffset = in.getPosition(); 2056 int _c; 2057 LEInputStream::Mark _m; 2058 parseRecordHeader(in, _s.rh); 2059 if (!(_s.rh.recVer == 0)) { 2060 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2061 } 2062 if (!(_s.rh.recInstance<=128)) { 2063 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance<=128"); 2064 } 2065 if (!(_s.rh.recType == 0xFB7)) { 2066 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFB7"); 2067 } 2068 if (!(_s.rh.recLen == 0x44)) { 2069 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x44"); 2070 } 2071 _c = 32; 2072 _s.lfFaceName.resize(_c); 2073 for (int _i=0; _i<_c; ++_i) { 2074 _s.lfFaceName[_i] = in.readuint16(); 2075 } 2076 _s.lfCharSet = in.readuint8(); 2077 _s.fEmbedSubsetted = in.readbit(); 2078 _s.unused = in.readuint7(); 2079 _s.rasterFontType = in.readbit(); 2080 _s.deviceFontType = in.readbit(); 2081 _s.truetypeFontType = in.readbit(); 2082 _s.fNoFontSubstitution = in.readbit(); 2083 _s.reserved = in.readuint4(); 2084 if (!(((quint8)_s.reserved) == 0)) { 2085 throw IncorrectValueException(in.getPosition(), "((quint8)_s.reserved) == 0"); 2086 } 2087 _s.lfPitchAndFamily = in.readuint8(); 2088 } 2089 void MSO::parseFontEmbedDataBlob(LEInputStream& in, FontEmbedDataBlob& _s) { 2090 _s.streamOffset = in.getPosition(); 2091 int _c; 2092 LEInputStream::Mark _m; 2093 parseRecordHeader(in, _s.rh); 2094 if (!(_s.rh.recVer == 0)) { 2095 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2096 } 2097 if (!(_s.rh.recInstance<=3)) { 2098 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance<=3"); 2099 } 2100 if (!(_s.rh.recType == 0xFB8)) { 2101 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFB8"); 2102 } 2103 _c = _s.rh.recLen; 2104 _s.data.resize(_c); 2105 in.readBytes(_s.data); 2106 } 2107 void MSO::parseKinsokuAtom(LEInputStream& in, KinsokuAtom& _s) { 2108 _s.streamOffset = in.getPosition(); 2109 parseRecordHeader(in, _s.rh); 2110 if (!(_s.rh.recVer == 0x0)) { 2111 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 2112 } 2113 if (!(_s.rh.recInstance == 0x3)) { 2114 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x3"); 2115 } 2116 if (!(_s.rh.recType == 0x0FD2)) { 2117 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FD2"); 2118 } 2119 if (!(_s.rh.recLen == 4)) { 2120 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 2121 } 2122 _s.level = in.readuint32(); 2123 if (!(((quint32)_s.level) == 0 || ((quint32)_s.level) == 1 || ((quint32)_s.level) == 2 || ((quint32)_s.level) == 128)) { 2124 throw IncorrectValueException(in.getPosition(), "((quint32)_s.level) == 0 || ((quint32)_s.level) == 1 || ((quint32)_s.level) == 2 || ((quint32)_s.level) == 128"); 2125 } 2126 } 2127 void MSO::parseKinsokuLeadingAtom(LEInputStream& in, KinsokuLeadingAtom& _s) { 2128 _s.streamOffset = in.getPosition(); 2129 int _c; 2130 LEInputStream::Mark _m; 2131 parseRecordHeader(in, _s.rh); 2132 if (!(_s.rh.recVer == 0)) { 2133 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2134 } 2135 if (!(_s.rh.recInstance == 0)) { 2136 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2137 } 2138 if (!(_s.rh.recType == 0xFBA)) { 2139 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 2140 } 2141 if (!(_s.rh.recLen%2==0)) { 2142 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 2143 } 2144 _c = _s.rh.recLen/2; 2145 _s.kinsokuLeading.resize(_c); 2146 for (int _i=0; _i<_c; ++_i) { 2147 _s.kinsokuLeading[_i] = in.readuint16(); 2148 } 2149 } 2150 void MSO::parseKinsokuFollowingAtom(LEInputStream& in, KinsokuFollowingAtom& _s) { 2151 _s.streamOffset = in.getPosition(); 2152 int _c; 2153 LEInputStream::Mark _m; 2154 parseRecordHeader(in, _s.rh); 2155 if (!(_s.rh.recVer == 0)) { 2156 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2157 } 2158 if (!(_s.rh.recInstance == 1 )) { 2159 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 1 "); 2160 } 2161 if (!(_s.rh.recType == 0xFBA)) { 2162 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 2163 } 2164 if (!(_s.rh.recLen%2==0)) { 2165 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 2166 } 2167 _c = _s.rh.recLen/2; 2168 _s.kinsokuFollowing.resize(_c); 2169 for (int _i=0; _i<_c; ++_i) { 2170 _s.kinsokuFollowing[_i] = in.readuint16(); 2171 } 2172 } 2173 void MSO::parseTextSpecialInfoAtom(LEInputStream& in, TextSpecialInfoAtom& _s) { 2174 _s.streamOffset = in.getPosition(); 2175 LEInputStream::Mark _m; 2176 bool _atend; 2177 parseRecordHeader(in, _s.rh); 2178 if (!(_s.rh.recVer == 0x0)) { 2179 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 2180 } 2181 if (!(_s.rh.recInstance == 0x0)) { 2182 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 2183 } 2184 if (!(_s.rh.recType == 0xFAA)) { 2185 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFAA"); 2186 } 2187 qint64 _startPos = in.getPosition(); 2188 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 2189 _atend = in.getPosition() - _startPos >= _totalSize; 2190 while (!_atend) { 2191 _s.rgSIRun.append(TextSIRun(&_s)); 2192 parseTextSIRun(in, _s.rgSIRun.last()); 2193 _atend = in.getPosition() - _startPos >= _totalSize; 2194 } 2195 } 2196 void MSO::parseSmartTags(LEInputStream& in, SmartTags& _s) { 2197 _s.streamOffset = in.getPosition(); 2198 int _c; 2199 LEInputStream::Mark _m; 2200 _s.count = in.readuint32(); 2201 _c = _s.count; 2202 _s.rgSmartTagIndex.resize(_c); 2203 for (int _i=0; _i<_c; ++_i) { 2204 _s.rgSmartTagIndex[_i] = in.readuint32(); 2205 } 2206 } 2207 void MSO::parseExOleEmbedAtom(LEInputStream& in, ExOleEmbedAtom& _s) { 2208 _s.streamOffset = in.getPosition(); 2209 parseRecordHeader(in, _s.rh); 2210 if (!(_s.rh.recVer == 0x0)) { 2211 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 2212 } 2213 if (!(_s.rh.recInstance == 0x0)) { 2214 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 2215 } 2216 if (!(_s.rh.recType == 0x0FCD)) { 2217 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FCD"); 2218 } 2219 if (!(_s.rh.recLen == 0x8)) { 2220 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x8"); 2221 } 2222 _s.exColorFollow = in.readuint32(); 2223 if (!(((quint32)_s.exColorFollow) == 0 || ((quint32)_s.exColorFollow) == 1 || ((quint32)_s.exColorFollow) == 2)) { 2224 throw IncorrectValueException(in.getPosition(), "((quint32)_s.exColorFollow) == 0 || ((quint32)_s.exColorFollow) == 1 || ((quint32)_s.exColorFollow) == 2"); 2225 } 2226 _s.fCantLockServer = in.readuint8(); 2227 _s.fNoSizeToServer = in.readuint8(); 2228 _s.fIsTable = in.readuint8(); 2229 _s.unused = in.readuint8(); 2230 } 2231 void MSO::parsePointStruct(LEInputStream& in, PointStruct& _s) { 2232 _s.streamOffset = in.getPosition(); 2233 _s.x = in.readint32(); 2234 _s.y = in.readint32(); 2235 } 2236 void MSO::parseRatioStruct(LEInputStream& in, RatioStruct& _s) { 2237 _s.streamOffset = in.getPosition(); 2238 _s.numer = in.readint32(); 2239 _s.denom = in.readint32(); 2240 if (!(((qint32)_s.denom)!= 0)) { 2241 throw IncorrectValueException(in.getPosition(), "((qint32)_s.denom)!= 0"); 2242 } 2243 } 2244 void MSO::parsePersistDirectoryAtom(LEInputStream& in, PersistDirectoryAtom& _s) { 2245 _s.streamOffset = in.getPosition(); 2246 LEInputStream::Mark _m; 2247 bool _atend; 2248 parseRecordHeader(in, _s.rh); 2249 if (!(_s.rh.recVer == 0)) { 2250 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2251 } 2252 if (!(_s.rh.recInstance == 0)) { 2253 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2254 } 2255 if (!(_s.rh.recType == 0x1772)) { 2256 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1772"); 2257 } 2258 qint64 _startPos = in.getPosition(); 2259 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 2260 _atend = in.getPosition() - _startPos >= _totalSize; 2261 while (!_atend) { 2262 _s.rgPersistDirEntry.append(PersistDirectoryEntry(&_s)); 2263 parsePersistDirectoryEntry(in, _s.rgPersistDirEntry.last()); 2264 _atend = in.getPosition() - _startPos >= _totalSize; 2265 } 2266 } 2267 void MSO::parseUnknownDocumentContainerChild(LEInputStream& in, UnknownDocumentContainerChild& _s) { 2268 _s.streamOffset = in.getPosition(); 2269 int _c; 2270 LEInputStream::Mark _m; 2271 parseRecordHeader(in, _s.rh); 2272 if (!(_s.rh.recType == 0x416 || _s.rh.recType == 0x41A || _s.rh.recType == 0x101A || _s.rh.recType == 0x1773 || _s.rh.recType == 0x1788 || _s.rh.recType == 0x178c || _s.rh.recType == 0x178d)) { 2273 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x416 || _s.rh.recType == 0x41A || _s.rh.recType == 0x101A || _s.rh.recType == 0x1773 || _s.rh.recType == 0x1788 || _s.rh.recType == 0x178c || _s.rh.recType == 0x178d"); 2274 } 2275 _c = _s.rh.recLen; 2276 _s.unknown.resize(_c); 2277 in.readBytes(_s.unknown); 2278 } 2279 void MSO::parseUnknownOfficeArtClientDataChild(LEInputStream& in, UnknownOfficeArtClientDataChild& _s) { 2280 _s.streamOffset = in.getPosition(); 2281 int _c; 2282 LEInputStream::Mark _m; 2283 parseRecordHeader(in, _s.rh); 2284 if (!(_s.rh.recVer == 0)) { 2285 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2286 } 2287 if (!(_s.rh.recInstance == 0)) { 2288 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2289 } 2290 if (!(_s.rh.recType == 0xFE8 || _s.rh.recType == 0x1019)) { 2291 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFE8 || _s.rh.recType == 0x1019"); 2292 } 2293 _c = _s.rh.recLen; 2294 _s.unknown.resize(_c); 2295 in.readBytes(_s.unknown); 2296 } 2297 void MSO::parseUnknownSlideContainerChild(LEInputStream& in, UnknownSlideContainerChild& _s) { 2298 _s.streamOffset = in.getPosition(); 2299 int _c; 2300 LEInputStream::Mark _m; 2301 parseRecordHeader(in, _s.rh); 2302 if (!(_s.rh.recVer == 0)) { 2303 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2304 } 2305 if (!(_s.rh.recInstance == 0)) { 2306 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2307 } 2308 if (!(_s.rh.recType == 0x101D)) { 2309 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x101D"); 2310 } 2311 _c = _s.rh.recLen; 2312 _s.unknown.resize(_c); 2313 in.readBytes(_s.unknown); 2314 } 2315 void MSO::parseUnknownTextContainerChild(LEInputStream& in, UnknownTextContainerChild& _s) { 2316 _s.streamOffset = in.getPosition(); 2317 int _c; 2318 LEInputStream::Mark _m; 2319 parseRecordHeader(in, _s.rh); 2320 if (!(_s.rh.recVer == 3)) { 2321 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 3"); 2322 } 2323 if (!(_s.rh.recInstance == 9)) { 2324 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 9"); 2325 } 2326 if (!(_s.rh.recType == 0)) { 2327 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0"); 2328 } 2329 _c = _s.rh.recLen; 2330 _s.unknown.resize(_c); 2331 in.readBytes(_s.unknown); 2332 } 2333 void MSO::parsePersistDirectoryEntry(LEInputStream& in, PersistDirectoryEntry& _s) { 2334 _s.streamOffset = in.getPosition(); 2335 int _c; 2336 LEInputStream::Mark _m; 2337 _s.persistId = in.readuint20(); 2338 _s.cPersist = in.readuint12(); 2339 _c = _s.cPersist; 2340 _s.rgPersistOffset.resize(_c); 2341 for (int _i=0; _i<_c; ++_i) { 2342 _s.rgPersistOffset[_i] = in.readuint32(); 2343 } 2344 } 2345 void MSO::parsePersistIdRef(LEInputStream& in, PersistIdRef& _s) { 2346 _s.streamOffset = in.getPosition(); 2347 _s.anon = in.readuint32(); 2348 } 2349 void MSO::parseSchemeListElementColorSchemeAtom(LEInputStream& in, SchemeListElementColorSchemeAtom& _s) { 2350 _s.streamOffset = in.getPosition(); 2351 int _c; 2352 LEInputStream::Mark _m; 2353 parseRecordHeader(in, _s.rh); 2354 if (!(_s.rh.recVer == 0)) { 2355 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2356 } 2357 if (!(_s.rh.recInstance == 6)) { 2358 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 6"); 2359 } 2360 if (!(_s.rh.recType == 0x7F0)) { 2361 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x7F0"); 2362 } 2363 if (!(_s.rh.recLen == 0x20)) { 2364 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x20"); 2365 } 2366 _c = 8; 2367 for (int _i=0; _i<_c; ++_i) { 2368 _s.rgSchemeColor.append(ColorStruct(&_s)); 2369 parseColorStruct(in, _s.rgSchemeColor[_i]); 2370 } 2371 } 2372 void MSO::parseRoundTripOArtTextStyles12Atom(LEInputStream& in, RoundTripOArtTextStyles12Atom& _s) { 2373 _s.streamOffset = in.getPosition(); 2374 int _c; 2375 LEInputStream::Mark _m; 2376 parseRecordHeader(in, _s.rh); 2377 if (!(_s.rh.recVer == 0)) { 2378 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2379 } 2380 if (!(_s.rh.recInstance == 0)) { 2381 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2382 } 2383 if (!(_s.rh.recType == 0x423)) { 2384 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x423"); 2385 } 2386 _c = _s.rh.recLen; 2387 _s.todo.resize(_c); 2388 in.readBytes(_s.todo); 2389 } 2390 void MSO::parseSlideNameAtom(LEInputStream& in, SlideNameAtom& _s) { 2391 _s.streamOffset = in.getPosition(); 2392 int _c; 2393 LEInputStream::Mark _m; 2394 parseRecordHeader(in, _s.rh); 2395 if (!(_s.rh.recVer == 0)) { 2396 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2397 } 2398 if (!(_s.rh.recInstance == 3)) { 2399 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 3"); 2400 } 2401 if (!(_s.rh.recType == 0x0FBA)) { 2402 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 2403 } 2404 if (!(_s.rh.recLen%2==0)) { 2405 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 2406 } 2407 _c = _s.rh.recLen/2; 2408 _s.slideName.resize(_c); 2409 for (int _i=0; _i<_c; ++_i) { 2410 _s.slideName[_i] = in.readuint16(); 2411 } 2412 } 2413 void MSO::parseSlideProgTagsContainer(LEInputStream& in, SlideProgTagsContainer& _s) { 2414 _s.streamOffset = in.getPosition(); 2415 LEInputStream::Mark _m; 2416 bool _atend; 2417 parseRecordHeader(in, _s.rh); 2418 if (!(_s.rh.recVer == 0xF)) { 2419 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 2420 } 2421 if (!(_s.rh.recInstance == 0)) { 2422 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2423 } 2424 if (!(_s.rh.recType == 0x1388)) { 2425 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1388"); 2426 } 2427 qint64 _startPos = in.getPosition(); 2428 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 2429 _atend = in.getPosition() - _startPos >= _totalSize; 2430 while (!_atend) { 2431 _s.rgTypeRec.append(SlideProgTagsSubContainerOrAtom(&_s)); 2432 parseSlideProgTagsSubContainerOrAtom(in, _s.rgTypeRec.last()); 2433 _atend = in.getPosition() - _startPos >= _totalSize; 2434 } 2435 } 2436 void MSO::parsePP9SlideBinaryTagExtension(LEInputStream& in, PP9SlideBinaryTagExtension& _s) { 2437 _s.streamOffset = in.getPosition(); 2438 int _c; 2439 LEInputStream::Mark _m; 2440 bool _atend; 2441 parseRecordHeader(in, _s.rh); 2442 if (!(_s.rh.recVer == 0)) { 2443 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2444 } 2445 if (!(_s.rh.recInstance == 0)) { 2446 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2447 } 2448 if (!(_s.rh.recType == 0xFBA)) { 2449 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 2450 } 2451 if (!(_s.rh.recLen == 0xE)) { 2452 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0xE"); 2453 } 2454 _c = 7; 2455 _s.tagName.resize(_c); 2456 for (int _i=0; _i<_c; ++_i) { 2457 _s.tagName[_i] = in.readuint16(); 2458 } 2459 parseRecordHeader(in, _s.rhData); 2460 if (!(_s.rhData.recVer == 0)) { 2461 throw IncorrectValueException(in.getPosition(), "_s.rhData.recVer == 0"); 2462 } 2463 if (!(_s.rhData.recInstance == 0)) { 2464 throw IncorrectValueException(in.getPosition(), "_s.rhData.recInstance == 0"); 2465 } 2466 if (!(_s.rhData.recType == 0x138B)) { 2467 throw IncorrectValueException(in.getPosition(), "_s.rhData.recType == 0x138B"); 2468 } 2469 _atend = false; 2470 while (!_atend) { 2471 _m = in.setMark(); 2472 try { 2473 _s.rgTextMasterStyleAtom.append(TextMasterStyle9Atom(&_s)); 2474 parseTextMasterStyle9Atom(in, _s.rgTextMasterStyleAtom.last()); 2475 } catch(IncorrectValueException _e) { 2476 _s.rgTextMasterStyleAtom.removeLast(); 2477 _atend = true; 2478 in.rewind(_m); 2479 } catch(EOFException _e) { 2480 _s.rgTextMasterStyleAtom.removeLast(); 2481 _atend = true; 2482 in.rewind(_m); 2483 } 2484 } 2485 } 2486 void MSO::parseComment10Container(LEInputStream& in, Comment10Container& _s) { 2487 _s.streamOffset = in.getPosition(); 2488 int _c; 2489 LEInputStream::Mark _m; 2490 parseRecordHeader(in, _s.rh); 2491 if (!(_s.rh.recVer == 0xF)) { 2492 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 2493 } 2494 if (!(_s.rh.recInstance == 0)) { 2495 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2496 } 2497 if (!(_s.rh.recType == 0x2EE0)) { 2498 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2EE0"); 2499 } 2500 _c = _s.rh.recLen; 2501 _s.todo.resize(_c); 2502 in.readBytes(_s.todo); 2503 } 2504 void MSO::parseComment10Atom(LEInputStream& in, Comment10Atom& _s) { 2505 _s.streamOffset = in.getPosition(); 2506 int _c; 2507 LEInputStream::Mark _m; 2508 parseRecordHeader(in, _s.rh); 2509 if (!(_s.rh.recVer == 0)) { 2510 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2511 } 2512 if (!(_s.rh.recInstance == 0)) { 2513 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2514 } 2515 if (!(_s.rh.recType == 0x2EE1)) { 2516 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2EE1"); 2517 } 2518 if (!(_s.rh.recLen == 0x1C)) { 2519 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x1C"); 2520 } 2521 _c = _s.rh.recLen; 2522 _s.todo.resize(_c); 2523 in.readBytes(_s.todo); 2524 } 2525 void MSO::parseLinkedSlide10Atom(LEInputStream& in, LinkedSlide10Atom& _s) { 2526 _s.streamOffset = in.getPosition(); 2527 parseRecordHeader(in, _s.rh); 2528 if (!(_s.rh.recVer == 0)) { 2529 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2530 } 2531 if (!(_s.rh.recInstance == 0)) { 2532 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2533 } 2534 if (!(_s.rh.recType == 0x2EE7)) { 2535 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2EE7"); 2536 } 2537 if (!(_s.rh.recLen == 8)) { 2538 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 2539 } 2540 _s.linkedSlideIdRef = in.readuint32(); 2541 _s.clinkedShapes = in.readint32(); 2542 } 2543 void MSO::parseLinkedShape10Atom(LEInputStream& in, LinkedShape10Atom& _s) { 2544 _s.streamOffset = in.getPosition(); 2545 parseRecordHeader(in, _s.rh); 2546 if (!(_s.rh.recVer == 0)) { 2547 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2548 } 2549 if (!(_s.rh.recInstance == 0)) { 2550 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2551 } 2552 if (!(_s.rh.recType == 0x2EE6)) { 2553 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2EE6"); 2554 } 2555 if (!(_s.rh.recLen == 8)) { 2556 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 2557 } 2558 _s.shapeIdRef = in.readuint32(); 2559 _s.linkedShapeIdRef = in.readuint32(); 2560 } 2561 void MSO::parseSlideFlags10Atom(LEInputStream& in, SlideFlags10Atom& _s) { 2562 _s.streamOffset = in.getPosition(); 2563 parseRecordHeader(in, _s.rh); 2564 if (!(_s.rh.recVer == 0)) { 2565 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2566 } 2567 if (!(_s.rh.recInstance == 0)) { 2568 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2569 } 2570 if (!(_s.rh.recType == 0x2EEA)) { 2571 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2EEA"); 2572 } 2573 if (!(_s.rh.recLen == 4)) { 2574 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 2575 } 2576 _s.fPreserveMaster = in.readbit(); 2577 _s.fOverrideMasterAnimatino = in.readbit(); 2578 _s.unuseda = in.readuint14(); 2579 _s.unusedb = in.readuint16(); 2580 } 2581 void MSO::parseHashCode10Atom(LEInputStream& in, HashCode10Atom& _s) { 2582 _s.streamOffset = in.getPosition(); 2583 parseRecordHeader(in, _s.rh); 2584 if (!(_s.rh.recVer == 0)) { 2585 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2586 } 2587 if (!(_s.rh.recInstance == 0)) { 2588 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2589 } 2590 if (!(_s.rh.recType == 0x2B00)) { 2591 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2B00"); 2592 } 2593 if (!(_s.rh.recLen == 4)) { 2594 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 2595 } 2596 _s.hash = in.readuint32(); 2597 } 2598 void MSO::parseExtTimeNodeContainer(LEInputStream& in, ExtTimeNodeContainer& _s) { 2599 _s.streamOffset = in.getPosition(); 2600 int _c; 2601 LEInputStream::Mark _m; 2602 parseRecordHeader(in, _s.rh); 2603 if (!(_s.rh.recVer == 0xF)) { 2604 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 2605 } 2606 if (!(_s.rh.recInstance == 1)) { 2607 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 1"); 2608 } 2609 if (!(_s.rh.recType == 0xF144)) { 2610 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF144"); 2611 } 2612 _c = _s.rh.recLen; 2613 _s.todo.resize(_c); 2614 in.readBytes(_s.todo); 2615 } 2616 void MSO::parseBuildListContainer(LEInputStream& in, BuildListContainer& _s) { 2617 _s.streamOffset = in.getPosition(); 2618 int _c; 2619 LEInputStream::Mark _m; 2620 parseRecordHeader(in, _s.rh); 2621 if (!(_s.rh.recVer == 0xF)) { 2622 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 2623 } 2624 if (!(_s.rh.recInstance == 0)) { 2625 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2626 } 2627 if (!(_s.rh.recType == 0x2B02)) { 2628 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x2B02"); 2629 } 2630 _c = _s.rh.recLen; 2631 _s.todo.resize(_c); 2632 in.readBytes(_s.todo); 2633 } 2634 void MSO::parseRoundTripHeaderFooterDefaults12Atom(LEInputStream& in, RoundTripHeaderFooterDefaults12Atom& _s) { 2635 _s.streamOffset = in.getPosition(); 2636 parseRecordHeader(in, _s.rh); 2637 if (!(_s.rh.recVer == 0)) { 2638 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2639 } 2640 if (!(_s.rh.recInstance == 0)) { 2641 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2642 } 2643 if (!(_s.rh.recType == 0x0424)) { 2644 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0424"); 2645 } 2646 if (!(_s.rh.recLen == 1)) { 2647 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 1"); 2648 } 2649 _s.fIncludeDate = in.readbit(); 2650 _s.fIncludeFooter = in.readbit(); 2651 _s.fIncludeHeader = in.readbit(); 2652 _s.fIncludeSlideNumber = in.readbit(); 2653 _s.reserved = in.readuint4(); 2654 } 2655 void MSO::parseTagNameAtom(LEInputStream& in, TagNameAtom& _s) { 2656 _s.streamOffset = in.getPosition(); 2657 int _c; 2658 LEInputStream::Mark _m; 2659 parseRecordHeader(in, _s.rh); 2660 if (!(_s.rh.recVer == 0)) { 2661 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2662 } 2663 if (!(_s.rh.recInstance == 0)) { 2664 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2665 } 2666 if (!(_s.rh.recType == 0xFBA)) { 2667 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 2668 } 2669 if (!(_s.rh.recLen%2 == 0 )) { 2670 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2 == 0 "); 2671 } 2672 _c = _s.rh.recLen/2; 2673 _s.tagName.resize(_c); 2674 for (int _i=0; _i<_c; ++_i) { 2675 _s.tagName[_i] = in.readuint16(); 2676 } 2677 } 2678 void MSO::parseTagValueAtom(LEInputStream& in, TagValueAtom& _s) { 2679 _s.streamOffset = in.getPosition(); 2680 int _c; 2681 LEInputStream::Mark _m; 2682 parseRecordHeader(in, _s.rh); 2683 if (!(_s.rh.recVer == 0)) { 2684 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2685 } 2686 if (!(_s.rh.recInstance == 1)) { 2687 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 1"); 2688 } 2689 if (!(_s.rh.recType == 0xFBA)) { 2690 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 2691 } 2692 _c = _s.rh.recLen/2; 2693 _s.tagValue.resize(_c); 2694 for (int _i=0; _i<_c; ++_i) { 2695 _s.tagValue[_i] = in.readuint16(); 2696 } 2697 } 2698 void MSO::parseRoundTripMainMasterRecord(LEInputStream& in, RoundTripMainMasterRecord& _s) { 2699 _s.streamOffset = in.getPosition(); 2700 int _c; 2701 LEInputStream::Mark _m; 2702 parseRecordHeader(in, _s.rh); 2703 if (!(_s.rh.recType == 0x41C || _s.rh.recType == 0x40E || _s.rh.recType == 0x040F || _s.rh.recType == 0x41E || _s.rh.recType == 0x0423 || _s.rh.recType == 0x2B0D || _s.rh.recType == 0x2B0B || _s.rh.recType == 0x041D || _s.rh.recType == 0x2B0C || _s.rh.recType == 0x101D)) { 2704 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x41C || _s.rh.recType == 0x40E || _s.rh.recType == 0x040F || _s.rh.recType == 0x41E || _s.rh.recType == 0x0423 || _s.rh.recType == 0x2B0D || _s.rh.recType == 0x2B0B || _s.rh.recType == 0x041D || _s.rh.recType == 0x2B0C || _s.rh.recType == 0x101D"); 2705 } 2706 _c = _s.rh.recLen; 2707 _s.todo.resize(_c); 2708 in.readBytes(_s.todo); 2709 } 2710 void MSO::parseTemplateNameAtom(LEInputStream& in, TemplateNameAtom& _s) { 2711 _s.streamOffset = in.getPosition(); 2712 int _c; 2713 LEInputStream::Mark _m; 2714 parseRecordHeader(in, _s.rh); 2715 if (!(_s.rh.recVer == 0)) { 2716 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2717 } 2718 if (!(_s.rh.recInstance == 2)) { 2719 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 2"); 2720 } 2721 if (!(_s.rh.recType == 0x0FBA)) { 2722 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 2723 } 2724 if (!(_s.rh.recLen%2==0)) { 2725 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 2726 } 2727 _c = _s.rh.recLen/2; 2728 _s.templateName.resize(_c); 2729 for (int _i=0; _i<_c; ++_i) { 2730 _s.templateName[_i] = in.readuint16(); 2731 } 2732 } 2733 void MSO::parseRoundTripSlideSyncInfo12Container(LEInputStream& in, RoundTripSlideSyncInfo12Container& _s) { 2734 _s.streamOffset = in.getPosition(); 2735 int _c; 2736 LEInputStream::Mark _m; 2737 parseRecordHeader(in, _s.rh); 2738 if (!(_s.rh.recVer == 0xF)) { 2739 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 2740 } 2741 if (!(_s.rh.recInstance == 0)) { 2742 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2743 } 2744 if (!(_s.rh.recType == 0x3714)) { 2745 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x3714"); 2746 } 2747 _c = _s.rh.recLen; 2748 _s.todo.resize(_c); 2749 in.readBytes(_s.todo); 2750 } 2751 void MSO::parseSlideFlags(LEInputStream& in, SlideFlags& _s) { 2752 _s.streamOffset = in.getPosition(); 2753 _s.fMasterObjects = in.readbit(); 2754 _s.fMasterScheme = in.readbit(); 2755 _s.fMasterBackground = in.readbit(); 2756 _s.unused1 = in.readuint5(); 2757 _s.unused2 = in.readuint8(); 2758 } 2759 void MSO::parseNotesRoundTripAtom(LEInputStream& in, NotesRoundTripAtom& _s) { 2760 _s.streamOffset = in.getPosition(); 2761 int _c; 2762 LEInputStream::Mark _m; 2763 parseRecordHeader(in, _s.rh); 2764 if (!(_s.rh.recVer == 0)) { 2765 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2766 } 2767 if (!(_s.rh.recInstance == 0)) { 2768 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2769 } 2770 if (!(_s.rh.recType == 0x40E || _s.rh.recType == 0x40F || _s.rh.recType == 0x427)) { 2771 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x40E || _s.rh.recType == 0x40F || _s.rh.recType == 0x427"); 2772 } 2773 _c = _s.rh.recLen; 2774 _s.todo.resize(_c); 2775 in.readBytes(_s.todo); 2776 } 2777 void MSO::parseHandoutContainer(LEInputStream& in, HandoutContainer& _s) { 2778 _s.streamOffset = in.getPosition(); 2779 int _c; 2780 LEInputStream::Mark _m; 2781 parseRecordHeader(in, _s.rh); 2782 if (!(_s.rh.recVer == 0xF)) { 2783 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 2784 } 2785 if (!(_s.rh.recInstance == 0)) { 2786 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2787 } 2788 if (!(_s.rh.recType == 0x0FC9)) { 2789 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FC9"); 2790 } 2791 _c = _s.rh.recLen; 2792 _s.todo.resize(_c); 2793 in.readBytes(_s.todo); 2794 } 2795 void MSO::parseExControlStg(LEInputStream& in, ExControlStg& _s) { 2796 _s.streamOffset = in.getPosition(); 2797 int _c; 2798 LEInputStream::Mark _m; 2799 parseRecordHeader(in, _s.rh); 2800 if (!(_s.rh.recVer == 0)) { 2801 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2802 } 2803 if (!(_s.rh.recInstance == 0 || _s.rh.recInstance == 1)) { 2804 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0 || _s.rh.recInstance == 1"); 2805 } 2806 if (!(_s.rh.recType == 0x1011)) { 2807 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1011"); 2808 } 2809 _c = _s.rh.recLen; 2810 _s.todo.resize(_c); 2811 in.readBytes(_s.todo); 2812 } 2813 void MSO::parseExOleObjStg(LEInputStream& in, ExOleObjStg& _s) { 2814 _s.streamOffset = in.getPosition(); 2815 int _c; 2816 LEInputStream::Mark _m; 2817 parseRecordHeader(in, _s.rh); 2818 if (!(_s.rh.recVer == 0)) { 2819 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2820 } 2821 if (!(_s.rh.recInstance == 0)) { 2822 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2823 } 2824 if (!(_s.rh.recType == 0x1011)) { 2825 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1011"); 2826 } 2827 _c = _s.rh.recLen; 2828 _s.todo.resize(_c); 2829 in.readBytes(_s.todo); 2830 } 2831 void MSO::parseUserEditAtom(LEInputStream& in, UserEditAtom& _s) { 2832 _s.streamOffset = in.getPosition(); 2833 LEInputStream::Mark _m; 2834 bool _atend; 2835 parseRecordHeader(in, _s.rh); 2836 if (!(_s.rh.recVer == 0)) { 2837 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2838 } 2839 if (!(_s.rh.recInstance == 0)) { 2840 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2841 } 2842 if (!(_s.rh.recType == 0x0FF5)) { 2843 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FF5"); 2844 } 2845 if (!(_s.rh.recLen == 0x1C || _s.rh.recLen == 0x20)) { 2846 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x1C || _s.rh.recLen == 0x20"); 2847 } 2848 _s.lastSlideIdRef = in.readuint32(); 2849 _s.version = in.readuint16(); 2850 _s.minorVersion = in.readuint8(); 2851 if (!(((quint8)_s.minorVersion) == 0)) { 2852 throw IncorrectValueException(in.getPosition(), "((quint8)_s.minorVersion) == 0"); 2853 } 2854 _s.majorVersion = in.readuint8(); 2855 if (!(((quint8)_s.majorVersion) == 3)) { 2856 throw IncorrectValueException(in.getPosition(), "((quint8)_s.majorVersion) == 3"); 2857 } 2858 _s.offsetLastEdit = in.readuint32(); 2859 _s.offsetPersistDirectory = in.readuint32(); 2860 _s.docPersistIdRef = in.readuint32(); 2861 if (!(((quint32)_s.docPersistIdRef) == 1)) { 2862 throw IncorrectValueException(in.getPosition(), "((quint32)_s.docPersistIdRef) == 1"); 2863 } 2864 _s.persistIdSeed = in.readuint32(); 2865 _s.lastView = in.readuint16(); 2866 if (!(((quint16)_s.lastView)<=18)) { 2867 throw IncorrectValueException(in.getPosition(), "((quint16)_s.lastView)<=18"); 2868 } 2869 _s.unused = in.readuint16(); 2870 _s._has_encryptSessionPersistIdRef = _s.rh.recLen==32; 2871 if (_s._has_encryptSessionPersistIdRef) { 2872 _s.encryptSessionPersistIdRef = in.readuint32(); 2873 } 2874 _atend = false; 2875 while (!_atend) { 2876 _m = in.setMark(); 2877 try { 2878 _s.zeroPadding.append(ZeroByte(&_s)); 2879 parseZeroByte(in, _s.zeroPadding.last()); 2880 } catch(IncorrectValueException _e) { 2881 _s.zeroPadding.removeLast(); 2882 _atend = true; 2883 in.rewind(_m); 2884 } catch(EOFException _e) { 2885 _s.zeroPadding.removeLast(); 2886 _atend = true; 2887 in.rewind(_m); 2888 } 2889 } 2890 } 2891 void MSO::parseVbaProjectStg(LEInputStream& in, VbaProjectStg& _s) { 2892 _s.streamOffset = in.getPosition(); 2893 int _c; 2894 LEInputStream::Mark _m; 2895 parseRecordHeader(in, _s.rh); 2896 if (!(_s.rh.recVer == 0)) { 2897 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2898 } 2899 if (!(_s.rh.recInstance == 0 || _s.rh.recInstance == 1)) { 2900 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0 || _s.rh.recInstance == 1"); 2901 } 2902 if (!(_s.rh.recType == 0x1011)) { 2903 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1011"); 2904 } 2905 _c = _s.rh.recLen; 2906 _s.todo.resize(_c); 2907 in.readBytes(_s.todo); 2908 } 2909 void MSO::parseSlideAtom(LEInputStream& in, SlideAtom& _s) { 2910 _s.streamOffset = in.getPosition(); 2911 int _c; 2912 LEInputStream::Mark _m; 2913 parseRecordHeader(in, _s.rh); 2914 if (!(_s.rh.recVer == 0x2)) { 2915 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x2"); 2916 } 2917 if (!(_s.rh.recInstance == 0x0)) { 2918 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 2919 } 2920 if (!(_s.rh.recType == 0x03EF)) { 2921 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x03EF"); 2922 } 2923 if (!(_s.rh.recLen == 0x18)) { 2924 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x18"); 2925 } 2926 _s.geom = in.readuint32(); 2927 _c = 8; 2928 _s.rgPlaceholderTypes.resize(_c); 2929 in.readBytes(_s.rgPlaceholderTypes); 2930 _s.masterIdRef = in.readuint32(); 2931 _s.notesIdRef = in.readuint32(); 2932 parseSlideFlags(in, _s.slideFlags); 2933 _s.unused = in.readuint16(); 2934 } 2935 void MSO::parseSlideShowSlideInfoAtom(LEInputStream& in, SlideShowSlideInfoAtom& _s) { 2936 _s.streamOffset = in.getPosition(); 2937 int _c; 2938 LEInputStream::Mark _m; 2939 parseRecordHeader(in, _s.rh); 2940 if (!(_s.rh.recVer == 0)) { 2941 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 2942 } 2943 if (!(_s.rh.recInstance == 0)) { 2944 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2945 } 2946 if (!(_s.rh.recType == 0x03F9)) { 2947 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x03F9"); 2948 } 2949 if (!(_s.rh.recLen == 0x10)) { 2950 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x10"); 2951 } 2952 _s.slidetime = in.readuint32(); 2953 _s.slideIdRef = in.readuint32(); 2954 _s.effectDirection = in.readuint8(); 2955 _s.effectType = in.readuint8(); 2956 _s.fManualAdvance = in.readbit(); 2957 _s.reserved = in.readbit(); 2958 _s.fHidden = in.readbit(); 2959 _s.reserved2 = in.readbit(); 2960 _s.fSound = in.readbit(); 2961 _s.reserved3 = in.readbit(); 2962 _s.fLoopSound = in.readbit(); 2963 _s.reserved4 = in.readbit(); 2964 _s.fStopSound = in.readbit(); 2965 _s.freserved5 = in.readbit(); 2966 _s.fAutoAdvance = in.readbit(); 2967 _s.reserved6 = in.readbit(); 2968 _s.fCursorVisible = in.readbit(); 2969 _s.reserved7 = in.readuint3(); 2970 _s.speed = in.readuint8(); 2971 _c = 3; 2972 _s.unused.resize(_c); 2973 in.readBytes(_s.unused); 2974 } 2975 void MSO::parseSlideShowDocInfoAtom(LEInputStream& in, SlideShowDocInfoAtom& _s) { 2976 _s.streamOffset = in.getPosition(); 2977 int _c; 2978 LEInputStream::Mark _m; 2979 parseRecordHeader(in, _s.rh); 2980 if (!(_s.rh.recVer == 1)) { 2981 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 1"); 2982 } 2983 if (!(_s.rh.recInstance == 0)) { 2984 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 2985 } 2986 if (!(_s.rh.recType == 0x0401)) { 2987 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0401"); 2988 } 2989 if (!(_s.rh.recLen == 0x50)) { 2990 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x50"); 2991 } 2992 parseColorIndexStruct(in, _s.penColor); 2993 _s.restartTime = in.readint32(); 2994 _s.startSlide = in.readint16(); 2995 if (!(((qint16)_s.startSlide)>=0)) { 2996 throw IncorrectValueException(in.getPosition(), "((qint16)_s.startSlide)>=0"); 2997 } 2998 _s.endSlide = in.readint16(); 2999 if (!(((qint16)_s.endSlide)>=0)) { 3000 throw IncorrectValueException(in.getPosition(), "((qint16)_s.endSlide)>=0"); 3001 } 3002 _c = 64; 3003 _s.namedShow.resize(_c); 3004 in.readBytes(_s.namedShow); 3005 _s.fAutoAdvance = in.readbit(); 3006 _s.fWillSkipBuilds = in.readbit(); 3007 _s.fUseSlideRange = in.readbit(); 3008 _s.fDocUseNamedShow = in.readbit(); 3009 _s.fShowBrowseMode = in.readbit(); 3010 _s.fKioskMode = in.readbit(); 3011 _s.fWillSkipNarration = in.readbit(); 3012 _s.fLoopContinuously = in.readbit(); 3013 _s.fHideScrollBar = in.readbit(); 3014 _s.reserved = in.readuint7(); 3015 _s.unused = in.readuint16(); 3016 } 3017 void MSO::parseSlideSchemeColorSchemeAtom(LEInputStream& in, SlideSchemeColorSchemeAtom& _s) { 3018 _s.streamOffset = in.getPosition(); 3019 int _c; 3020 LEInputStream::Mark _m; 3021 parseRecordHeader(in, _s.rh); 3022 if (!(_s.rh.recVer == 0)) { 3023 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3024 } 3025 if (!(_s.rh.recInstance == 1)) { 3026 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 1"); 3027 } 3028 if (!(_s.rh.recType == 0x07F0)) { 3029 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x07F0"); 3030 } 3031 if (!(_s.rh.recLen == 0x20)) { 3032 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x20"); 3033 } 3034 _c = 8; 3035 for (int _i=0; _i<_c; ++_i) { 3036 _s.rgSchemeColor.append(ColorStruct(&_s)); 3037 parseColorStruct(in, _s.rgSchemeColor[_i]); 3038 } 3039 } 3040 void MSO::parseRoundTripSlideRecord(LEInputStream& in, RoundTripSlideRecord& _s) { 3041 _s.streamOffset = in.getPosition(); 3042 int _c; 3043 LEInputStream::Mark _m; 3044 parseRecordHeader(in, _s.rh); 3045 if (!(_s.rh.recType == 0x40E || _s.rh.recType == 0x40F || _s.rh.recType == 0x41D || _s.rh.recType == 0x3714 || _s.rh.recType == 0x2B0D || _s.rh.recType == 0x2B0B || _s.rh.recType == 0x2B0C || _s.rh.recType == 0x422)) { 3046 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x40E || _s.rh.recType == 0x40F || _s.rh.recType == 0x41D || _s.rh.recType == 0x3714 || _s.rh.recType == 0x2B0D || _s.rh.recType == 0x2B0B || _s.rh.recType == 0x2B0C || _s.rh.recType == 0x422"); 3047 } 3048 _c = _s.rh.recLen; 3049 _s.todo.resize(_c); 3050 in.readBytes(_s.todo); 3051 } 3052 void MSO::parseNamedShowsContainer(LEInputStream& in, NamedShowsContainer& _s) { 3053 _s.streamOffset = in.getPosition(); 3054 int _c; 3055 LEInputStream::Mark _m; 3056 parseRecordHeader(in, _s.rh); 3057 if (!(_s.rh.recVer == 0xF)) { 3058 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3059 } 3060 if (!(_s.rh.recInstance == 0)) { 3061 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3062 } 3063 if (!(_s.rh.recType == 0x410)) { 3064 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x410"); 3065 } 3066 _c = _s.rh.recLen; 3067 _s.todo.resize(_c); 3068 in.readBytes(_s.todo); 3069 } 3070 void MSO::parseSummaryContainer(LEInputStream& in, SummaryContainer& _s) { 3071 _s.streamOffset = in.getPosition(); 3072 int _c; 3073 LEInputStream::Mark _m; 3074 parseRecordHeader(in, _s.rh); 3075 if (!(_s.rh.recVer == 0xF)) { 3076 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3077 } 3078 if (!(_s.rh.recInstance == 0)) { 3079 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3080 } 3081 if (!(_s.rh.recType == 0x402)) { 3082 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x402"); 3083 } 3084 _c = _s.rh.recLen; 3085 _s.todo.resize(_c); 3086 in.readBytes(_s.todo); 3087 } 3088 void MSO::parseDocRoutingSlipAtom(LEInputStream& in, DocRoutingSlipAtom& _s) { 3089 _s.streamOffset = in.getPosition(); 3090 int _c; 3091 LEInputStream::Mark _m; 3092 parseRecordHeader(in, _s.rh); 3093 if (!(_s.rh.recVer == 0)) { 3094 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3095 } 3096 if (!(_s.rh.recInstance == 0)) { 3097 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3098 } 3099 if (!(_s.rh.recType == 0x406)) { 3100 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x406"); 3101 } 3102 _c = _s.rh.recLen; 3103 _s.todo.resize(_c); 3104 in.readBytes(_s.todo); 3105 } 3106 void MSO::parsePrintOptionsAtom(LEInputStream& in, PrintOptionsAtom& _s) { 3107 _s.streamOffset = in.getPosition(); 3108 int _c; 3109 LEInputStream::Mark _m; 3110 parseRecordHeader(in, _s.rh); 3111 if (!(_s.rh.recVer == 0)) { 3112 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3113 } 3114 if (!(_s.rh.recInstance == 0)) { 3115 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3116 } 3117 if (!(_s.rh.recType == 0x1770)) { 3118 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1770"); 3119 } 3120 if (!(_s.rh.recLen == 5)) { 3121 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 5"); 3122 } 3123 _c = _s.rh.recLen; 3124 _s.todo.resize(_c); 3125 in.readBytes(_s.todo); 3126 } 3127 void MSO::parseRoundTripCustomTableStyles12Atom(LEInputStream& in, RoundTripCustomTableStyles12Atom& _s) { 3128 _s.streamOffset = in.getPosition(); 3129 int _c; 3130 LEInputStream::Mark _m; 3131 parseRecordHeader(in, _s.rh); 3132 if (!(_s.rh.recVer == 0 || _s.rh.recVer == 0xF)) { 3133 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0 || _s.rh.recVer == 0xF"); 3134 } 3135 if (!(_s.rh.recInstance == 0)) { 3136 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3137 } 3138 if (!(_s.rh.recType == 0x428)) { 3139 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x428"); 3140 } 3141 _c = _s.rh.recLen; 3142 _s.todo.resize(_c); 3143 in.readBytes(_s.todo); 3144 } 3145 void MSO::parseRoundTripCompositeMasterId12Atom(LEInputStream& in, RoundTripCompositeMasterId12Atom& _s) { 3146 _s.streamOffset = in.getPosition(); 3147 parseRecordHeader(in, _s.rh); 3148 if (!(_s.rh.recVer == 0)) { 3149 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3150 } 3151 if (!(_s.rh.recInstance == 0)) { 3152 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3153 } 3154 if (!(_s.rh.recType == 0x41D)) { 3155 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x41D"); 3156 } 3157 if (!(_s.rh.recLen == 4)) { 3158 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 3159 } 3160 _s.compositeMasterId = in.readuint32(); 3161 } 3162 void MSO::parseColorStruct(LEInputStream& in, ColorStruct& _s) { 3163 _s.streamOffset = in.getPosition(); 3164 _s.red = in.readuint8(); 3165 _s.green = in.readuint8(); 3166 _s.blue = in.readuint8(); 3167 _s.unused = in.readuint8(); 3168 } 3169 void MSO::parseExObjListAtom(LEInputStream& in, ExObjListAtom& _s) { 3170 _s.streamOffset = in.getPosition(); 3171 parseRecordHeader(in, _s.rh); 3172 if (!(_s.rh.recVer == 0x0)) { 3173 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 3174 } 3175 if (!(_s.rh.recInstance == 0x0)) { 3176 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 3177 } 3178 if (!(_s.rh.recType == 0x040A)) { 3179 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x040A"); 3180 } 3181 if (!(_s.rh.recLen == 4)) { 3182 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 3183 } 3184 _s.exObjIdSeed = in.readint32(); 3185 if (!(((qint32)_s.exObjIdSeed)>=1)) { 3186 throw IncorrectValueException(in.getPosition(), "((qint32)_s.exObjIdSeed)>=1"); 3187 } 3188 } 3189 void MSO::parseExAviMovieContainer(LEInputStream& in, ExAviMovieContainer& _s) { 3190 _s.streamOffset = in.getPosition(); 3191 int _c; 3192 LEInputStream::Mark _m; 3193 parseOfficeArtRecordHeader(in, _s.rh); 3194 if (!(_s.rh.recVer == 0xF)) { 3195 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3196 } 3197 if (!(_s.rh.recInstance == 0)) { 3198 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3199 } 3200 if (!(_s.rh.recType == 0x1006)) { 3201 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1006"); 3202 } 3203 _c = _s.rh.recLen; 3204 _s.todo.resize(_c); 3205 in.readBytes(_s.todo); 3206 } 3207 void MSO::parseExCDAudioContainer(LEInputStream& in, ExCDAudioContainer& _s) { 3208 _s.streamOffset = in.getPosition(); 3209 int _c; 3210 LEInputStream::Mark _m; 3211 parseOfficeArtRecordHeader(in, _s.rh); 3212 if (!(_s.rh.recVer == 0xF)) { 3213 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3214 } 3215 if (!(_s.rh.recInstance == 0)) { 3216 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3217 } 3218 if (!(_s.rh.recType == 0x100E)) { 3219 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x100E"); 3220 } 3221 _c = _s.rh.recLen; 3222 _s.todo.resize(_c); 3223 in.readBytes(_s.todo); 3224 } 3225 void MSO::parseExControlAtom(LEInputStream& in, ExControlAtom& _s) { 3226 _s.streamOffset = in.getPosition(); 3227 parseOfficeArtRecordHeader(in, _s.rh); 3228 if (!(_s.rh.recVer == 0)) { 3229 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3230 } 3231 if (!(_s.rh.recInstance == 0)) { 3232 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3233 } 3234 if (!(_s.rh.recType == 0xFFB)) { 3235 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFFB"); 3236 } 3237 if (!(_s.rh.recLen == 4)) { 3238 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 3239 } 3240 _s.slideIdRef = in.readuint32(); 3241 } 3242 void MSO::parseExHyperlinkAtom(LEInputStream& in, ExHyperlinkAtom& _s) { 3243 _s.streamOffset = in.getPosition(); 3244 parseOfficeArtRecordHeader(in, _s.rh); 3245 if (!(_s.rh.recVer == 0)) { 3246 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3247 } 3248 if (!(_s.rh.recInstance == 0)) { 3249 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3250 } 3251 if (!(_s.rh.recType == 0xFD3)) { 3252 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFD3"); 3253 } 3254 if (!(_s.rh.recLen == 4)) { 3255 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 4"); 3256 } 3257 _s.exHyperLinkId = in.readuint32(); 3258 } 3259 void MSO::parseFriendlyNameAtom(LEInputStream& in, FriendlyNameAtom& _s) { 3260 _s.streamOffset = in.getPosition(); 3261 int _c; 3262 LEInputStream::Mark _m; 3263 parseOfficeArtRecordHeader(in, _s.rh); 3264 if (!(_s.rh.recVer == 0)) { 3265 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3266 } 3267 if (!(_s.rh.recInstance == 0)) { 3268 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3269 } 3270 if (!(_s.rh.recType == 0xFBA)) { 3271 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 3272 } 3273 if (!(_s.rh.recLen%2==0)) { 3274 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 3275 } 3276 _c = _s.rh.recLen/2; 3277 _s.friendlyName.resize(_c); 3278 for (int _i=0; _i<_c; ++_i) { 3279 _s.friendlyName[_i] = in.readuint16(); 3280 } 3281 } 3282 void MSO::parseTargetAtom(LEInputStream& in, TargetAtom& _s) { 3283 _s.streamOffset = in.getPosition(); 3284 int _c; 3285 LEInputStream::Mark _m; 3286 parseOfficeArtRecordHeader(in, _s.rh); 3287 if (!(_s.rh.recVer == 0)) { 3288 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3289 } 3290 if (!(_s.rh.recInstance == 1)) { 3291 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 1"); 3292 } 3293 if (!(_s.rh.recType == 0xFBA)) { 3294 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 3295 } 3296 if (!(_s.rh.recLen%2==0)) { 3297 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 3298 } 3299 _c = _s.rh.recLen/2; 3300 _s.target.resize(_c); 3301 for (int _i=0; _i<_c; ++_i) { 3302 _s.target[_i] = in.readuint16(); 3303 } 3304 } 3305 void MSO::parseLocationAtom(LEInputStream& in, LocationAtom& _s) { 3306 _s.streamOffset = in.getPosition(); 3307 int _c; 3308 LEInputStream::Mark _m; 3309 parseOfficeArtRecordHeader(in, _s.rh); 3310 if (!(_s.rh.recVer == 0)) { 3311 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3312 } 3313 if (!(_s.rh.recInstance == 3)) { 3314 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 3"); 3315 } 3316 if (!(_s.rh.recType == 0xFBA)) { 3317 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFBA"); 3318 } 3319 if (!(_s.rh.recLen%2==0)) { 3320 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2==0"); 3321 } 3322 _c = _s.rh.recLen/2; 3323 _s.location.resize(_c); 3324 for (int _i=0; _i<_c; ++_i) { 3325 _s.location[_i] = in.readuint16(); 3326 } 3327 } 3328 void MSO::parseExMCIMovieContainer(LEInputStream& in, ExMCIMovieContainer& _s) { 3329 _s.streamOffset = in.getPosition(); 3330 int _c; 3331 LEInputStream::Mark _m; 3332 parseOfficeArtRecordHeader(in, _s.rh); 3333 if (!(_s.rh.recVer == 0xF)) { 3334 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3335 } 3336 if (!(_s.rh.recInstance == 0)) { 3337 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3338 } 3339 if (!(_s.rh.recType == 0x1007)) { 3340 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1007"); 3341 } 3342 _c = _s.rh.recLen; 3343 _s.todo.resize(_c); 3344 in.readBytes(_s.todo); 3345 } 3346 void MSO::parseExMIDIAudioContainer(LEInputStream& in, ExMIDIAudioContainer& _s) { 3347 _s.streamOffset = in.getPosition(); 3348 int _c; 3349 LEInputStream::Mark _m; 3350 parseOfficeArtRecordHeader(in, _s.rh); 3351 if (!(_s.rh.recVer == 0xF)) { 3352 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3353 } 3354 if (!(_s.rh.recInstance == 0)) { 3355 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3356 } 3357 if (!(_s.rh.recType == 0x100D)) { 3358 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x100D"); 3359 } 3360 _c = _s.rh.recLen; 3361 _s.todo.resize(_c); 3362 in.readBytes(_s.todo); 3363 } 3364 void MSO::parseExWAVAudioEmbeddedContainer(LEInputStream& in, ExWAVAudioEmbeddedContainer& _s) { 3365 _s.streamOffset = in.getPosition(); 3366 int _c; 3367 LEInputStream::Mark _m; 3368 parseOfficeArtRecordHeader(in, _s.rh); 3369 if (!(_s.rh.recVer == 0xF)) { 3370 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3371 } 3372 if (!(_s.rh.recInstance == 0)) { 3373 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3374 } 3375 if (!(_s.rh.recType == 0x100F)) { 3376 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x100F"); 3377 } 3378 _c = _s.rh.recLen; 3379 _s.todo.resize(_c); 3380 in.readBytes(_s.todo); 3381 } 3382 void MSO::parseExWAVAudioLinkContainer(LEInputStream& in, ExWAVAudioLinkContainer& _s) { 3383 _s.streamOffset = in.getPosition(); 3384 int _c; 3385 LEInputStream::Mark _m; 3386 parseOfficeArtRecordHeader(in, _s.rh); 3387 if (!(_s.rh.recVer == 0xF)) { 3388 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3389 } 3390 if (!(_s.rh.recInstance == 0)) { 3391 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3392 } 3393 if (!(_s.rh.recType == 0x1010)) { 3394 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x1010"); 3395 } 3396 _c = _s.rh.recLen; 3397 _s.todo.resize(_c); 3398 in.readBytes(_s.todo); 3399 } 3400 void MSO::parseUnknownExObjListSubContainerChild(LEInputStream& in, UnknownExObjListSubContainerChild& _s) { 3401 _s.streamOffset = in.getPosition(); 3402 int _c; 3403 LEInputStream::Mark _m; 3404 parseOfficeArtRecordHeader(in, _s.rh); 3405 if (!(_s.rh.recVer == 0xF)) { 3406 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3407 } 3408 if (!(_s.rh.recInstance == 0)) { 3409 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3410 } 3411 if (!(_s.rh.recType == 0xFEA)) { 3412 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xFEA"); 3413 } 3414 _c = _s.rh.recLen; 3415 _s.todo.resize(_c); 3416 in.readBytes(_s.todo); 3417 } 3418 void MSO::parseExOleLinkAtom(LEInputStream& in, ExOleLinkAtom& _s) { 3419 _s.streamOffset = in.getPosition(); 3420 parseRecordHeader(in, _s.rh); 3421 if (!(_s.rh.recVer == 0x0)) { 3422 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 3423 } 3424 if (!(_s.rh.recInstance == 0x0)) { 3425 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 3426 } 3427 if (!(_s.rh.recType == 0x0FD1)) { 3428 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FD1"); 3429 } 3430 if (!(_s.rh.recLen == 0xC)) { 3431 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0xC"); 3432 } 3433 _s.slideIdRef = in.readuint32(); 3434 _s.oleUpdateMode = in.readuint32(); 3435 _s.unused = in.readuint32(); 3436 } 3437 void MSO::parseExOleObjAtom(LEInputStream& in, ExOleObjAtom& _s) { 3438 _s.streamOffset = in.getPosition(); 3439 parseRecordHeader(in, _s.rh); 3440 if (!(_s.rh.recVer == 0x1)) { 3441 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x1"); 3442 } 3443 if (!(_s.rh.recInstance == 0x0)) { 3444 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 3445 } 3446 if (!(_s.rh.recType == 0x0FC3)) { 3447 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FC3"); 3448 } 3449 if (!(_s.rh.recLen == 0x18)) { 3450 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x18"); 3451 } 3452 _s.drawAspect = in.readuint32(); 3453 _s.type = in.readuint32(); 3454 _s.exObjId = in.readuint32(); 3455 _s.subType = in.readuint32(); 3456 _s.persistIdRef = in.readuint32(); 3457 _s.unused = in.readuint32(); 3458 } 3459 void MSO::parseMenuNameAtom(LEInputStream& in, MenuNameAtom& _s) { 3460 _s.streamOffset = in.getPosition(); 3461 int _c; 3462 LEInputStream::Mark _m; 3463 parseRecordHeader(in, _s.rh); 3464 if (!(_s.rh.recVer == 0x0)) { 3465 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 3466 } 3467 if (!(_s.rh.recInstance == 0x1)) { 3468 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x1"); 3469 } 3470 if (!(_s.rh.recType == 0x0FBA)) { 3471 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 3472 } 3473 if (!(_s.rh.recLen%2 == 0 )) { 3474 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2 == 0 "); 3475 } 3476 _c = _s.rh.recLen; 3477 _s.menuName.resize(_c); 3478 in.readBytes(_s.menuName); 3479 } 3480 void MSO::parseProgIDAtom(LEInputStream& in, ProgIDAtom& _s) { 3481 _s.streamOffset = in.getPosition(); 3482 int _c; 3483 LEInputStream::Mark _m; 3484 parseRecordHeader(in, _s.rh); 3485 if (!(_s.rh.recVer == 0x0)) { 3486 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 3487 } 3488 if (!(_s.rh.recInstance == 0x2)) { 3489 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x2"); 3490 } 3491 if (!(_s.rh.recType == 0x0FBA)) { 3492 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 3493 } 3494 if (!(_s.rh.recLen%2 == 0 )) { 3495 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2 == 0 "); 3496 } 3497 _c = _s.rh.recLen; 3498 _s.progId.resize(_c); 3499 in.readBytes(_s.progId); 3500 } 3501 void MSO::parseClipboardNameAtom(LEInputStream& in, ClipboardNameAtom& _s) { 3502 _s.streamOffset = in.getPosition(); 3503 int _c; 3504 LEInputStream::Mark _m; 3505 parseRecordHeader(in, _s.rh); 3506 if (!(_s.rh.recVer == 0x0)) { 3507 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 3508 } 3509 if (!(_s.rh.recInstance == 0x3)) { 3510 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x3"); 3511 } 3512 if (!(_s.rh.recType == 0x0FBA)) { 3513 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FBA"); 3514 } 3515 if (!(_s.rh.recLen%2 == 0 )) { 3516 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen%2 == 0 "); 3517 } 3518 _c = _s.rh.recLen; 3519 _s.clipboardName.resize(_c); 3520 in.readBytes(_s.clipboardName); 3521 } 3522 void MSO::parseMetafileBlob(LEInputStream& in, MetafileBlob& _s) { 3523 _s.streamOffset = in.getPosition(); 3524 int _c; 3525 LEInputStream::Mark _m; 3526 parseRecordHeader(in, _s.rh); 3527 if (!(_s.rh.recVer == 0x0)) { 3528 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 3529 } 3530 if (!(_s.rh.recInstance == 0x0)) { 3531 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0x0"); 3532 } 3533 if (!(_s.rh.recType == 0x0FC1)) { 3534 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0FC1"); 3535 } 3536 if (!(_s.rh.recLen>16)) { 3537 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen>16"); 3538 } 3539 _s.mm = in.readint16(); 3540 _s.xExt = in.readint16(); 3541 _s.yExt = in.readint16(); 3542 _c = _s.rh.recLen-6; 3543 _s.data.resize(_c); 3544 in.readBytes(_s.data); 3545 } 3546 void MSO::parseOfficeArtFDGG(LEInputStream& in, OfficeArtFDGG& _s) { 3547 _s.streamOffset = in.getPosition(); 3548 _s.spidMax = in.readuint32(); 3549 if (!(((quint32)_s.spidMax)<67098623)) { 3550 throw IncorrectValueException(in.getPosition(), "((quint32)_s.spidMax)<67098623"); 3551 } 3552 _s.cidcl = in.readuint32(); 3553 if (!(((quint32)_s.cidcl)<268435455)) { 3554 throw IncorrectValueException(in.getPosition(), "((quint32)_s.cidcl)<268435455"); 3555 } 3556 _s.cspSaved = in.readuint32(); 3557 _s.cdgSaved = in.readuint32(); 3558 } 3559 void MSO::parseOfficeArtFDG(LEInputStream& in, OfficeArtFDG& _s) { 3560 _s.streamOffset = in.getPosition(); 3561 parseOfficeArtRecordHeader(in, _s.rh); 3562 if (!(_s.rh.recVer == 0x0)) { 3563 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x0"); 3564 } 3565 if (!(_s.rh.recInstance<=4094)) { 3566 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance<=4094"); 3567 } 3568 if (!(_s.rh.recType == 0x0F008)) { 3569 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0F008"); 3570 } 3571 if (!(_s.rh.recLen == 8)) { 3572 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 3573 } 3574 _s.csp = in.readuint32(); 3575 _s.spidCur = in.readuint32(); 3576 } 3577 void MSO::parseOfficeArtFRITContainer(LEInputStream& in, OfficeArtFRITContainer& _s) { 3578 _s.streamOffset = in.getPosition(); 3579 int _c; 3580 LEInputStream::Mark _m; 3581 parseOfficeArtRecordHeader(in, _s.rh); 3582 if (!(_s.rh.recVer == 0)) { 3583 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3584 } 3585 if (!(_s.rh.recType == 0xF118)) { 3586 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF118"); 3587 } 3588 if (!(_s.rh.recLen==4*_s.rh.recInstance)) { 3589 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen==4*_s.rh.recInstance"); 3590 } 3591 _c = _s.rh.recInstance; 3592 for (int _i=0; _i<_c; ++_i) { 3593 _s.rgfrit.append(OfficeArtFRIT(&_s)); 3594 parseOfficeArtFRIT(in, _s.rgfrit[_i]); 3595 } 3596 } 3597 void MSO::parseOfficeArtFRIT(LEInputStream& in, OfficeArtFRIT& _s) { 3598 _s.streamOffset = in.getPosition(); 3599 _s.fridNew = in.readuint16(); 3600 _s.fridOld = in.readuint16(); 3601 } 3602 void MSO::parseOfficeArtBStoreContainer(LEInputStream& in, OfficeArtBStoreContainer& _s) { 3603 _s.streamOffset = in.getPosition(); 3604 LEInputStream::Mark _m; 3605 bool _atend; 3606 parseOfficeArtRecordHeader(in, _s.rh); 3607 if (!(_s.rh.recVer == 0xF)) { 3608 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3609 } 3610 if (!(_s.rh.recType == 0x0F001)) { 3611 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0F001"); 3612 } 3613 qint64 _startPos = in.getPosition(); 3614 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 3615 _atend = in.getPosition() - _startPos >= _totalSize; 3616 while (!_atend) { 3617 _s.rgfb.append(OfficeArtBStoreContainerFileBlock(&_s)); 3618 parseOfficeArtBStoreContainerFileBlock(in, _s.rgfb.last()); 3619 _atend = in.getPosition() - _startPos >= _totalSize; 3620 } 3621 } 3622 void MSO::parseOfficeArtSpgrContainer(LEInputStream& in, OfficeArtSpgrContainer& _s) { 3623 _s.streamOffset = in.getPosition(); 3624 LEInputStream::Mark _m; 3625 bool _atend; 3626 parseOfficeArtRecordHeader(in, _s.rh); 3627 if (!(_s.rh.recVer == 0xF)) { 3628 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3629 } 3630 if (!(_s.rh.recInstance == 0)) { 3631 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3632 } 3633 if (!(_s.rh.recType == 0x0F003)) { 3634 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0F003"); 3635 } 3636 qint64 _startPos = in.getPosition(); 3637 int _totalSize = qMin(_s.rh.recLen, quint32(in.getSize() - _startPos)); 3638 _atend = in.getPosition() - _startPos >= _totalSize; 3639 while (!_atend) { 3640 _s.rgfb.append(OfficeArtSpgrContainerFileBlock(&_s)); 3641 parseOfficeArtSpgrContainerFileBlock(in, _s.rgfb.last()); 3642 _atend = in.getPosition() - _startPos >= _totalSize; 3643 } 3644 } 3645 void MSO::parseOfficeArtSolverContainer(LEInputStream& in, OfficeArtSolverContainer& _s) { 3646 _s.streamOffset = in.getPosition(); 3647 LEInputStream::Mark _m; 3648 bool _atend; 3649 parseOfficeArtRecordHeader(in, _s.rh); 3650 if (!(_s.rh.recVer == 0xF)) { 3651 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0xF"); 3652 } 3653 if (!(_s.rh.recType == 0xF005)) { 3654 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF005"); 3655 } 3656 _atend = false; 3657 while (!_atend) { 3658 _m = in.setMark(); 3659 try { 3660 _s.rgfb.append(OfficeArtSolverContainerFileBlock(&_s)); 3661 parseOfficeArtSolverContainerFileBlock(in, _s.rgfb.last()); 3662 } catch(IncorrectValueException _e) { 3663 _s.rgfb.removeLast(); 3664 _atend = true; 3665 in.rewind(_m); 3666 } catch(EOFException _e) { 3667 _s.rgfb.removeLast(); 3668 _atend = true; 3669 in.rewind(_m); 3670 } 3671 } 3672 } 3673 void MSO::parseOfficeArtFConnectorRule(LEInputStream& in, OfficeArtFConnectorRule& _s) { 3674 _s.streamOffset = in.getPosition(); 3675 parseOfficeArtRecordHeader(in, _s.rh); 3676 if (!(_s.rh.recVer == 1)) { 3677 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 1"); 3678 } 3679 if (!(_s.rh.recInstance == 0)) { 3680 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3681 } 3682 if (!(_s.rh.recType == 0xF012)) { 3683 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF012"); 3684 } 3685 if (!(_s.rh.recLen == 0x18)) { 3686 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x18"); 3687 } 3688 _s.ruid = in.readuint32(); 3689 _s.spidA = in.readuint32(); 3690 _s.spidB = in.readuint32(); 3691 _s.spidC = in.readuint32(); 3692 _s.cptiA = in.readuint32(); 3693 _s.cptiB = in.readuint32(); 3694 } 3695 void MSO::parseOfficeArtFArcRule(LEInputStream& in, OfficeArtFArcRule& _s) { 3696 _s.streamOffset = in.getPosition(); 3697 parseOfficeArtRecordHeader(in, _s.rh); 3698 if (!(_s.rh.recVer == 0)) { 3699 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3700 } 3701 if (!(_s.rh.recInstance == 0)) { 3702 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3703 } 3704 if (!(_s.rh.recType == 0xF014)) { 3705 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF014"); 3706 } 3707 if (!(_s.rh.recLen == 8)) { 3708 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 3709 } 3710 _s.ruid = in.readuint32(); 3711 _s.spid = in.readuint32(); 3712 } 3713 void MSO::parseOfficeArtFCalloutRule(LEInputStream& in, OfficeArtFCalloutRule& _s) { 3714 _s.streamOffset = in.getPosition(); 3715 parseOfficeArtRecordHeader(in, _s.rh); 3716 if (!(_s.rh.recVer == 0)) { 3717 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3718 } 3719 if (!(_s.rh.recInstance == 0)) { 3720 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3721 } 3722 if (!(_s.rh.recType == 0xF017)) { 3723 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF017"); 3724 } 3725 if (!(_s.rh.recLen == 8)) { 3726 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 3727 } 3728 _s.ruid = in.readuint32(); 3729 _s.spid = in.readuint32(); 3730 } 3731 void MSO::parseOfficeArtFSPGR(LEInputStream& in, OfficeArtFSPGR& _s) { 3732 _s.streamOffset = in.getPosition(); 3733 parseOfficeArtRecordHeader(in, _s.rh); 3734 if (!(_s.rh.recVer == 0x1)) { 3735 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x1"); 3736 } 3737 if (!(_s.rh.recInstance == 0)) { 3738 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3739 } 3740 if (!(_s.rh.recType == 0x0F009)) { 3741 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0F009"); 3742 } 3743 if (!(_s.rh.recLen == 0x10)) { 3744 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x10"); 3745 } 3746 _s.xLeft = in.readint32(); 3747 _s.yTop = in.readint32(); 3748 _s.xRight = in.readint32(); 3749 _s.yBottom = in.readint32(); 3750 } 3751 void MSO::parseOfficeArtFSP(LEInputStream& in, OfficeArtFSP& _s) { 3752 _s.streamOffset = in.getPosition(); 3753 parseOfficeArtRecordHeader(in, _s.rh); 3754 if (!(_s.rh.recVer == 0x2)) { 3755 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x2"); 3756 } 3757 if (!(_s.rh.recInstance<= 202)) { 3758 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance<= 202"); 3759 } 3760 if (!(_s.rh.recType == 0x0F00A)) { 3761 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0F00A"); 3762 } 3763 if (!(_s.rh.recLen == 8)) { 3764 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 8"); 3765 } 3766 _s.spid = in.readuint32(); 3767 _s.fGroup = in.readbit(); 3768 _s.fChild = in.readbit(); 3769 _s.fPatriarch = in.readbit(); 3770 _s.fDeleted = in.readbit(); 3771 _s.fOleShape = in.readbit(); 3772 _s.fHaveMaster = in.readbit(); 3773 _s.fFlipH = in.readbit(); 3774 _s.fFlipV = in.readbit(); 3775 _s.fConnector = in.readbit(); 3776 _s.fHaveAnchor = in.readbit(); 3777 _s.fBackground = in.readbit(); 3778 _s.fHaveSpt = in.readbit(); 3779 _s.unused1 = in.readuint20(); 3780 } 3781 void MSO::parseOfficeArtFOPT(LEInputStream& in, OfficeArtFOPT& _s) { 3782 _s.streamOffset = in.getPosition(); 3783 int _c; 3784 LEInputStream::Mark _m; 3785 parseOfficeArtRecordHeader(in, _s.rh); 3786 if (!(_s.rh.recVer == 0x3)) { 3787 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0x3"); 3788 } 3789 if (!(_s.rh.recType == 0x0F00B)) { 3790 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0x0F00B"); 3791 } 3792 _c = _s.rh.recInstance; 3793 for (int _i=0; _i<_c; ++_i) { 3794 _s.fopt.append(OfficeArtFOPTEChoice(&_s)); 3795 parseOfficeArtFOPTEChoice(in, _s.fopt[_i]); 3796 } 3797 _c = _s.rh.recLen-6*_s.rh.recInstance; 3798 _s.complexData.resize(_c); 3799 in.readBytes(_s.complexData); 3800 } 3801 void MSO::parseOfficeArtSecondaryFOPT(LEInputStream& in, OfficeArtSecondaryFOPT& _s) { 3802 _s.streamOffset = in.getPosition(); 3803 int _c; 3804 LEInputStream::Mark _m; 3805 parseOfficeArtRecordHeader(in, _s.rh); 3806 if (!(_s.rh.recVer == 3)) { 3807 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 3"); 3808 } 3809 if (!(_s.rh.recType == 0xF121)) { 3810 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF121"); 3811 } 3812 _c = _s.rh.recInstance; 3813 for (int _i=0; _i<_c; ++_i) { 3814 _s.fopt.append(OfficeArtFOPTEChoice(&_s)); 3815 parseOfficeArtFOPTEChoice(in, _s.fopt[_i]); 3816 } 3817 _c = _s.rh.recLen-6*_s.rh.recInstance; 3818 _s.complexData.resize(_c); 3819 in.readBytes(_s.complexData); 3820 } 3821 void MSO::parseOfficeArtTertiaryFOPT(LEInputStream& in, OfficeArtTertiaryFOPT& _s) { 3822 _s.streamOffset = in.getPosition(); 3823 int _c; 3824 LEInputStream::Mark _m; 3825 parseOfficeArtRecordHeader(in, _s.rh); 3826 if (!(_s.rh.recVer == 3)) { 3827 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 3"); 3828 } 3829 if (!(_s.rh.recType == 0xF122)) { 3830 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF122"); 3831 } 3832 _c = _s.rh.recInstance; 3833 for (int _i=0; _i<_c; ++_i) { 3834 _s.fopt.append(OfficeArtFOPTEChoice(&_s)); 3835 parseOfficeArtFOPTEChoice(in, _s.fopt[_i]); 3836 } 3837 _c = _s.rh.recLen-6*_s.rh.recInstance; 3838 _s.complexData.resize(_c); 3839 in.readBytes(_s.complexData); 3840 } 3841 void MSO::parseMSOPATHINFO(LEInputStream& in, MSOPATHINFO& _s) { 3842 _s.streamOffset = in.getPosition(); 3843 _s.type = in.readuint3(); 3844 _s.segments = in.readuint13(); 3845 } 3846 void MSO::parseFixedPoint(LEInputStream& in, FixedPoint& _s) { 3847 _s.streamOffset = in.getPosition(); 3848 _s.fractional = in.readuint16(); 3849 _s.integral = in.readint16(); 3850 } 3851 void MSO::parsePVertices_complex(LEInputStream& in, PVertices_complex& _s) { 3852 _s.streamOffset = in.getPosition(); 3853 int _c; 3854 LEInputStream::Mark _m; 3855 _s.nElems = in.readuint16(); 3856 _s.nElemsAlloc = in.readuint16(); 3857 _s.cbElem = in.readuint16(); 3858 _c = (_s.cbElem==0xFFF0)?(4 * _s.nElems):(_s.cbElem * _s.nElems); 3859 _s.data.resize(_c); 3860 in.readBytes(_s.data); 3861 } 3862 void MSO::parsePSegmentInfo_complex(LEInputStream& in, PSegmentInfo_complex& _s) { 3863 _s.streamOffset = in.getPosition(); 3864 int _c; 3865 LEInputStream::Mark _m; 3866 _s.nElems = in.readuint16(); 3867 _s.nElemsAlloc = in.readuint16(); 3868 _s.cbElem = in.readuint16(); 3869 _c = (_s.cbElem==0xFFF0)?(4 * _s.nElems):(_s.cbElem * _s.nElems); 3870 _s.data.resize(_c); 3871 in.readBytes(_s.data); 3872 } 3873 void MSO::parseFillShadeColors_complex(LEInputStream& in, FillShadeColors_complex& _s) { 3874 _s.streamOffset = in.getPosition(); 3875 int _c; 3876 LEInputStream::Mark _m; 3877 _s.nElems = in.readuint16(); 3878 _s.nElemsAlloc = in.readuint16(); 3879 _s.cbElem = in.readuint16(); 3880 _c = (_s.cbElem==0xFFF0)?(4 * _s.nElems):(_s.cbElem * _s.nElems); 3881 _s.data.resize(_c); 3882 in.readBytes(_s.data); 3883 } 3884 void MSO::parsePWrapPolygonVertices_complex(LEInputStream& in, PWrapPolygonVertices_complex& _s) { 3885 _s.streamOffset = in.getPosition(); 3886 int _c; 3887 LEInputStream::Mark _m; 3888 _s.nElems = in.readuint16(); 3889 _s.nElemsAlloc = in.readuint16(); 3890 _s.cbElem = in.readuint16(); 3891 _c = (_s.cbElem==0xFFF0)?(4 * _s.nElems):(_s.cbElem * _s.nElems); 3892 _s.data.resize(_c); 3893 in.readBytes(_s.data); 3894 } 3895 void MSO::parseOfficeArtCOLORREF(LEInputStream& in, OfficeArtCOLORREF& _s) { 3896 _s.streamOffset = in.getPosition(); 3897 _s.red = in.readuint8(); 3898 _s.green = in.readuint8(); 3899 _s.blue = in.readuint8(); 3900 _s.fPaletteIndex = in.readbit(); 3901 _s.fPaletteRGB = in.readbit(); 3902 _s.fSystemRGB = in.readbit(); 3903 _s.fSchemeIndex = in.readbit(); 3904 _s.fSysIndex = in.readbit(); 3905 _s.unused1 = in.readbit(); 3906 _s.unused2 = in.readbit(); 3907 _s.unused3 = in.readbit(); 3908 } 3909 void MSO::parseOfficeArtChildAnchor(LEInputStream& in, OfficeArtChildAnchor& _s) { 3910 _s.streamOffset = in.getPosition(); 3911 parseOfficeArtRecordHeader(in, _s.rh); 3912 if (!(_s.rh.recVer == 0)) { 3913 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3914 } 3915 if (!(_s.rh.recInstance == 0)) { 3916 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3917 } 3918 if (!(_s.rh.recType == 0xF00F)) { 3919 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF00F"); 3920 } 3921 if (!(_s.rh.recLen == 0x10)) { 3922 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x10"); 3923 } 3924 _s.xLeft = in.readint32(); 3925 _s.yTop = in.readint32(); 3926 _s.xRight = in.readint32(); 3927 _s.yBottom = in.readint32(); 3928 } 3929 void MSO::parseDocOfficeArtClientAnchor(LEInputStream& in, DocOfficeArtClientAnchor& _s) { 3930 _s.streamOffset = in.getPosition(); 3931 parseOfficeArtRecordHeader(in, _s.rh); 3932 if (!(_s.rh.recVer == 0)) { 3933 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3934 } 3935 if (!(_s.rh.recInstance == 0)) { 3936 throw IncorrectValueException(in.getPosition(), "_s.rh.recInstance == 0"); 3937 } 3938 if (!(_s.rh.recType == 0xF010)) { 3939 throw IncorrectValueException(in.getPosition(), "_s.rh.recType == 0xF010"); 3940 } 3941 if (!(_s.rh.recLen == 0x4)) { 3942 throw IncorrectValueException(in.getPosition(), "_s.rh.recLen == 0x4"); 3943 } 3944 _s.clientAnchor = in.readint32(); 3945 } 3946 void MSO::parseXlsOfficeArtClientAnchor(LEInputStream& in, XlsOfficeArtClientAnchor& _s) { 3947 _s.streamOffset = in.getPosition(); 3948 parseOfficeArtRecordHeader(in, _s.rh); 3949 if (!(_s.rh.recVer == 0)) { 3950 throw IncorrectValueException(in.getPosition(), "_s.rh.recVer == 0"); 3951 } 3952 if (!(_s.rh.recInstance == 0)) { 3953