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