Lines Matching refs:text

44 // Represents the locale-specific ICU text direction.
97 // GtkWidget's default text direction consistent with ICU's text direction.
98 // Because in this case ICU's text direction will be used instead.
131 TextDirection GetFirstStrongCharacterDirection(const string16& text) {
132 const UChar* string = text.c_str();
133 size_t length = text.length();
161 TextDirection GetFirstStrongCharacterDirection(const std::wstring& text) {
162 return GetFirstStrongCharacterDirection(WideToUTF16(text));
167 bool AdjustStringForLocaleDirection(string16* text) {
168 if (!IsRTL() || text->empty())
173 bool has_rtl_chars = StringContainsStrongRTLChars(*text);
175 WrapStringWithLTRFormatting(text);
177 WrapStringWithRTLFormatting(text);
182 bool AdjustStringForLocaleDirection(string16* text) {
208 if (text->empty())
213 bool has_rtl_chars = StringContainsStrongRTLChars(*text);
215 WrapStringWithRTLFormatting(text);
216 text->insert(0, 1, kLeftToRightMark);
217 text->push_back(kLeftToRightMark);
219 WrapStringWithRTLFormatting(text);
220 text->insert(0, 1, kRightToLeftMark);
221 text->push_back(kRightToLeftMark);
223 WrapStringWithLTRFormatting(text);
224 text->insert(0, 1, kRightToLeftMark);
225 text->push_back(kRightToLeftMark);
234 bool AdjustStringForLocaleDirection(std::wstring* text) {
235 string16 temp = WideToUTF16(*text);
238 *text = UTF16ToWide(temp);
245 bool StringContainsStrongRTLChars(const string16& text) {
246 const UChar* string = text.c_str();
247 size_t length = text.length();
267 bool StringContainsStrongRTLChars(const std::wstring& text) {
268 return StringContainsStrongRTLChars(WideToUTF16(text));
272 void WrapStringWithLTRFormatting(string16* text) {
273 if (text->empty())
277 text->insert(0, 1, kLeftToRightEmbeddingMark);
280 text->push_back(kPopDirectionalFormatting);
284 void WrapStringWithLTRFormatting(std::wstring* text) {
285 if (text->empty())
289 text->insert(0, 1, static_cast<wchar_t>(kLeftToRightEmbeddingMark));
292 text->push_back(static_cast<wchar_t>(kPopDirectionalFormatting));
296 void WrapStringWithRTLFormatting(string16* text) {
297 if (text->empty())
301 text->insert(0, 1, kRightToLeftEmbeddingMark);
304 text->push_back(kPopDirectionalFormatting);
308 void WrapStringWithRTLFormatting(std::wstring* text) {
309 if (text->empty())
313 text->insert(0, 1, static_cast<wchar_t>(kRightToLeftEmbeddingMark));
316 text->push_back(static_cast<wchar_t>(kPopDirectionalFormatting));
338 string16 GetDisplayStringInLTRDirectionality(const string16& text) {
340 return text;
341 string16 text_mutable(text);
346 const string16 StripWrappingBidiControlCharacters(const string16& text) {
347 if (text.empty())
348 return text;
350 char16 begin = text[begin_index];
356 size_t end_index = text.length() - 1;
357 if (text[end_index] == kPopDirectionalFormatting)
359 return text.substr(begin_index, end_index - begin_index + 1);