Issue 121904 - Esc key does not abort XRangeSelectionListener
Summary: Esc key does not abort XRangeSelectionListener
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: programming (show other issues)
Version: 3.4.1
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-16 10:56 UTC by Andreas Säger
Modified: 2014-02-07 13:38 UTC (History)
3 users (show)

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


Attachments
error message (20.16 KB, image/png)
2014-01-13 12:04 UTC, Edwin Sharp
no flags Details
ods with macro (13.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-01-13 18:05 UTC, Andreas Säger
no flags Details
error message with attachment 82268 (167.45 KB, image/png)
2014-01-13 19:29 UTC, Edwin Sharp
no flags Details
ods with macro, second try (13.94 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-01-13 20:43 UTC, Andreas Säger
no flags Details
window when Esc pressed (4.57 KB, image/png)
2014-01-14 06:46 UTC, Edwin Sharp
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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.