| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 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 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 textChecker().checkSpellingOfString( | 1077 textChecker().checkSpellingOfString( |
| 1078 String(characters.data() + wordStart, wordLength), &misspellingLocation, | 1078 String(characters.data() + wordStart, wordLength), &misspellingLocation, |
| 1079 &misspellingLength); | 1079 &misspellingLength); |
| 1080 if (misspellingLength > 0) { | 1080 if (misspellingLength > 0) { |
| 1081 DCHECK_GE(misspellingLocation, 0); | 1081 DCHECK_GE(misspellingLocation, 0); |
| 1082 DCHECK_LE(misspellingLocation + misspellingLength, wordLength); | 1082 DCHECK_LE(misspellingLocation + misspellingLength, wordLength); |
| 1083 TextCheckingResult misspelling; | 1083 TextCheckingResult misspelling; |
| 1084 misspelling.decoration = TextDecorationTypeSpelling; | 1084 misspelling.decoration = TextDecorationTypeSpelling; |
| 1085 misspelling.location = wordStart + misspellingLocation; | 1085 misspelling.location = wordStart + misspellingLocation; |
| 1086 misspelling.length = misspellingLength; | 1086 misspelling.length = misspellingLength; |
| 1087 results.append(misspelling); | 1087 results.push_back(misspelling); |
| 1088 } | 1088 } |
| 1089 wordStart = wordEnd; | 1089 wordStart = wordEnd; |
| 1090 } | 1090 } |
| 1091 return results; | 1091 return results; |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 std::pair<String, int> SpellChecker::findFirstMisspelling(const Position& start, | 1094 std::pair<String, int> SpellChecker::findFirstMisspelling(const Position& start, |
| 1095 const Position& end) { | 1095 const Position& end) { |
| 1096 String misspelledWord; | 1096 String misspelledWord; |
| 1097 | 1097 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 startOfNextParagraph(createVisiblePosition(paragraphEnd)); | 1170 startOfNextParagraph(createVisiblePosition(paragraphEnd)); |
| 1171 paragraphStart = newParagraphStart.toParentAnchoredPosition(); | 1171 paragraphStart = newParagraphStart.toParentAnchoredPosition(); |
| 1172 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); | 1172 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); |
| 1173 firstIteration = false; | 1173 firstIteration = false; |
| 1174 totalLengthProcessed += currentLength; | 1174 totalLengthProcessed += currentLength; |
| 1175 } | 1175 } |
| 1176 return std::make_pair(firstFoundItem, firstFoundOffset); | 1176 return std::make_pair(firstFoundItem, firstFoundOffset); |
| 1177 } | 1177 } |
| 1178 | 1178 |
| 1179 } // namespace blink | 1179 } // namespace blink |
| OLD | NEW |