Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Move number localization code in LocaleICU.cpp to new class
https://bugs.webkit.org/show_bug.cgi?id=92976 Reviewed by Kentaro Hara. The number localization code by character mapping is usefull for non-ICU platforms. No new tests. This is just a refactoring, and is covered by Source/WebKit/chromium/tests/LocalizedNumberICUTest.cpp. * WebCore.gypi: Add NumberLocalizer.{cpp,h}. * platform/text/LocaleICU.cpp: (WebCore::LocaleICU::decimalSymbol): Renamed from setDecimalSymbol. This function returns the resultant string instead of setting it to a data member. (WebCore::LocaleICU::decimalTextAttribute): Renamed from setDecimalTextAttributel. This function returns the resultant string instead of setting it to the specified string. (WebCore::LocaleICU::initializeNumberLocalizerData): Renamed from initializeDecimalFormat. Calls NumberLocaizer::setNumberLocalizerData. (WebCore::LocaleICU::localizedDecimalSeparator): Rename initializeDecimalFormat to initializeNumberLocalizerData. * platform/text/LocaleICU.h: (LocaleICU): Remove some members, and inherit NumberLocalizer. * platform/text/NumberLocalizer.cpp: Added. Move the code from LocaleICU.cpp (WebCore): (WebCore::NumberLocalizer::~NumberLocalizer): (WebCore::NumberLocalizer::setNumberLocalizerData): Added. (WebCore::NumberLocalizer::convertToLocalizedNumber): (WebCore::matches): (WebCore::NumberLocalizer::detectSignAndGetDigitRange): (WebCore::NumberLocalizer::matchedDecimalSymbolIndex): (WebCore::NumberLocalizer::convertFromLocalizedNumber): (WebCore::NumberLocalizer::localizedDecimalSeparator): * platform/text/NumberLocalizer.h: Added. (NumberLocalizer): (WebCore::NumberLocalizer::NumberLocalizer): Canonical link: https://commits.webkit.org/110830@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
b8b5d32
commit f0d37e1
Showing
6 changed files
with
337 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.