OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // static | 64 // static |
65 PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask tex
tCheckingOptions, TextCheckingProcessType processType, PassRefPtr<Range> checkin
gRange, PassRefPtr<Range> paragraphRange, int requestNubmer) | 65 PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask tex
tCheckingOptions, TextCheckingProcessType processType, PassRefPtr<Range> checkin
gRange, PassRefPtr<Range> paragraphRange, int requestNubmer) |
66 { | 66 { |
67 ASSERT(checkingRange); | 67 ASSERT(checkingRange); |
68 ASSERT(paragraphRange); | 68 ASSERT(paragraphRange); |
69 | 69 |
70 String text = checkingRange->text(); | 70 String text = checkingRange->text(); |
71 if (!text.length()) | 71 if (!text.length()) |
72 return PassRefPtr<SpellCheckRequest>(); | 72 return PassRefPtr<SpellCheckRequest>(); |
73 | 73 |
74 const Vector<DocumentMarker*>& markers = checkingRange->ownerDocument()->mar
kers()->markersInRange(checkingRange.get(), DocumentMarker::Spelling | DocumentM
arker::Grammar); | 74 const Vector<DocumentMarker*>& markers = checkingRange->ownerDocument().mark
ers()->markersInRange(checkingRange.get(), DocumentMarker::Spelling | DocumentMa
rker::Grammar); |
75 Vector<uint32_t> hashes(markers.size()); | 75 Vector<uint32_t> hashes(markers.size()); |
76 Vector<unsigned> offsets(markers.size()); | 76 Vector<unsigned> offsets(markers.size()); |
77 for (size_t i = 0; i < markers.size(); i++) { | 77 for (size_t i = 0; i < markers.size(); i++) { |
78 hashes[i] = markers[i]->hash(); | 78 hashes[i] = markers[i]->hash(); |
79 offsets[i] = markers[i]->startOffset(); | 79 offsets[i] = markers[i]->startOffset(); |
80 } | 80 } |
81 | 81 |
82 return adoptRef(new SpellCheckRequest(checkingRange, paragraphRange, text, t
extCheckingOptions, processType, hashes, offsets, requestNubmer)); | 82 return adoptRef(new SpellCheckRequest(checkingRange, paragraphRange, text, t
extCheckingOptions, processType, hashes, offsets, requestNubmer)); |
83 } | 83 } |
84 | 84 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 didCheck(sequence, results); | 261 didCheck(sequence, results); |
262 } | 262 } |
263 | 263 |
264 void SpellCheckRequester::didCheckCancel(int sequence) | 264 void SpellCheckRequester::didCheckCancel(int sequence) |
265 { | 265 { |
266 Vector<TextCheckingResult> results; | 266 Vector<TextCheckingResult> results; |
267 didCheck(sequence, results); | 267 didCheck(sequence, results); |
268 } | 268 } |
269 | 269 |
270 } // namespace WebCore | 270 } // namespace WebCore |
OLD | NEW |