Issue 84010 - App crash attempting to insert empty Transferable via Macro
Summary: App crash attempting to insert empty Transferable via Macro
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 2.3
Hardware: All All
: P2 Trivial with 1 vote (vote)
Target Milestone: ---
Assignee: joerg.skottke
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-27 14:28 UTC by silvercapo
Modified: 2013-08-07 14:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description silvercapo 2007-11-27 14:28:15 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.
Comment 1 michael.ruess 2007-11-27 15:31:23 UTC
Reassigned to JSK.
Comment 2 joerg.skottke 2007-11-28 11:38:26 UTC
API -> cn
Comment 3 chne 2007-12-03 11:04:12 UTC
cn->mba: I can reproduce the crash with src680_m238 on unxsoli
Comment 4 Mathias_Bauer 2008-12-10 12:55:04 UTC
Thanks for reporting and confirming
Comment 5 Mathias_Bauer 2009-01-15 09:27:17 UTC
fixed in cws mba31issues01
Comment 6 Mathias_Bauer 2009-01-27 11:47:21 UTC
Please verify
Comment 7 joerg.skottke 2009-01-29 13:05:19 UTC
No crash, verified.
Comment 8 joerg.skottke 2009-03-18 08:04:29 UTC
Starting MWS verification.
Comment 9 joerg.skottke 2009-03-18 08:14:20 UTC
Used Windows, now a second document opens, no crash.
Closing