Changeset View
Changeset View
Standalone View
Standalone View
filters/sheets/excel/sidewinder/globalssubstreamhandler.cpp
Context not available. | |||||
205 | { | 205 | { | ||
---|---|---|---|---|---|
206 | if (index < d->nameTable.size()) | 206 | if (index < d->nameTable.size()) | ||
207 | return d->nameTable[index]; | 207 | return d->nameTable[index]; | ||
208 | std::cerr << "Invalid index in GlobalsSubStreamHandler::nameFromIndex index=" << index << " size=" << d->externNameTable.size() << std::endl; | 208 | qCWarning(lcSidewinder) << "Invalid index in GlobalsSubStreamHandler::nameFromIndex index=" << index << "size=" << d->externNameTable.size(); | ||
209 | return QString(); | 209 | return QString(); | ||
210 | } | 210 | } | ||
211 | 211 | | |||
Context not available. | |||||
213 | { | 213 | { | ||
214 | if (index < d->externNameTable.size()) | 214 | if (index < d->externNameTable.size()) | ||
215 | return d->externNameTable[index]; | 215 | return d->externNameTable[index]; | ||
216 | std::cerr << "Invalid index in GlobalsSubStreamHandler::externNameFromIndex index=" << index << " size=" << d->externNameTable.size() << std::endl; | 216 | qCWarning(lcSidewinder) << "Invalid index in GlobalsSubStreamHandler::externNameFromIndex index=" << index | ||
217 | << "size=" << d->externNameTable.size(); | ||||
217 | return QString(); | 218 | return QString(); | ||
218 | } | 219 | } | ||
219 | 220 | | |||
Context not available. | |||||
372 | if (ifmt >= 164 && ifmt <= 392) { // custom format | 373 | if (ifmt >= 164 && ifmt <= 392) { // custom format | ||
373 | valueFormat = d->formatsTable[ifmt]; | 374 | valueFormat = d->formatsTable[ifmt]; | ||
374 | } else { | 375 | } else { | ||
375 | std::cout << "Unhandled format with index " << xf.formatIndex() << ". Using general format." << std::endl; | 376 | qCDebug(lcSidewinder) << "Unhandled format with index" << xf.formatIndex() << ". Using general format."; | ||
376 | valueFormat = "General"; | 377 | valueFormat = "General"; | ||
377 | } | 378 | } | ||
378 | } | 379 | } | ||
Context not available. | |||||
516 | else if (type == 0xA) {} //EofRecord | 517 | else if (type == 0xA) {} //EofRecord | ||
517 | //else if (type == 0xEC) Q_ASSERT(false); // MsoDrawing | 518 | //else if (type == 0xEC) Q_ASSERT(false); // MsoDrawing | ||
518 | else { | 519 | else { | ||
519 | //std::cout << "Unhandled global record with type=" << type << " name=" << record->name() << std::endl; | 520 | //qCDebug(lcSidewinder) << "Unhandled global record with type=" << type << " name=" << record->name(); | ||
520 | } | 521 | } | ||
521 | 522 | | |||
522 | } | 523 | } | ||
Context not available. | |||||
528 | if (record->type() == BOFRecord::Workbook) { | 529 | if (record->type() == BOFRecord::Workbook) { | ||
529 | d->version = record->version(); | 530 | d->version = record->version(); | ||
530 | } else { | 531 | } else { | ||
531 | std::cout << "GlobalsSubStreamHandler::handleBOF: Unhandled type=" << record->type() << std::endl; | 532 | qCDebug(lcSidewinder) << "GlobalsSubStreamHandler::handleBOF: Unhandled type=" << record->type(); | ||
532 | } | 533 | } | ||
533 | } | 534 | } | ||
534 | 535 | | |||
Context not available. | |||||
554 | d->bofMap[ bofPos ] = sheet; | 555 | d->bofMap[ bofPos ] = sheet; | ||
555 | } break; | 556 | } break; | ||
556 | default: | 557 | default: | ||
557 | std::cout << "GlobalsSubStreamHandler::handleBoundSheet: Unhandled type=" << record->sheetType() << std::endl; | 558 | qCDebug(lcSidewinder) << "GlobalsSubStreamHandler::handleBoundSheet: Unhandled type=" << record->sheetType(); | ||
558 | break; | 559 | break; | ||
559 | } | 560 | } | ||
560 | } | 561 | } | ||
Context not available. | |||||
634 | if (!d->decryption->checkPassword("VelvetSweatshop")) { | 635 | if (!d->decryption->checkPassword("VelvetSweatshop")) { | ||
635 | delete d->decryption; | 636 | delete d->decryption; | ||
636 | d->decryption = 0; | 637 | d->decryption = 0; | ||
637 | fprintf(stderr, "Invalid password\n"); | 638 | qCWarning(lcSidewinder) << "Invalid password"; | ||
638 | } else { | 639 | } else { | ||
639 | d->decryption->setInitialPosition(record->position() + 54+4); | 640 | d->decryption->setInitialPosition(record->position() + 54+4); | ||
640 | } | 641 | } | ||
Context not available. | |||||
744 | if (!record) return; | 745 | if (!record) return; | ||
745 | 746 | | |||
746 | if (record->isLocked()) { | 747 | if (record->isLocked()) { | ||
747 | std::cout << "TODO: The workbook is protected but protected workbooks is not supported yet!" << std::endl; | 748 | qCDebug(lcSidewinder) << "TODO: The workbook is protected but protected workbooks is not supported yet!"; | ||
748 | } | 749 | } | ||
749 | } | 750 | } | ||
750 | 751 | | |||
Context not available. | |||||
757 | { | 758 | { | ||
758 | if (!record) return; | 759 | if (!record) return; | ||
759 | if (!record->wPassword()) return; | 760 | if (!record->wPassword()) return; | ||
760 | std::cout << "GlobalsSubStreamHandler::handlePassword passwordHash=" << record->wPassword() << std::endl; | 761 | qCDebug(lcSidewinder) << "GlobalsSubStreamHandler::handlePassword passwordHash=" << record->wPassword(); | ||
761 | d->workbook->setPassword(record->wPassword()); | 762 | d->workbook->setPassword(record->wPassword()); | ||
762 | } | 763 | } | ||
763 | 764 | | |||
764 | void GlobalsSubStreamHandler::handleMsoDrawingGroup(MsoDrawingGroupRecord* record) | 765 | void GlobalsSubStreamHandler::handleMsoDrawingGroup(MsoDrawingGroupRecord* record) | ||
765 | { | 766 | { | ||
766 | if (!record) return; | 767 | if (!record) return; | ||
767 | printf("GlobalsSubStreamHandler::handleMsoDrawingGroup\n"); | 768 | qCDebug(lcSidewinder) << "GlobalsSubStreamHandler::handleMsoDrawingGroup"; | ||
768 | 769 | | |||
769 | static int validMsoDrawingGroups = 0; | 770 | static int validMsoDrawingGroups = 0; | ||
770 | // if this pass then multiple MsoDrawingGroupRecord can exist what we need to handle! | 771 | // if this pass then multiple MsoDrawingGroupRecord can exist what we need to handle! | ||
771 | if (validMsoDrawingGroups > 0) { | 772 | if (validMsoDrawingGroups > 0) { | ||
772 | std::cerr << "Warning: multiple valid MsoDrawingGroupRecord exists : " << validMsoDrawingGroups << std::endl; | 773 | qCWarning(lcSidewinder) << "Warning: multiple valid MsoDrawingGroupRecord exists:" << validMsoDrawingGroups; | ||
773 | } | 774 | } | ||
774 | validMsoDrawingGroups++; | 775 | validMsoDrawingGroups++; | ||
775 | 776 | | |||
Context not available. |