Move script sourcing to its own class, with associated changes
ClosedPublic

Authored by piggz on May 30 2017, 10:10 PM.

Details

Summary

Move script sources out of KReportData, into its own interface

Test Plan

kreportexample still runs. With associated changes to kexi, scirpting works in reports

Diff Detail

Repository
R14 KReport
Branch
new_script_source
Lint
No Linters Available
Unit
No Unit Test Coverage
piggz created this revision.May 30 2017, 10:10 PM
Restricted Application added a project: KReport. · View Herald TranscriptMay 30 2017, 10:10 PM

This pdf demonstrates a report with the section backgrounds set vi JS, and the PageNumber at the bottom of each page set by JS.

staniek requested changes to this revision.May 31 2017, 12:42 PM

Nice...

src/common/KReportScriptSource.h
25

Not needed include

32

Move the body to .cpp, can be in KReportScriptHandler.cpp

src/renderer/KReportPreRenderer_p.h
73

Let's not use m_ here. Other uses of m_ can be removed in a separate task (would be nice).

src/renderer/scripting/KReportScriptHandler.cpp
96

All this debug not needed in the repo

167–171

Better:

QMessageBox::setText: tr("Cannot evaluate script. Error: %1.")

QMessageBox::setDetailedText: "Script code:\n%1"

src/wrtembed/KReportDesigner.cpp
445

Not needed in the repo

805

Not needed in the repo

806

Not needed in the repo

806–808

QString()

This revision now requires changes to proceed.May 31 2017, 12:42 PM
piggz marked 8 inline comments as done.May 31 2017, 9:34 PM
piggz updated this revision to Diff 15031.May 31 2017, 9:34 PM
piggz edited edge metadata.
  • Address comments
piggz updated this revision to Diff 15059.Jun 1 2017, 5:13 PM
  • Add ability to suppress error messages in evaluate()
staniek requested changes to this revision.Jun 1 2017, 8:21 PM
staniek added inline comments.
src/common/KReportScriptSource.h
18

newline

src/renderer/scripting/KReportScriptHandler.cpp
41

coding style

175

Do we want to do this infinitely? Or is there a way for the user to restore?

This revision now requires changes to proceed.Jun 1 2017, 8:21 PM
piggz added inline comments.Jun 1 2017, 8:29 PM
src/renderer/scripting/KReportScriptHandler.cpp
41

?

175

it will be restored the next time the report is opened

staniek added inline comments.Jun 1 2017, 8:31 PM
src/renderer/scripting/KReportScriptHandler.cpp
41

KReportScriptSource::~KReportScriptSource()
{
}

175

Good. How about adding something like this to the message?

"They will be restored the next time the report is opened."

piggz updated this revision to Diff 15065.Jun 1 2017, 8:39 PM
piggz edited edge metadata.
  • Add extra message
staniek requested changes to this revision.Jun 1 2017, 8:42 PM
staniek added inline comments.
src/renderer/scripting/KReportScriptHandler.cpp
105

not needed code

This revision now requires changes to proceed.Jun 1 2017, 8:42 PM
piggz updated this revision to Diff 15067.Jun 1 2017, 8:43 PM
piggz edited edge metadata.
  • Remove debug message
piggz marked 7 inline comments as done.Jun 1 2017, 8:44 PM
staniek accepted this revision.Jun 1 2017, 8:44 PM

Thx!

This revision is now accepted and ready to land.Jun 1 2017, 8:44 PM
This revision was automatically updated to reflect the committed changes.