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

Side by Side Diff: Source/core/rendering/svg/SVGTextQuery.cpp

Issue 141273002: Code problems detected by cppcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 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 | « Source/core/rendering/svg/RenderSVGShape.h ('k') | Source/core/svg/SVGAnimateMotionElement.cpp » ('j') | 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 break; 208 break;
209 209
210 lastPositionOffset = positionOffset; 210 lastPositionOffset = positionOffset;
211 positionOffset += metrics.length(); 211 positionOffset += metrics.length();
212 } 212 }
213 213
214 if (!alterStartPosition && !alterEndPosition) 214 if (!alterStartPosition && !alterEndPosition)
215 return; 215 return;
216 216
217 if (lastPositionOffset != -1 && lastPositionOffset - positionOffset > 1) { 217 if (lastPositionOffset != -1 && lastPositionOffset - positionOffset > 1) {
218 if (alterStartPosition && startPosition > lastPositionOffset && startPos ition < static_cast<int>(positionOffset)) { 218 if (alterStartPosition && startPosition > lastPositionOffset && startPos ition < static_cast<int>(positionOffset))
219 startPosition = lastPositionOffset; 219 startPosition = lastPositionOffset;
220 alterStartPosition = false;
221 }
222 220
223 if (alterEndPosition && endPosition > lastPositionOffset && endPosition < static_cast<int>(positionOffset)) { 221 if (alterEndPosition && endPosition > lastPositionOffset && endPosition < static_cast<int>(positionOffset))
224 endPosition = positionOffset; 222 endPosition = positionOffset;
225 alterEndPosition = false;
226 }
227 } 223 }
228 } 224 }
229 225
230 // numberOfCharacters() implementation 226 // numberOfCharacters() implementation
231 bool SVGTextQuery::numberOfCharactersCallback(Data*, const SVGTextFragment&) con st 227 bool SVGTextQuery::numberOfCharactersCallback(Data*, const SVGTextFragment&) con st
232 { 228 {
233 // no-op 229 // no-op
234 return false; 230 return false;
235 } 231 }
236 232
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 return -1; 542 return -1;
547 543
548 CharacterNumberAtPositionData data(position); 544 CharacterNumberAtPositionData data(position);
549 if (!executeQuery(&data, &SVGTextQuery::characterNumberAtPositionCallback)) 545 if (!executeQuery(&data, &SVGTextQuery::characterNumberAtPositionCallback))
550 return -1; 546 return -1;
551 547
552 return data.processedCharacters; 548 return data.processedCharacters;
553 } 549 }
554 550
555 } 551 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.h ('k') | Source/core/svg/SVGAnimateMotionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698