- Status Closed
- Percent Complete
- Task Type Bug Report
- Category ECMAScript
-
Assigned To
Andrew - Operating System All
- Severity Low
- Priority Defer
- Reported Version Development
- Due in Version Post 3.0
-
Due Date
Undecided
- Votes
- Private
Attached to Project: QCAD Bugtracker
Opened by Anonymous Submitter - 18.04.2011
Last edited by Andrew - 16.12.2013
Opened by Anonymous Submitter - 18.04.2011
Last edited by Andrew - 16.12.2013
FS#17 - RLineEntityPointer doesn't work as function argument of type REntity*
Script code (SvgExporter.js):
245 // only export entities on main block "*Model_Space": 246 if (realEntity.getBlockId() == this.doc.getBlockId("*Model_Space")) { 247 RFileExporterAdapter.prototype.exportEntity.call(this, entity, false); 248 }
Script debugger exception:
Uncaught exception at /home/martin/workspace/rsframework/scripts/File/SvgExport/SvgExporter.js:246: Error: :-1:-1: RExporter: Argument 0 is not of type REntity*. <native>(RLineEntityPointer(0xb6fb158), false) at -1 <anonymous>(entity = RLineEntityPointer(0xb6fb158), preview = false) at /home/martin/workspace/rsframework/scripts/File/SvgExport/SvgExporter.js:246 <anonymous>() at /home/martin/workspace/rsframework/scripts/File/SvgExport/SvgExporter.js:211
Workaround: Used exportEntity() with ID as argument instead. However there may be other cases where no alternative method is available.
RFileExporterAdapter.prototype.exportEntity.call(this, realEntity.getId());
The proper way to deal with this for now is to use QSharedPointer::data():
// assuming that 'entity' is of type RLineEntityPointer:
The ECMA wrappers could probably be extended to handle this automatically when needed.