Closed Bug 139380 Opened 23 years ago Closed 23 years ago

duplicate code in nsFontMetricsXlib.cpp/nsFontMetricsGTK.cpp

Categories

(SeaMonkey :: General, defect, P2)

x86
Linux

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.0

People

(Reporter: mike, Assigned: roland.mainz)

Details

(Keywords: fonts, regression)

Attachments

(1 file, 1 obsolete file)

from LXR 4473 encodingHyphen = aFFREName.FindChar('-', encodingHyphen + 1); 4474 encodingHyphen = aFFREName.FindChar('-', encodingHyphen + 1); I have commented out the second line, rebuilt, and have been running fine without new errors.
-> Gisburn This is from bug 80224... CC timecop@network.email.ne.jp
Assignee: Matti → Roland.Mainz
Status: UNCONFIRMED → NEW
Ever confirmed: true
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
nsFontMetricsGTK.cpp has the same "flaw" ...
Summary: duplicate code in nsFontMetricsXlib.cpp → duplicate code in nsFontMetricsXlib.cpp/nsFontMetricsGTK.cpp
Attached patch Patch for 2002-04-21-08-trunk (obsolete) — Splinter Review
Requesting r=/sr= ...
Keywords: patch, review
r=bstell@ix.netcom.com thanks for finding and fixing this
Attachment #80841 - Flags: review+
Comment on attachment 80841 [details] [diff] [review] Patch for 2002-04-21-08-trunk sr=attinasi :)
Attachment #80841 - Flags: superreview+
Doesn't this change the logic? PRInt32 encodingHyphen = aFFREName.FindChar('-'); encodingHyphen = aFFREName.FindChar('-', encodingHyphen + 1); - encodingHyphen = aFFREName.FindChar('-', encodingHyphen + 1); aFFREName.Truncate(encodingHyphen+1); aFFREName.Append(aReplacementEncoding); Looks to me that we now truncate after the 2nd hyphen instead of the 3rd.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
and saying it explicitly: Isn't this function now broken?
Severity: minor → major
Priority: -- → P2
and of course my mistake in approving this.
Roland: when you fix this would you kindly add a comment explaining this and also add comments to the other places where there is similar login; eg: FFREToXLFDPattern?
maybe something like this would be better than? PRInt32 charsetHyphen; int x; for(x=0;x<3;x++) { charsetHyphen = oPattern.FindChar('-', charsetHyphen + 1); } oPattern.Insert("-*-*-*-*-*-*-*-*-*-*", charsetHyphen);
A comment would do work. A loop would work (just be sure to initialize charsetHyphen).
> A comment would do work. By this I mean: put back the original code and add a comment so people in the future do not make get confused and break the logic. Either one is okay with me.
> from LXR > 4473 encodingHyphen = aFFREName.FindChar('-', encodingHyphen + 1); > 4474 encodingHyphen = aFFREName.FindChar('-', encodingHyphen + 1); > > I have commented out the second line, rebuilt, and have been running fine > without new errors. Part of the error occured here. Not seeing an error does not infer that things are working correctly. To make the font system tolerant to the vagaries of fonts on different systems I spent months writing code to find alternate (fallback) fonts. Because the font system has fallback depth a bustage like this did not cause a catastrophic failure. The code just fell to the next fallback layer. I guess this means that as people who do not understand the code make changes it seems likely that they may well bust things. did not
Taking...
Status: REOPENED → ASSIGNED
Attachment #80841 - Attachment is obsolete: true
Keywords: patch, reviewfonts
Requesting r=/sr=/a= ...
Keywords: patch, regression, review
Comment on attachment 83286 [details] [diff] [review] Patch for 2002-05-08-08-trunk, revert to old code and add comments to avoid this "trap" in the future rsr=attinasi
Attachment #83286 - Flags: superreview+
Attachment #83286 - Flags: review+
Comment on attachment 83286 [details] [diff] [review] Patch for 2002-05-08-08-trunk, revert to old code and add comments to avoid this "trap" in the future a=rjesup@wgate.com
Attachment #83286 - Flags: approval+
Patch checked into branch for gisburn. Still needs to hit trunk.
Fix checked into trunk for gisburn
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: