diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-25 20:38:53 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-25 20:38:53 +0000 |
commit | 8891d14891423a0bf861fb6cb8a88cc2b0b11d8e (patch) | |
tree | 286765dee398d8ef885c8895a06834063b53cdee /app/l10n_util.cc | |
parent | cb34b251707323165c85b7079467e9a03c65af8e (diff) | |
download | chromium_src-8891d14891423a0bf861fb6cb8a88cc2b0b11d8e.zip chromium_src-8891d14891423a0bf861fb6cb8a88cc2b0b11d8e.tar.gz chromium_src-8891d14891423a0bf861fb6cb8a88cc2b0b11d8e.tar.bz2 |
remove ICU includes from l10n_util.h
95% of users of l10n_util use it for some functions; the other 5%
want some complicated templates that pull in a ton of ICU headers
as well.
Before this change, the average includer of l10n_util.h pulled in
an additional 80 subheaders because of it.
Additionally, #including ICU headers from a header makes the includee
depend on having the ICU include path in the -I header.
Review URL: http://codereview.chromium.org/515059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/l10n_util.cc')
-rw-r--r-- | app/l10n_util.cc | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc index 9f81006..9f28842 100644 --- a/app/l10n_util.cc +++ b/app/l10n_util.cc @@ -5,9 +5,11 @@ #include "app/l10n_util.h" #include <cstdlib> + #include "app/app_paths.h" #include "app/app_switches.h" #include "app/gfx/canvas.h" +#include "app/l10n_util_collator.h" #include "app/resource_bundle.h" #include "base/command_line.h" #include "base/file_util.h" @@ -19,6 +21,10 @@ #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "build/build_config.h" +#include "unicode/coll.h" +#include "unicode/locid.h" +#include "unicode/rbbi.h" +#include "unicode/uchar.h" #include "unicode/uscript.h" #if defined(TOOLKIT_GTK) @@ -1015,53 +1021,4 @@ void GetAcceptLanguagesForLocale(const std::string& display_locale, } } -BiDiLineIterator::~BiDiLineIterator() { - if (bidi_) { - ubidi_close(bidi_); - bidi_ = NULL; - } -} - -UBool BiDiLineIterator::Open(const std::wstring& text, - bool right_to_left, - bool url) { - DCHECK(bidi_ == NULL); - UErrorCode error = U_ZERO_ERROR; - bidi_ = ubidi_openSized(static_cast<int>(text.length()), 0, &error); - if (U_FAILURE(error)) - return false; - if (right_to_left && url) - ubidi_setReorderingMode(bidi_, UBIDI_REORDER_RUNS_ONLY); -#if defined(WCHAR_T_IS_UTF32) - const string16 text_utf16 = WideToUTF16(text); -#else - const std::wstring &text_utf16 = text; -#endif // U_SIZEOF_WCHAR_T != 4 - ubidi_setPara(bidi_, text_utf16.data(), static_cast<int>(text_utf16.length()), - right_to_left ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR, - NULL, &error); - return U_SUCCESS(error); -} - -int BiDiLineIterator::CountRuns() { - DCHECK(bidi_ != NULL); - UErrorCode error = U_ZERO_ERROR; - const int runs = ubidi_countRuns(bidi_, &error); - return U_SUCCESS(error) ? runs : 0; -} - -UBiDiDirection BiDiLineIterator::GetVisualRun(int index, - int* start, - int* length) { - DCHECK(bidi_ != NULL); - return ubidi_getVisualRun(bidi_, index, start, length); -} - -void BiDiLineIterator::GetLogicalRun(int start, - int* end, - UBiDiLevel* level) { - DCHECK(bidi_ != NULL); - ubidi_getLogicalRun(bidi_, start, end, level); -} - } // namespace l10n_util |