OLD | NEW |
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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 493 |
494 int startPosition = data->position; | 494 int startPosition = data->position; |
495 int endPosition = startPosition + 1; | 495 int endPosition = startPosition + 1; |
496 if (!mapStartEndPositionsIntoFragmentCoordinates(queryData, fragment, startP
osition, endPosition)) | 496 if (!mapStartEndPositionsIntoFragmentCoordinates(queryData, fragment, startP
osition, endPosition)) |
497 return false; | 497 return false; |
498 | 498 |
499 calculateGlyphBoundaries(queryData, fragment, startPosition, data->extent); | 499 calculateGlyphBoundaries(queryData, fragment, startPosition, data->extent); |
500 return true; | 500 return true; |
501 } | 501 } |
502 | 502 |
503 FloatRect SVGTextQuery::extentOfCharacter(unsigned position) const | 503 SVGRect SVGTextQuery::extentOfCharacter(unsigned position) const |
504 { | 504 { |
505 if (m_textBoxes.isEmpty()) | 505 if (m_textBoxes.isEmpty()) |
506 return FloatRect(); | 506 return SVGRect(); |
507 | 507 |
508 ExtentOfCharacterData data(position); | 508 ExtentOfCharacterData data(position); |
509 executeQuery(&data, &SVGTextQuery::extentOfCharacterCallback); | 509 executeQuery(&data, &SVGTextQuery::extentOfCharacterCallback); |
510 return data.extent; | 510 return data.extent; |
511 } | 511 } |
512 | 512 |
513 // characterNumberAtPosition() implementation | 513 // characterNumberAtPosition() implementation |
514 struct CharacterNumberAtPositionData : SVGTextQuery::Data { | 514 struct CharacterNumberAtPositionData : SVGTextQuery::Data { |
515 CharacterNumberAtPositionData(const FloatPoint& queryPosition) | 515 CharacterNumberAtPositionData(const FloatPoint& queryPosition) |
516 : position(queryPosition) | 516 : position(queryPosition) |
(...skipping 30 matching lines...) Expand all Loading... |
547 return -1; | 547 return -1; |
548 | 548 |
549 CharacterNumberAtPositionData data(position); | 549 CharacterNumberAtPositionData data(position); |
550 if (!executeQuery(&data, &SVGTextQuery::characterNumberAtPositionCallback)) | 550 if (!executeQuery(&data, &SVGTextQuery::characterNumberAtPositionCallback)) |
551 return -1; | 551 return -1; |
552 | 552 |
553 return data.processedCharacters; | 553 return data.processedCharacters; |
554 } | 554 } |
555 | 555 |
556 } | 556 } |
OLD | NEW |