Title: [197018] trunk/Source/WebCore
- Revision
- 197018
- Author
- [email protected]
- Date
- 2016-02-23 23:20:30 -0800 (Tue, 23 Feb 2016)
Log Message
Support building LocaleICU with light ICU (UCONFIG_NO_FORMATTING)
https://bugs.webkit.org/show_bug.cgi?id=154484
Patch by Olivier Blin <[email protected]> on 2016-02-23
Reviewed by Darin Adler.
In this mode, this makes LocaleICU with UCONFIG_NO_FORMATTING
essentially the same as LocaleNone, but allows to keep using ICU for
other features.
* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::LocaleICU):
(WebCore::LocaleICU::~LocaleICU):
(WebCore::LocaleICU::initializeLocaleData):
* platform/text/LocaleICU.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (197017 => 197018)
--- trunk/Source/WebCore/ChangeLog 2016-02-24 07:11:35 UTC (rev 197017)
+++ trunk/Source/WebCore/ChangeLog 2016-02-24 07:20:30 UTC (rev 197018)
@@ -1,3 +1,20 @@
+2016-02-23 Olivier Blin <[email protected]>
+
+ Support building LocaleICU with light ICU (UCONFIG_NO_FORMATTING)
+ https://bugs.webkit.org/show_bug.cgi?id=154484
+
+ Reviewed by Darin Adler.
+
+ In this mode, this makes LocaleICU with UCONFIG_NO_FORMATTING
+ essentially the same as LocaleNone, but allows to keep using ICU for
+ other features.
+
+ * platform/text/LocaleICU.cpp:
+ (WebCore::LocaleICU::LocaleICU):
+ (WebCore::LocaleICU::~LocaleICU):
+ (WebCore::LocaleICU::initializeLocaleData):
+ * platform/text/LocaleICU.h:
+
2016-02-23 Myles C. Maxfield <[email protected]>
Remove dead FontLoader code
Modified: trunk/Source/WebCore/platform/text/LocaleICU.cpp (197017 => 197018)
--- trunk/Source/WebCore/platform/text/LocaleICU.cpp 2016-02-24 07:11:35 UTC (rev 197017)
+++ trunk/Source/WebCore/platform/text/LocaleICU.cpp 2016-02-24 07:20:30 UTC (rev 197018)
@@ -50,8 +50,10 @@
LocaleICU::LocaleICU(const char* locale)
: m_locale(locale)
+#if !UCONFIG_NO_FORMATTING
, m_numberFormat(0)
, m_didCreateDecimalFormat(false)
+#endif
#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
, m_shortDateFormat(0)
, m_mediumTimeFormat(0)
@@ -64,7 +66,9 @@
LocaleICU::~LocaleICU()
{
+#if !UCONFIG_NO_FORMATTING
unum_close(m_numberFormat);
+#endif
#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
udat_close(m_shortDateFormat);
udat_close(m_mediumTimeFormat);
@@ -72,6 +76,7 @@
#endif
}
+#if !UCONFIG_NO_FORMATTING
String LocaleICU::decimalSymbol(UNumberFormatSymbol symbol)
{
UErrorCode status = U_ZERO_ERROR;
@@ -102,9 +107,11 @@
return String();
return String::adopt(buffer);
}
+#endif
void LocaleICU::initializeLocaleData()
{
+#if !UCONFIG_NO_FORMATTING
if (m_didCreateDecimalFormat)
return;
m_didCreateDecimalFormat = true;
@@ -128,6 +135,7 @@
symbols.append(decimalSymbol(UNUM_GROUPING_SEPARATOR_SYMBOL));
ASSERT(symbols.size() == DecimalSymbolsSize);
setLocaleData(symbols, decimalTextAttribute(UNUM_POSITIVE_PREFIX), decimalTextAttribute(UNUM_POSITIVE_SUFFIX), decimalTextAttribute(UNUM_NEGATIVE_PREFIX), decimalTextAttribute(UNUM_NEGATIVE_SUFFIX));
+#endif
}
#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
Modified: trunk/Source/WebCore/platform/text/LocaleICU.h (197017 => 197018)
--- trunk/Source/WebCore/platform/text/LocaleICU.h 2016-02-24 07:11:35 UTC (rev 197017)
+++ trunk/Source/WebCore/platform/text/LocaleICU.h 2016-02-24 07:20:30 UTC (rev 197018)
@@ -64,8 +64,10 @@
#endif
private:
+#if !UCONFIG_NO_FORMATTING
String decimalSymbol(UNumberFormatSymbol);
String decimalTextAttribute(UNumberFormatTextAttribute);
+#endif
virtual void initializeLocaleData() override;
#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
@@ -77,8 +79,11 @@
#endif
CString m_locale;
+
+#if !UCONFIG_NO_FORMATTING
UNumberFormat* m_numberFormat;
bool m_didCreateDecimalFormat;
+#endif
#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
std::unique_ptr<Vector<String>> m_monthLabels;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes