| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
| 3 * Copyright (C) 2005 Alexey Proskuryakov. | 3 * Copyright (C) 2005 Alexey Proskuryakov. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1915 usearch_setPattern(searcher, m_target.characters(), targetLength, &status); | 1915 usearch_setPattern(searcher, m_target.characters(), targetLength, &status); |
| 1916 ASSERT(status == U_ZERO_ERROR); | 1916 ASSERT(status == U_ZERO_ERROR); |
| 1917 | 1917 |
| 1918 // The kana workaround requires a normalized copy of the target string. | 1918 // The kana workaround requires a normalized copy of the target string. |
| 1919 if (m_targetRequiresKanaWorkaround) | 1919 if (m_targetRequiresKanaWorkaround) |
| 1920 normalizeCharacters(m_target.characters(), m_target.length(), m_normaliz
edTarget); | 1920 normalizeCharacters(m_target.characters(), m_target.length(), m_normaliz
edTarget); |
| 1921 } | 1921 } |
| 1922 | 1922 |
| 1923 inline SearchBuffer::~SearchBuffer() | 1923 inline SearchBuffer::~SearchBuffer() |
| 1924 { | 1924 { |
| 1925 // Leave the static object pointing to a valid string. |
| 1926 UErrorCode status = U_ZERO_ERROR; |
| 1927 usearch_setPattern(WebCore::searcher(), &newlineCharacter, 1, &status); |
| 1928 ASSERT(status == U_ZERO_ERROR); |
| 1929 |
| 1925 unlockSearcher(); | 1930 unlockSearcher(); |
| 1926 } | 1931 } |
| 1927 | 1932 |
| 1928 inline size_t SearchBuffer::append(const UChar* characters, size_t length) | 1933 inline size_t SearchBuffer::append(const UChar* characters, size_t length) |
| 1929 { | 1934 { |
| 1930 ASSERT(length); | 1935 ASSERT(length); |
| 1931 | 1936 |
| 1932 if (m_atBreak) { | 1937 if (m_atBreak) { |
| 1933 m_buffer.shrink(0); | 1938 m_buffer.shrink(0); |
| 1934 m_prefixLength = 0; | 1939 m_prefixLength = 0; |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2549 if (!matchLength) | 2554 if (!matchLength) |
| 2550 return collapsedToBoundary(range, !(options & Backwards)); | 2555 return collapsedToBoundary(range, !(options & Backwards)); |
| 2551 } | 2556 } |
| 2552 | 2557 |
| 2553 // Then, find the document position of the start and the end of the text. | 2558 // Then, find the document position of the start and the end of the text. |
| 2554 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls
); | 2559 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls
); |
| 2555 return characterSubrange(computeRangeIterator, matchStart, matchLength); | 2560 return characterSubrange(computeRangeIterator, matchStart, matchLength); |
| 2556 } | 2561 } |
| 2557 | 2562 |
| 2558 } | 2563 } |
| OLD | NEW |