Download it now!
Bug 30452 - Run Basic (F5) Toolbox icon runs 1st macros in module
Summary: Run Basic (F5) Toolbox icon runs 1st macros in module
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86 (IA32) All
: low normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-29 02:31 UTC by Oto Magaldadze
Modified: 2010-11-01 07:26 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oto Magaldadze 2010-09-29 02:31:22 UTC
In basic ide F5 shortcut key as well the equivalent icon on the toolbox runs the first macros (Function or Procedure) in a module always, in spite that cursor might stand within other procedure. 

Reproduction

1. Open a basic macros module (Probably a new one)
2. Type code:

Sub test1

msgbox "test1"

end sub

Sub test2 

msgbox "test2"

end sub

3. Put cursor within the second subprocedure (test2)
4. Press F5 key or a Run Basic icon on the Macro toolbox
Result: test1 macros will work and output a message "test1".


Although I tested it only on linux OS, I believe it's a cross-platform issue.

Oto
Comment 1 Noel Power 2010-09-29 04:00:45 UTC
(In reply to comment #0)
> In basic ide F5 shortcut key as well the equivalent icon on the toolbox runs
> the first macros (Function or Procedure) in a module always, in spite that
> cursor might stand within other procedure. 

This is actually by design, personally I don't like this behavior, I'm all for changing it. But really, not a bug but an enhancement.... 

I'll take it anyway
Comment 2 Noel Power 2010-09-29 06:34:09 UTC
fixed..
Comment 3 Noel Power 2010-09-29 06:40:35 UTC
and if we can't figure out what macro you mean ( e.g. the cursor is above or below a procedure ) we open a chooser
Comment 4 Oto Magaldadze 2010-09-29 09:52:58 UTC
there isn't such behavior in OOo 3.2.1 that is why i judged it as a bug. And it's very unhandy to pic macros from menus all the time in a development environment, you know.
Comment 5 sophie 2010-11-01 05:19:04 UTC
Verified in the last 10_10_28_Cedric .rpm build - F5 and the icon run the second macro if the cursor is in it. If it's between, a dialog open to choose which macro to run - Closing - Sophie
Comment 6 Oto Magaldadze 2010-11-01 07:11:26 UTC
(In reply to comment #5)
> Verified in the last 10_10_28_Cedric .rpm build - F5 and the icon run the
> second macro if the cursor is in it. If it's between, a dialog open to choose
> which macro to run - Closing - Sophie

actually it was previously marked as NOT A BUG afaik because such behavior was due to design, but then some devs changed it to what it is now.
Comment 7 sophie 2010-11-01 07:26:10 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Verified in the last 10_10_28_Cedric .rpm build - F5 and the icon run the
> > second macro if the cursor is in it. If it's between, a dialog open to choose
> > which macro to run - Closing - Sophie
> 
> actually it was previously marked as NOT A BUG afaik because such behavior was
> due to design, but then some devs changed it to what it is now.

Yes, this is why I checked that the fix runs as expected in the last build, it's implemented and works correctly so the issue is now closed - Sophie