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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
410 for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::Marke rTypeIndexesCount; ++markerListIndex) { | 410 for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::Marke rTypeIndexesCount; ++markerListIndex) { |
411 OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; | 411 OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; |
412 for (size_t j = 0; list.get() && j < list->size(); ++j) | 412 for (size_t j = 0; list.get() && j < list->size(); ++j) |
413 result.append(list->at(j).get()); | 413 result.append(list->at(j).get()); |
414 } | 414 } |
415 } | 415 } |
416 std::sort(result.begin(), result.end(), compareByStart); | 416 std::sort(result.begin(), result.end(), compareByStart); |
417 return result; | 417 return result; |
418 } | 418 } |
419 | 419 |
420 DocumentMarkerAndNodeVector DocumentMarkerController::markerNodePairs() | |
groby-ooo-7-16
2014/07/30 21:13:27
This seems to copy a lot of data, depending on the
Klemen Forstnerič
2014/07/31 17:14:00
That seems like a great idea, I'll add a removeMar
groby-ooo-7-16
2014/08/01 00:13:22
Acknowledged.
Klemen Forstnerič
2014/08/01 21:58:17
Done.
| |
421 { | |
422 DocumentMarkerAndNodeVector result; | |
423 for (MarkerMap::iterator i = m_markers.begin(); i != m_markers.end(); ++i) { | |
424 MarkerLists* markers = i->value.get(); | |
425 for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::Marke rTypeIndexesCount; ++markerListIndex) { | |
426 OwnPtrWillBeMember<MarkerList>& list = (*markers)[markerListIndex]; | |
427 for (size_t j = 0; list.get() && j < list->size(); ++j) | |
428 result.append(std::make_pair(i->key, list->at(j).get())); | |
429 } | |
430 } | |
431 return result; | |
432 } | |
433 | |
420 DocumentMarkerVector DocumentMarkerController::markersInRange(Range* range, Docu mentMarker::MarkerTypes markerTypes) | 434 DocumentMarkerVector DocumentMarkerController::markersInRange(Range* range, Docu mentMarker::MarkerTypes markerTypes) |
421 { | 435 { |
422 if (!possiblyHasMarkers(markerTypes)) | 436 if (!possiblyHasMarkers(markerTypes)) |
423 return DocumentMarkerVector(); | 437 return DocumentMarkerVector(); |
424 | 438 |
425 DocumentMarkerVector foundMarkers; | 439 DocumentMarkerVector foundMarkers; |
426 | 440 |
427 Node* startContainer = range->startContainer(); | 441 Node* startContainer = range->startContainer(); |
428 ASSERT(startContainer); | 442 ASSERT(startContainer); |
429 Node* endContainer = range->endContainer(); | 443 Node* endContainer = range->endContainer(); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
729 | 743 |
730 } // namespace blink | 744 } // namespace blink |
731 | 745 |
732 #ifndef NDEBUG | 746 #ifndef NDEBUG |
733 void showDocumentMarkers(const blink::DocumentMarkerController* controller) | 747 void showDocumentMarkers(const blink::DocumentMarkerController* controller) |
734 { | 748 { |
735 if (controller) | 749 if (controller) |
736 controller->showMarkers(); | 750 controller->showMarkers(); |
737 } | 751 } |
738 #endif | 752 #endif |
OLD | NEW |