OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 | 262 |
263 // Compute range of misspelled word | 263 // Compute range of misspelled word |
264 Position misspellingStart = m_start; | 264 Position misspellingStart = m_start; |
265 Position misspellingEnd = m_end; | 265 Position misspellingEnd = m_end; |
266 TextIterator::subrange(misspellingStart, misspellingEnd, current ChunkOffset + misspellingLocation, misspellingLength); | 266 TextIterator::subrange(misspellingStart, misspellingEnd, current ChunkOffset + misspellingLocation, misspellingLength); |
267 | 267 |
268 // Remember first-encountered misspelling and its offset. | 268 // Remember first-encountered misspelling and its offset. |
269 if (!firstMisspelling) { | 269 if (!firstMisspelling) { |
270 firstMisspellingOffset = currentChunkOffset + misspellingLoc ation; | 270 firstMisspellingOffset = currentChunkOffset + misspellingLoc ation; |
271 firstMisspelling = it.substring(misspellingLocation, misspel lingLength); | 271 firstMisspelling = it.substring(misspellingLocation, misspel lingLength); |
272 firstMisspellingRange = Range::create(misspellingStart.conta inerNode()->document(), m_start, m_end); | 272 firstMisspellingRange = Range::create(misspellingStart.conta inerNode()->document(), misspellingStart, misspellingEnd); |
yosin_UTC9
2015/05/21 02:28:49
It seems current code is correct, since |misspelli
| |
273 } | 273 } |
274 | 274 |
275 // Store marker for misspelled word. | 275 // Store marker for misspelled word. |
276 misspellingStart.containerNode()->document().markers().addMarker (misspellingStart, misspellingEnd, DocumentMarker::Spelling); | 276 misspellingStart.containerNode()->document().markers().addMarker (misspellingStart, misspellingEnd, DocumentMarker::Spelling); |
277 | 277 |
278 // Bail out if we're marking only the first misspelling, and not all instances. | 278 // Bail out if we're marking only the first misspelling, and not all instances. |
279 if (!markAll) | 279 if (!markAll) |
280 break; | 280 break; |
281 } | 281 } |
282 } | 282 } |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
565 return false; | 565 return false; |
566 | 566 |
567 const Settings* settings = frame->settings(); | 567 const Settings* settings = frame->settings(); |
568 if (!settings) | 568 if (!settings) |
569 return false; | 569 return false; |
570 | 570 |
571 return settings->unifiedTextCheckerEnabled(); | 571 return settings->unifiedTextCheckerEnabled(); |
572 } | 572 } |
573 | 573 |
574 } | 574 } |
OLD | NEW |