Apache OpenOffice (AOO) Bugzilla – Issue 84010
App crash attempting to insert empty Transferable via Macro
Last modified: 2013-08-07 14:43:11 UTC
In Writer/OOoBasic, when using the Transferable framework to copy-and-paste between two documents, and the transferable is 'empty', the application crashes. STEPS TO REPRODUCE THE PROBLEM 1. Create a new document, and create a new Basic module Module1 with default sub Main 2. In Main, enter the following code: Dim oTransferable As Object Dim oNewDoc As Object Dim aNoArgs() oTransferable = ThisComponent.CurrentController.getTransferable() ' *** oNewDoc = StarDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, aNoArgs()) oNewDoc.CurrentController.insertTransferable(oTransferable) *** Since this document is currently empty, no selection has been made, and oTransferable contains nothing (but note an object has still been returned, this is not Empty, Null, or Missing) 3. Run Main, and the application will pause for a second, then system crash. POSSIBLE WORKAROUNDS Could avoid this by checking that something has actually been selected in the current document before invoking this code. PROPOSED SOLUTION insertTransferable(obj) should just do nothing in the case where the Transferable obj contains nothing; and possibly also that getTransferable() should return a null object (not sure if that is possible?) that can be tested for Null or Empty.
Reassigned to JSK.
API -> cn
cn->mba: I can reproduce the crash with src680_m238 on unxsoli
Thanks for reporting and confirming
fixed in cws mba31issues01
Please verify
No crash, verified.
Starting MWS verification.
Used Windows, now a second document opens, no crash. Closing