Closed Bug 386548 Opened 12 years ago Closed 12 years ago

Remove nsTextTransformer

Categories

(Core :: Layout, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

Details

Attachments

(1 file)

nsTextTransformer is almost now entirely unused. Some #defines can be moved to nsTextFrameUtils. The cached nsICaseConversion* can be moved to nsContentUtils. The cached preferences don't need to be cached at all, probably, because they're only used for word selection which I don't think shows up on any profiles. Then nsTextTransformer can just die.

Requesting review from Mats because this is straightforward stuff.
Attachment #270542 - Flags: superreview?(mats.palmgren)
Attachment #270542 - Flags: review?(mats.palmgren)
After landing this I'd CVS remove nsTextTransformer.{h,cpp}.
Comment on attachment 270542 [details] [diff] [review]
remove nsTextTransformer

>Index: content/base/public/nsContentUtils.h
>   static nsIWordBreaker* WordBreaker()
>   {
>     return sWordBreaker;
>   }
>+  
>+  static nsICaseConversion* GetCaseConv()
>+  {
>+	return sCaseConv;
>+  }

indent


>Index: content/base/src/nsContentUtils.cpp
>+  rv = CallGetService(NS_UNICHARUTIL_CONTRACTID, &sCaseConv);
>+  NS_ENSURE_SUCCESS(rv, rv);

You need to add NS_IF_RELEASE(sCaseConv) in nsContentUtils::Shutdown()


>Index: layout/generic/nsTextFrameUtils.h
>+#define CH_LRM  8206  //<!ENTITY lrm     CDATA "&#8206;" -- left-to-right mark, U+200E NEW RFC 2070 -->
>+#define CH_RLM  8207  //<!ENTITY rlm     CDATA "&#8207;" -- right-to-left mark, U+200F NEW RFC 2070 -->
>+#define CH_LRE  8234  //<!CDATA "&#8234;" -- left-to-right embedding, U+202A -->
>+#define CH_RLO  8238  //<!CDATA "&#8238;" -- right-to-left override, U+202E -->
>+
>+#define IS_BIDI_CONTROL(_ch) \
>+  (((_ch) >= CH_LRM && (_ch) <= CH_RLM) || ((_ch) >= CH_LRE && (_ch) <= CH_RLO))

Why not use IS_BIDI_CONTROL_CHAR from nsBidiUtils.h?
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/intl/unicharutil/util/nsBidiUtils.h&rev=1.12&root=/cvsroot&mark=325-326#325


r+sr=mats with the above addressed.
Attachment #270542 - Flags: superreview?(mats.palmgren)
Attachment #270542 - Flags: superreview+
Attachment #270542 - Flags: review?(mats.palmgren)
Attachment #270542 - Flags: review+
Checked in.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.