Changeset View
Changeset View
Standalone View
Standalone View
libs/koreport/renderer/KoReportPreRenderer.cpp
Context not available. | |||||
470 | } | 470 | } | ||
---|---|---|---|---|---|
471 | 471 | | |||
472 | //kDebug() << "Creating Document"; | 472 | //kDebug() << "Creating Document"; | ||
473 | d->m_document = new ORODocument(d->m_reportData->m_title); | 473 | QScopedPointer<ORODocument> document(new ORODocument(d->m_reportData->m_title)); | ||
474 | 474 | | |||
475 | d->m_pageCounter = 0; | 475 | d->m_pageCounter = 0; | ||
476 | d->m_yOffset = 0.0; | 476 | d->m_yOffset = 0.0; | ||
Context not available. | |||||
526 | 526 | | |||
527 | //kDebug() << "Page Size:" << d->m_maxWidth << d->m_maxHeight; | 527 | //kDebug() << "Page Size:" << d->m_maxWidth << d->m_maxHeight; | ||
528 | 528 | | |||
529 | d->m_document->setPageOptions(rpo); | 529 | document->setPageOptions(rpo); | ||
530 | d->m_kodata->setSorting(d->m_reportData->m_detailSection->m_sortedFields); | 530 | d->m_kodata->setSorting(d->m_reportData->m_detailSection->m_sortedFields); | ||
531 | d->m_kodata->open(); | 531 | if (!d->m_kodata->open()) { | ||
532 | return 0; | ||||
533 | } | ||||
532 | d->initEngine(); | 534 | d->initEngine(); | ||
533 | 535 | | |||
534 | //Loop through all abjects that have been registered, and register them with the script handler | 536 | //Loop through all abjects that have been registered, and register them with the script handler | ||
Context not available. | |||||
579 | KoReportData *mydata = d->m_kodata; | 581 | KoReportData *mydata = d->m_kodata; | ||
580 | 582 | | |||
581 | if (mydata && mydata->recordCount() > 0) { /* && !((query = orqThis->getQuery())->eof()))*/ | 583 | if (mydata && mydata->recordCount() > 0) { /* && !((query = orqThis->getQuery())->eof()))*/ | ||
582 | mydata->moveFirst(); | 584 | if (!mydata->moveFirst()) { | ||
585 | return 0; | ||||
586 | } | ||||
583 | int row = 0; | 587 | int row = 0; | ||
584 | int col = 0; | 588 | int col = 0; | ||
585 | do { | 589 | do { | ||
Context not available. | |||||
625 | 629 | | |||
626 | // _postProcText contains those text boxes that need to be updated | 630 | // _postProcText contains those text boxes that need to be updated | ||
627 | // with information that wasn't available at the time it was added to the document | 631 | // with information that wasn't available at the time it was added to the document | ||
628 | d->m_scriptHandler->setPageTotal(d->m_document->pages()); | 632 | d->m_scriptHandler->setPageTotal(document->pages()); | ||
629 | 633 | | |||
630 | for (int i = 0; i < d->m_postProcText.size(); i++) { | 634 | for (int i = 0; i < d->m_postProcText.size(); i++) { | ||
631 | OROTextBox * tb = d->m_postProcText.at(i); | 635 | OROTextBox * tb = d->m_postProcText.at(i); | ||
Context not available. | |||||
639 | 643 | | |||
640 | d->m_scriptHandler->displayErrors(); | 644 | d->m_scriptHandler->displayErrors(); | ||
641 | 645 | | |||
642 | d->m_kodata->close(); | 646 | if (!d->m_kodata->close()) { | ||
647 | return 0; | ||||
648 | } | ||||
643 | delete d->m_scriptHandler; | 649 | delete d->m_scriptHandler; | ||
644 | delete d->m_kodata; | 650 | delete d->m_kodata; | ||
645 | d->m_postProcText.clear(); | 651 | d->m_postProcText.clear(); | ||
646 | 652 | | |||
653 | d->m_document = document.take(); | ||||
647 | return d->m_document; | 654 | return d->m_document; | ||
648 | } | 655 | } | ||
649 | 656 | | |||
Context not available. |