← All bug reports

FS#157rotate causes uncaught exception

Type
Bug
Status
Closed
Resolution
Fixed
Category
QCAD (main)
Severity
Medium
Priority
Low
Reported version
Development
Operating system
All
Reported
2011-08-05 by anonymous
Closed
2011-08-08 by deleted user
  1. draw line
  2. Modify -> Rotate
    • center point: line end point
    • delete original
    • angle 90°
Uncaught exception at scripts/Modify/Rotate/Rotate.js:117: Error: :-1:-1: Wrong number/types of arguments
for RDocumentInterface.applyOperation().
<native>(undefined) at -1
<anonymous>(event = RCoordinateEvent(0xbfffd478), preview = false) at scripts/Modify/Rotate/Rotate.js:117
<anonymous>(event = RCoordinateEvent(0xbfffd478)) at
/home/martin/workspace/rsframework/scripts/Modify/../EAction.js:1197
<global>() at -1
117	                di.applyOperation(this.getOperation(false));

Comments (12)

andrew 2011-08-05

I cannot reproduce that.
Can you try again?
If the debugger shows, what is the return value of "this.getOperation(false)"?
If that is undefined, can you try to step into this.getOperation(false) and see where it fails?

deleted user 2011-08-05
.eval this.getOperation(false)==undefined
Rotate.prototype.getOperation = function(preview) {
    if (!isValidVector(this.centerPoint)) {
=>        return undefined;
    }
...
qsdb> this.centerPoint == undefined
true
andrew 2011-08-05

Committed potential fix. The tool might not do anything anymore though, if this.centerPoint is NULL.

deleted user 2011-08-05

nope, still the same

deleted user 2011-08-08

similar problem with scale:

Uncaught exception at scripts/Modify/Scale/Scale.js:123: Error: :-1:-1: Wrong number/types of arguments for RDocumentInterface.applyOperation().
<native>(undefined) at -1
<anonymous>(event = RCoordinateEvent(0xbfffd478), preview = false) at scripts/Modify/Scale/Scale.js:123
<anonymous>(event = RCoordinateEvent(0xbfffd478)) at /home/martin/workspace/rsframework/scripts/Modify/../EAction.js:1197
<global>() at -1
123	                di.applyOperation(op);
Scale.prototype.getOperation = function(preview) {
    if (!isValidVector(this.focusPoint)) {
=>        return undefined;
    }
andrew 2011-08-08

I still cannot reproduce this here.

I've added some debugging output to Rotate.js. Can you pls post the output here? Thx.

Edit: I've also added some fail safe code, it might not show the same symptoms anymore.

deleted user 2011-08-08

doesn't crash anymore, but does nothing now

Debug:    updateScenes... 
Debug:    updateGuiActions... 
Debug:    notifyListenersSlot... 
Debug:    setActiveSubwindow... 
Warning:  QScriptEngine::newVariant(): changing class of non-QScriptObject not supported
Warning:  RScriptHandlerEcma::createActionDocumentLevel():  "scripts/Snap/Auto/Auto.js" : Engine is busy. Aborting... 
Warning:  RScriptHandlerEcma::createActionDocumentLevel():  "scripts/Snap/RestrictOff/RestrictOff.js" : Engine is busy. Aborting... 
Debug:    Rotate.setState: setting this.centerPoint to undefined 
Debug:    Rotate.pickCoordinate: setting this.centerPoint to  RVector(12, 16, 0)  
Debug:    updateScenes... 
Debug:    updateGuiActions... 
Debug:    notifyListenersSlot... 
Warning:  RScriptHandlerEcma::createActionDocumentLevel():  "scripts/Snap/Auto/Auto.js" : Engine is busy. Aborting... 
Warning:  RScriptHandlerEcma::createActionDocumentLevel():  "scripts/Snap/RestrictOff/RestrictOff.js" : Engine is busy. Aborting... 
Debug:    setActiveSubwindow... 
Debug:    Rotate.setState: setting this.centerPoint to undefined 
Debug:    Rotate.getOperation: failed, this.centerPoint is not valid 
Debug:    updateScenes... 
Debug:    updateGuiActions... 
Debug:    notifyListenersSlot... 
Debug:    setActiveSubwindow... 
Debug:    Rotate.setState: setting this.centerPoint to undefined 
Debug:    updateScenes... 
Debug:    updateGuiActions... 
Debug:    notifyListenersSlot... 
Warning:  QScriptEngine::newVariant(): changing class of non-QScriptObject not supported
Warning:  QScriptEngine::newVariant(): changing class of non-QScriptObject not supported
Debug:    setActiveSubwindow... 
andrew 2011-08-08

Thanks. I can reproduce it now. Looks like under Linux there's a focus change when the dialog opens. I can simulate that by switching applications. Will try to fix.

andrew 2011-08-08

rotate should be fixed now, please confirm, then I'll fix scale

deleted user 2011-08-08

yes, the dialog is surrounded with a blue border, means it has he focus (the focus taken away from the main window)

deleted user 2011-08-08

rotate is OK now

andrew 2011-08-08

OK, updated scale as well.