Ejemplo n.º 1
0
void DocumentMarkerController::removeUserSpellingMarker(Node* node, unsigned start, unsigned length)
{
    if (!node || !length)
        return;

    Node* spellingNode = userSpellingNode(node);
    if (!spellingNode)
        return;

    removeMarkers(spellingNode, start, length, DocumentMarker::UserSpelling, DoNotRemovePartiallyOverlappingMarker);
}
Ejemplo n.º 2
0
void DocumentMarkerController::removeMarkers(Range* range, DocumentMarker::MarkerTypes markerTypes, RemovePartiallyOverlappingMarkerOrNot shouldRemovePartiallyOverlappingMarker)
{
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        if (!possiblyHasMarkers(markerTypes))
            return;
        ASSERT(!m_markers.isEmpty());

        RefPtr<Range> textPiece = markedText.range();
        int startOffset = textPiece->startOffset();
        int endOffset = textPiece->endOffset();
        removeMarkers(textPiece->startContainer(), startOffset, endOffset - startOffset, markerTypes, shouldRemovePartiallyOverlappingMarker);
    }
}