87
88
switch (header->getFileType())
89
case 0x0a: // WordPerfect File
90
switch (header->getMajorVersion())
94
confidence = WPD_CONFIDENCE_EXCELLENT;
97
// unhandled file format
98
confidence = WPD_CONFIDENCE_NONE;
102
case 0x2c: // WP Mac File
103
switch (header->getMajorVersion())
105
case 0x02: // WP Mac 2.x
106
case 0x03: // WP Mac 3.0-3.5
107
case 0x04: // WP Mac 3.5e
108
confidence = WPD_CONFIDENCE_EXCELLENT;
111
// unhandled file format
112
confidence = WPD_CONFIDENCE_NONE;
117
// unhandled file type
118
confidence = WPD_CONFIDENCE_NONE;
90
case 0x0a: // WordPerfect File
91
switch (header->getMajorVersion())
95
confidence = WPD_CONFIDENCE_EXCELLENT;
98
// unhandled file format
99
confidence = WPD_CONFIDENCE_NONE;
103
case 0x2c: // WP Mac File
104
switch (header->getMajorVersion())
106
case 0x02: // WP Mac 2.x
107
case 0x03: // WP Mac 3.0-3.5
108
case 0x04: // WP Mac 3.5e
109
confidence = WPD_CONFIDENCE_EXCELLENT;
112
// unhandled file format
113
confidence = WPD_CONFIDENCE_NONE;
118
// unhandled file type
119
confidence = WPD_CONFIDENCE_NONE;
121
122
if (header->getDocumentEncryption())
131
132
confidence = WP1Heuristics::isWP1FileFormat(input, 0);
132
if (confidence != WPD_CONFIDENCE_EXCELLENT && confidence != WPD_CONFIDENCE_SUPPORTED_ENCRYPTION)
133
confidence = LIBWPD_MAX(confidence, WP42Heuristics::isWP42FileFormat(input, 0));
133
if (confidence != WPD_CONFIDENCE_EXCELLENT && confidence != WPD_CONFIDENCE_SUPPORTED_ENCRYPTION)
134
confidence = LIBWPD_MAX(confidence, WP42Heuristics::isWP42FileFormat(input, 0));
136
137
// dispose of the reference to the ole input stream, if we allocated one
137
138
if (document && isDocumentOLE)
217
218
passwordMatch = WP1Heuristics::verifyPassword(input, password);
218
if (passwordMatch == WPD_PASSWORD_MATCH_NONE)
219
passwordMatch = LIBWPD_MAX(passwordMatch, WP42Heuristics::verifyPassword(input, password));
219
if (passwordMatch == WPD_PASSWORD_MATCH_NONE)
220
passwordMatch = LIBWPD_MAX(passwordMatch, WP42Heuristics::verifyPassword(input, password));
222
223
// dispose of the reference to the ole input stream, if we allocated one
223
224
if (document && isDocumentOLE)
300
301
switch (header->getFileType())
302
case 0x0a: // WordPerfect File
303
switch (header->getMajorVersion())
306
WPD_DEBUG_MSG(("WordPerfect: Using the WP5 parser.\n"));
310
encryption = new WPXEncryption(password, 16);
312
parser = new WP5Parser(document, header, encryption);
313
parser->parse(documentInterface);
316
WPD_DEBUG_MSG(("WordPerfect: Using the WP6 parser.\n"));
321
throw UnsupportedEncryptionException();
323
parser = new WP6Parser(document, header, encryption);
324
parser->parse(documentInterface);
327
// unhandled file format
328
WPD_DEBUG_MSG(("WordPerfect: Unsupported file format.\n"));
332
case 0x2c: // WP Mac File
333
switch (header->getMajorVersion())
335
case 0x02: // WP Mac 2.x
336
case 0x03: // WP Mac 3.0-3.5
337
case 0x04: // WP Mac 3.5e
338
WPD_DEBUG_MSG(("WordPerfect: Using the WP3 parser.\n"));
342
encryption = new WPXEncryption(password, header->getDocumentOffset());
344
parser = new WP3Parser(document, header, encryption);
345
parser->parse(documentInterface);
348
// unhandled file format
349
WPD_DEBUG_MSG(("WordPerfect: Unsupported file format.\n"));
354
// unhandled file format
355
WPD_DEBUG_MSG(("WordPerfect: Unsupported file type.\n"));
303
case 0x0a: // WordPerfect File
304
switch (header->getMajorVersion())
307
WPD_DEBUG_MSG(("WordPerfect: Using the WP5 parser.\n"));
311
encryption = new WPXEncryption(password, 16);
313
parser = new WP5Parser(document, header, encryption);
314
parser->parse(documentInterface);
317
WPD_DEBUG_MSG(("WordPerfect: Using the WP6 parser.\n"));
322
throw UnsupportedEncryptionException();
324
parser = new WP6Parser(document, header, encryption);
325
parser->parse(documentInterface);
328
// unhandled file format
329
WPD_DEBUG_MSG(("WordPerfect: Unsupported file format.\n"));
333
case 0x2c: // WP Mac File
334
switch (header->getMajorVersion())
336
case 0x02: // WP Mac 2.x
337
case 0x03: // WP Mac 3.0-3.5
338
case 0x04: // WP Mac 3.5e
339
WPD_DEBUG_MSG(("WordPerfect: Using the WP3 parser.\n"));
343
encryption = new WPXEncryption(password, header->getDocumentOffset());
345
parser = new WP3Parser(document, header, encryption);
346
parser->parse(documentInterface);
349
// unhandled file format
350
WPD_DEBUG_MSG(("WordPerfect: Unsupported file format.\n"));
355
// unhandled file format
356
WPD_DEBUG_MSG(("WordPerfect: Unsupported file type.\n"));