ComposerController.js loops too many times

VERIFIED FIXED in mozilla0.9.4

Status

()

P3
normal
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: jdunn, Assigned: sfraser_bugs)

Tracking

Trunk
mozilla0.9.4
All
Other
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: needs r=/sr=)

(Reporter)

Description

18 years ago
ComposerController's GetEditorController seems to loop 1 to
many times thru the list of controllers that it gets.  This 
doesn't really cause any problems, but it is wrong (IMHO).

it does a for against numControllers and goes from
numControllers down to 0, which means it does 1 too many.

Here is my suggested fix.

Index: ComposerCommands.js
===================================================================
RCS file: /cvsroot/mozilla/editor/ui/composer/content/ComposerCommands.js,v
retrieving revision 1.65
diff -u -r1.65 ComposerCommands.js
--- ComposerCommands.js 2001/07/06 20:03:40     1.65
+++ ComposerCommands.js 2001/08/09 16:23:08
@@ -179,7 +179,7 @@
   var numControllers = window._content.controllers.getControllerCount();
     
   // count down to find a controller that supplies a
nsIControllerCommandManager interface
-  for (var i = numControllers; i >= 0 ; i --)
+  for (var i = numControllers-1; i >= 0 ; i --)
   {
     var commandManager = null;

Comment 1

18 years ago
this seems reasonable to me, but am reassigning to sfraser for r/sr=
Assignee: beppe → sfraser
Priority: -- → P3
Whiteboard: needs r=/sr=
Target Milestone: --- → mozilla0.9.4
(Assignee)

Comment 2

18 years ago
Yeah, I had that fixed in my tree a while back.

r/sr=sfraser
(Reporter)

Comment 3

18 years ago
fix checked in
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 4

18 years ago
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.