QCAD

QCAD - 2D CAD System.

Click here for a documentation of the DokuWiki formatting syntax that can be used in reports

Please search for existing tasks (also closed ones) before opening a new task.

Please make sure that you are using the latest Version of QCAD before posting a bug (menu Help - Check for Updates)

Tasklist

FS#17 - RLineEntityPointer doesn't work as function argument of type REntity*

Attached to Project: QCAD
Opened by Martin (martin) - Monday, 18 April 2011, 14:05 GMT+1
Last edited by Andrew (andrew) - Monday, 16 December 2013, 14:14 GMT+1
Task Type Bug Report
Category ECMAScript
Status Closed
Assigned To Andrew (andrew)
Operating System All
Severity Low
Priority Low
Reported Version Development
Due in Version Post 3.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

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());
This task depends upon

Closed by  Andrew (andrew)
Monday, 16 December 2013, 14:14 GMT+1
Reason for closing:  Won't fix
Comment by Andrew (andrew) - Monday, 18 April 2011, 14:12 GMT+1

The proper way to deal with this for now is to use QSharedPointer::data():

// assuming that 'entity' is of type RLineEntityPointer:
RFileExporterAdapter.prototype.exportEntity.call(this, entity.data());

The ECMA wrappers could probably be extended to handle this automatically when needed.

Loading...