OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include <stdio.h> | 39 #include <stdio.h> |
40 #endif | 40 #endif |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 MarkerRemoverPredicate::MarkerRemoverPredicate(const Vector<String>& words) | 44 MarkerRemoverPredicate::MarkerRemoverPredicate(const Vector<String>& words) |
45 : m_words(words) | 45 : m_words(words) |
46 { | 46 { |
47 } | 47 } |
48 | 48 |
49 bool MarkerRemoverPredicate::operator()(const DocumentMarker& documentMarker, | 49 bool MarkerRemoverPredicate::operator()(const DocumentMarker& documentMarker, co
nst Text& textNode) const |
50 const Text& textNode) const { | 50 { |
51 unsigned start = documentMarker.startOffset(); | 51 unsigned start = documentMarker.startOffset(); |
52 unsigned length = documentMarker.endOffset() - documentMarker.startOffset(); | 52 unsigned length = documentMarker.endOffset() - documentMarker.startOffset(); |
53 | 53 |
54 String markerText = textNode.data().substring(start, length); | 54 String markerText = textNode.data().substring(start, length); |
55 return m_words.contains(markerText); | 55 return m_words.contains(markerText); |
56 } | 56 } |
57 | 57 |
58 namespace { | 58 namespace { |
59 | 59 |
60 DocumentMarker::MarkerTypeIndex MarkerTypeToMarkerIndex(DocumentMarker::MarkerTy
pe type) | 60 DocumentMarker::MarkerTypeIndex MarkerTypeToMarkerIndex(DocumentMarker::MarkerTy
pe type) |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 | 763 |
764 } // namespace blink | 764 } // namespace blink |
765 | 765 |
766 #ifndef NDEBUG | 766 #ifndef NDEBUG |
767 void showDocumentMarkers(const blink::DocumentMarkerController* controller) | 767 void showDocumentMarkers(const blink::DocumentMarkerController* controller) |
768 { | 768 { |
769 if (controller) | 769 if (controller) |
770 controller->showMarkers(); | 770 controller->showMarkers(); |
771 } | 771 } |
772 #endif | 772 #endif |
OLD | NEW |