| 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 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 } | 1381 } |
| 1382 | 1382 |
| 1383 advanceToNextMisspelling(true); | 1383 advanceToNextMisspelling(true); |
| 1384 client().showSpellingUI(true); | 1384 client().showSpellingUI(true); |
| 1385 } | 1385 } |
| 1386 | 1386 |
| 1387 void Editor::clearMisspellingsAndBadGrammar(const VisibleSelection &movingSelect
ion) | 1387 void Editor::clearMisspellingsAndBadGrammar(const VisibleSelection &movingSelect
ion) |
| 1388 { | 1388 { |
| 1389 RefPtr<Range> selectedRange = movingSelection.toNormalizedRange(); | 1389 RefPtr<Range> selectedRange = movingSelection.toNormalizedRange(); |
| 1390 if (selectedRange) | 1390 if (selectedRange) |
| 1391 frame().document()->markers()->removeMarkers(selectedRange.get(), Docume
ntMarker::MisspellingMarkers()); | 1391 frame().document()->markers()->removeMarkers(selectedRange.get(), Docume
ntMarker::misspellingMarkers()); |
| 1392 } | 1392 } |
| 1393 | 1393 |
| 1394 void Editor::markMisspellingsAndBadGrammar(const VisibleSelection &movingSelecti
on) | 1394 void Editor::markMisspellingsAndBadGrammar(const VisibleSelection &movingSelecti
on) |
| 1395 { | 1395 { |
| 1396 markMisspellingsAndBadGrammar(movingSelection, isContinuousSpellCheckingEnab
led() && isGrammarCheckingEnabled(), movingSelection); | 1396 markMisspellingsAndBadGrammar(movingSelection, isContinuousSpellCheckingEnab
led() && isGrammarCheckingEnabled(), movingSelection); |
| 1397 } | 1397 } |
| 1398 | 1398 |
| 1399 void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart,
const VisibleSelection& selectionAfterTyping) | 1399 void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart,
const VisibleSelection& selectionAfterTyping) |
| 1400 { | 1400 { |
| 1401 if (unifiedTextCheckerEnabled()) { | 1401 if (unifiedTextCheckerEnabled()) { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 // Now we remove markers on everything between startOfFirstWord and endOfLas
tWord. | 1743 // Now we remove markers on everything between startOfFirstWord and endOfLas
tWord. |
| 1744 // However, if an autocorrection change a single word to multiple words, we
want to remove correction mark from all the | 1744 // However, if an autocorrection change a single word to multiple words, we
want to remove correction mark from all the |
| 1745 // resulted words even we only edit one of them. For example, assuming autoc
orrection changes "avantgarde" to "avant | 1745 // resulted words even we only edit one of them. For example, assuming autoc
orrection changes "avantgarde" to "avant |
| 1746 // garde", we will have CorrectionIndicator marker on both words and on the
whitespace between them. If we then edit garde, | 1746 // garde", we will have CorrectionIndicator marker on both words and on the
whitespace between them. If we then edit garde, |
| 1747 // we would like to remove the marker from word "avant" and whitespace as we
ll. So we need to get the continous range of | 1747 // we would like to remove the marker from word "avant" and whitespace as we
ll. So we need to get the continous range of |
| 1748 // of marker that contains the word in question, and remove marker on that w
hole range. | 1748 // of marker that contains the word in question, and remove marker on that w
hole range. |
| 1749 Document* document = m_frame->document(); | 1749 Document* document = m_frame->document(); |
| 1750 ASSERT(document); | 1750 ASSERT(document); |
| 1751 RefPtr<Range> wordRange = Range::create(*document, startOfFirstWord.deepEqui
valent(), endOfLastWord.deepEquivalent()); | 1751 RefPtr<Range> wordRange = Range::create(*document, startOfFirstWord.deepEqui
valent(), endOfLastWord.deepEquivalent()); |
| 1752 | 1752 |
| 1753 document->markers()->removeMarkers(wordRange.get(), DocumentMarker::Misspell
ingMarkers(), DocumentMarkerController::RemovePartiallyOverlappingMarker); | 1753 document->markers()->removeMarkers(wordRange.get(), DocumentMarker::misspell
ingMarkers(), DocumentMarkerController::RemovePartiallyOverlappingMarker); |
| 1754 } | 1754 } |
| 1755 | 1755 |
| 1756 PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint) | 1756 PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint) |
| 1757 { | 1757 { |
| 1758 Document* document = m_frame->documentAtPoint(windowPoint); | 1758 Document* document = m_frame->documentAtPoint(windowPoint); |
| 1759 if (!document) | 1759 if (!document) |
| 1760 return 0; | 1760 return 0; |
| 1761 | 1761 |
| 1762 Frame* frame = document->frame(); | 1762 Frame* frame = document->frame(); |
| 1763 ASSERT(frame); | 1763 ASSERT(frame); |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2211 return WebCore::unifiedTextCheckerEnabled(m_frame); | 2211 return WebCore::unifiedTextCheckerEnabled(m_frame); |
| 2212 } | 2212 } |
| 2213 | 2213 |
| 2214 void Editor::toggleOverwriteModeEnabled() | 2214 void Editor::toggleOverwriteModeEnabled() |
| 2215 { | 2215 { |
| 2216 m_overwriteModeEnabled = !m_overwriteModeEnabled; | 2216 m_overwriteModeEnabled = !m_overwriteModeEnabled; |
| 2217 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); | 2217 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); |
| 2218 }; | 2218 }; |
| 2219 | 2219 |
| 2220 } // namespace WebCore | 2220 } // namespace WebCore |
| OLD | NEW |