Issue 121904

Summary: Esc key does not abort XRangeSelectionListener
Product: Calc Reporter: Andreas Säger <villeroy>
Component: programmingAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: elish, hanya.runo, issues
Version: 3.4.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: 4.1.0-dev
Developer Difficulty: ---
Attachments:
Description Flags
error message
none
ods with macro
none
error message with attachment 82268
none
ods with macro, second try
none
window when Esc pressed none

Description Andreas Säger 2013-03-16 10:56:09 UTC
When the user aborts a range selection dialog by hitting Escape, the aborted routine of http://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/XRangeSelectionListener.html is not triggered.

Any (preset) value is taken as a range selection result even when abort was intended.

You find a working Basic macro with test routine in the forum:
http://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=60366#p267688 (the module around function getRangeSelectionAddress and sub test_RangeSelection)

Test it with named parameter sInitial:="A1" and then try to cancel the selection. You always get the address of cell A1.

Closing the window by the X button works as expected (test routine runs into var not set error).
Comment 1 Edwin Sharp 2014-01-13 12:03:40 UTC
Following error when running macro.
AOO410m1(Build:9750)  -  Rev. 1552994
Rev.1552994
Win 7
Comment 2 Edwin Sharp 2014-01-13 12:04:14 UTC
Created attachment 82267 [details]
error message
Comment 3 Andreas Säger 2014-01-13 17:56:00 UTC
Try this call (2 lines of code):

addr=Calc.RangeSelection.getRangeSelectionAddress(oController,sInitial:="F13",sTitle:="Click Target Cell",bAutoClose:=True,bSingle:=True)
If IsUnoStruct(addr) then print addr.Sheet, addr.StartRow, addr.EndRow, addr.StartColumn, addr.EndColumn

You always get some uno struct even if you canceled the dialog.
Comment 4 Andreas Säger 2014-01-13 18:05:56 UTC
Created attachment 82268 [details]
ods with macro
Comment 5 Edwin Sharp 2014-01-13 19:29:31 UTC
Created attachment 82269 [details]
error message with attachment 82268 [details]

Thank you but error
Comment 6 Andreas Säger 2014-01-13 20:43:01 UTC
Created attachment 82271 [details]
ods with macro, second try

Sorry.
Comment 7 Edwin Sharp 2014-01-14 06:45:14 UTC
Confirmed with
AOO410m1(Build:9750)  -  Rev. 1555399
2014-01-06_04:13:46 - Rev. 1555657
Debian
Comment 8 Edwin Sharp 2014-01-14 06:46:09 UTC
Created attachment 82275 [details]
window when Esc pressed
Comment 9 hanya 2014-02-07 13:38:58 UTC
Range selection window opened from Function Wizard dialog gave me the same result. 
Esc key do not cancel the selected value.