Bug 67274 - Add all ICU languages to LocaleToScriptMappingDefault.cpp
Summary: Add all ICU languages to LocaleToScriptMappingDefault.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matt Falkenhagen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-31 02:02 PDT by Matt Falkenhagen
Modified: 2011-12-21 00:19 PST (History)
4 users (show)

See Also:


Attachments
Patch (14.28 KB, patch)
2011-08-31 02:20 PDT, Matt Falkenhagen
no flags Details | Formatted Diff | Diff
add const (14.39 KB, patch)
2011-12-20 22:45 PST, Matt Falkenhagen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Falkenhagen 2011-08-31 02:02:38 PDT
Expand the hard-coded mapping of locales to script in LocaleToScriptMappingDefault.cpp (see comments on bug 10874).
Comment 1 Matt Falkenhagen 2011-08-31 02:20:38 PDT
Created attachment 105762 [details]
Patch
Comment 2 Kent Tamura 2011-12-13 22:53:43 PST
Comment on attachment 105762 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=105762&action=review

> Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp:157
> +        for (size_t i = 0; i < sizeof(scriptNameCodeList) / sizeof(scriptNameCodeList[0]); ++i)

You can use WTF_ARRAY_LENGTH(scriptNameCodeList) in wtf/StdLibExtras.h.
Comment 3 Eric Seidel (no email) 2011-12-19 13:52:14 PST
Comment on attachment 105762 [details]
Patch

seems reasonable to me.  ap or jungshik know the most about ICU in WebCore.  Post a new patch using the ARRAY_SIZE macro and I'm ready to r+ this.
Comment 4 Alexey Proskuryakov 2011-12-20 18:16:09 PST
Comment on attachment 105762 [details]
Patch

Yes, looks reasonable.
Comment 5 Matt Falkenhagen 2011-12-20 22:14:46 PST
I get an error:

no matching function for call to ‘ArrayLengthHelperFunction(const WebCore::getScriptCode(const WTF::St
ring&)::ScriptNameCode [104])’

for WTF_ARRAY_LENGTH(scriptNameCodeList). I think maybe it can't be used on arrays of local structs. I could get it to work on an array of ints.

I'll upload a new patch soon that just makes scriptNameCodeList const.
Comment 6 Matt Falkenhagen 2011-12-20 22:45:50 PST
Created attachment 120145 [details]
add const
Comment 7 Kent Tamura 2011-12-20 23:03:19 PST
Comment on attachment 120145 [details]
add const

ok
Comment 8 WebKit Review Bot 2011-12-21 00:19:47 PST
Comment on attachment 120145 [details]
add const

Clearing flags on attachment: 120145

Committed r103397: <http://trac.webkit.org/changeset/103397>
Comment 9 WebKit Review Bot 2011-12-21 00:19:52 PST
All reviewed patches have been landed.  Closing bug.