Incorrect hardcoded number in nsCaret.cpp causes bad cursor widths

VERIFIED FIXED in mozilla0.9

Status

()

P3
normal
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: mkaply, Assigned: mjudge)

Tracking

Trunk
mozilla0.9
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

In nscaret.cpp:

http://lxr.mozilla.org/seamonkey/source/layout/base/src/nsCaret.cpp#745

  mCaretTwipsWidth  = 15 * mCaretPixelsWidth;//uhhhh...

Is incorrect.

15 should not be hardcoded.

That 15 is actually the DevUnitstoAppUnits value and should be queried from the 
Device Context.

Comment 1

18 years ago
Reassigning to mjudge.
Assignee: clayton → mjudge
Should I have set dx to nsnull at the end of that to free the pointer?

Comment 4

18 years ago
I suggest



  presContext->GetDeviceContext(getter_AddRefs(dx));

  if ( dx )

    dx->GetDevUnitsToTwips(tDevUnitsToTwips);



for the middle hunk.  I think it's clearer.

Comment 5

18 years ago
moving to mozilla0.9
Target Milestone: --- → mozilla0.9
Can I get an r= based on scc comments?
Keywords: review
OK, this one is getting too old.

We need this fix.

Copying brendan.
Can you attach a patch based on scc's comments?  Then buster or waterson could 
give an sr= (mail 'em, cc: reviewers -- I didn't see a posting from you there 
on this bug).

/be
Created attachment 18384 [details] [diff] [review]
New diff - takes into account scc's suggestions
mjudge, can you add an r= to scc's contingent one?  Thanks.

/be
(Assignee)

Comment 11

18 years ago
hmm sfraser should really get this one. i will CC him only since a fix is ready.

r= mjudge. code looks clean. i have not added this and tested it myself yet 
(build still working) but it certainly looks good. i will update when i have 
actually run with it, but you can check it in before then on r=mjudge.

Comment 12

18 years ago
sr=sfraser on the patch
Fix checked in.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
This is working.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.