Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1037)

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGTextQuery.cpp

Issue 2610253004: Migrate WTF::Vector::append() to ::push_back() [part 9 of N] (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (child->isInlineFlowBox()) { 88 if (child->isInlineFlowBox()) {
89 // Skip generated content. 89 // Skip generated content.
90 if (!child->getLineLayoutItem().node()) 90 if (!child->getLineLayoutItem().node())
91 continue; 91 continue;
92 92
93 collectTextBoxesInFlowBox(toInlineFlowBox(child), textBoxes); 93 collectTextBoxesInFlowBox(toInlineFlowBox(child), textBoxes);
94 continue; 94 continue;
95 } 95 }
96 96
97 if (child->isSVGInlineTextBox()) 97 if (child->isSVGInlineTextBox())
98 textBoxes.append(toSVGInlineTextBox(child)); 98 textBoxes.push_back(toSVGInlineTextBox(child));
99 } 99 }
100 } 100 }
101 101
102 typedef bool ProcessTextFragmentCallback(QueryData*, const SVGTextFragment&); 102 typedef bool ProcessTextFragmentCallback(QueryData*, const SVGTextFragment&);
103 103
104 static bool queryTextBox(QueryData* queryData, 104 static bool queryTextBox(QueryData* queryData,
105 const SVGInlineTextBox* textBox, 105 const SVGInlineTextBox* textBox,
106 ProcessTextFragmentCallback fragmentCallback) { 106 ProcessTextFragmentCallback fragmentCallback) {
107 queryData->textBox = textBox; 107 queryData->textBox = textBox;
108 queryData->textLineLayout = 108 queryData->textLineLayout =
(...skipping 24 matching lines...) Expand all
133 return; 133 return;
134 } 134 }
135 } 135 }
136 136
137 static void collectTextBoxesInLogicalOrder( 137 static void collectTextBoxesInLogicalOrder(
138 LineLayoutSVGInlineText textLineLayout, 138 LineLayoutSVGInlineText textLineLayout,
139 Vector<SVGInlineTextBox*>& textBoxes) { 139 Vector<SVGInlineTextBox*>& textBoxes) {
140 textBoxes.shrink(0); 140 textBoxes.shrink(0);
141 for (InlineTextBox* textBox = textLineLayout.firstTextBox(); textBox; 141 for (InlineTextBox* textBox = textLineLayout.firstTextBox(); textBox;
142 textBox = textBox->nextTextBox()) 142 textBox = textBox->nextTextBox())
143 textBoxes.append(toSVGInlineTextBox(textBox)); 143 textBoxes.push_back(toSVGInlineTextBox(textBox));
144 std::sort(textBoxes.begin(), textBoxes.end(), InlineTextBox::compareByStart); 144 std::sort(textBoxes.begin(), textBoxes.end(), InlineTextBox::compareByStart);
145 } 145 }
146 146
147 // Execute a query in "logical" order starting at |queryRoot|. This means 147 // Execute a query in "logical" order starting at |queryRoot|. This means
148 // walking the lines boxes for each layout object in layout tree (pre)order. 148 // walking the lines boxes for each layout object in layout tree (pre)order.
149 static void logicalQuery(LayoutObject* queryRoot, 149 static void logicalQuery(LayoutObject* queryRoot,
150 QueryData* queryData, 150 QueryData* queryData,
151 ProcessTextFragmentCallback fragmentCallback) { 151 ProcessTextFragmentCallback fragmentCallback) {
152 if (!queryRoot) 152 if (!queryRoot)
153 return; 153 return;
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 } 617 }
618 618
619 int SVGTextQuery::characterNumberAtPosition(const FloatPoint& position) const { 619 int SVGTextQuery::characterNumberAtPosition(const FloatPoint& position) const {
620 CharacterNumberAtPositionData data(position); 620 CharacterNumberAtPositionData data(position);
621 spatialQuery(m_queryRootLayoutObject, &data, 621 spatialQuery(m_queryRootLayoutObject, &data,
622 characterNumberAtPositionCallback); 622 characterNumberAtPositionCallback);
623 return data.characterNumberWithin(m_queryRootLayoutObject); 623 return data.characterNumberWithin(m_queryRootLayoutObject);
624 } 624 }
625 625
626 } // namespace blink 626 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698