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

Unified Diff: Source/core/rendering/svg/SVGRootInlineBox.cpp

Issue 18309003: Inroduce toSVGInlineTextBox, and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/SVGRenderTreeAsText.cpp ('k') | Source/core/rendering/svg/SVGTextQuery.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGRootInlineBox.cpp
diff --git a/Source/core/rendering/svg/SVGRootInlineBox.cpp b/Source/core/rendering/svg/SVGRootInlineBox.cpp
index e14d299b9d1b9f52576a023eb5a9447b7f1440ea..03b364bc93ef1fd9e2a65ed69fdccd00a2ffa6b6 100644
--- a/Source/core/rendering/svg/SVGRootInlineBox.cpp
+++ b/Source/core/rendering/svg/SVGRootInlineBox.cpp
@@ -48,7 +48,7 @@ void SVGRootInlineBox::paint(PaintInfo& paintInfo, const LayoutPoint&, LayoutUni
if (hasSelection) {
for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
if (child->isSVGInlineTextBox())
- static_cast<SVGInlineTextBox*>(child)->paintSelectionBackground(childPaintInfo);
+ toSVGInlineTextBox(child)->paintSelectionBackground(childPaintInfo);
else if (child->isSVGInlineFlowBox())
static_cast<SVGInlineFlowBox*>(child)->paintSelectionBackground(childPaintInfo);
}
@@ -58,7 +58,7 @@ void SVGRootInlineBox::paint(PaintInfo& paintInfo, const LayoutPoint&, LayoutUni
if (renderingContext.isRenderingPrepared()) {
for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
if (child->isSVGInlineTextBox())
- SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer(toRenderSVGInlineText(static_cast<SVGInlineTextBox*>(child)->textRenderer()));
+ SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer(toRenderSVGInlineText(toSVGInlineTextBox(child)->textRenderer()));
child->paint(paintInfo, LayoutPoint(), 0, 0);
}
@@ -105,9 +105,7 @@ void SVGRootInlineBox::layoutCharactersInTextBoxes(InlineFlowBox* start, SVGText
if (child->isSVGInlineTextBox()) {
ASSERT(child->renderer());
ASSERT(child->renderer()->isSVGInlineText());
-
- SVGInlineTextBox* textBox = static_cast<SVGInlineTextBox*>(child);
- characterLayout.layoutInlineTextBox(textBox);
+ characterLayout.layoutInlineTextBox(toSVGInlineTextBox(child));
} else {
// Skip generated content.
Node* node = child->renderer()->node();
@@ -143,7 +141,7 @@ void SVGRootInlineBox::layoutChildBoxes(InlineFlowBox* start, FloatRect* childRe
ASSERT(child->renderer());
ASSERT(child->renderer()->isSVGInlineText());
- SVGInlineTextBox* textBox = static_cast<SVGInlineTextBox*>(child);
+ SVGInlineTextBox* textBox = toSVGInlineTextBox(child);
boxRect = textBox->calculateBoundaries();
textBox->setX(boxRect.x());
textBox->setY(boxRect.y());
@@ -283,8 +281,8 @@ static inline void reverseInlineBoxRangeAndValueListsIfNeeded(void* userData, Ve
continue;
}
- SVGInlineTextBox* firstTextBox = static_cast<SVGInlineTextBox*>(*first);
- SVGInlineTextBox* lastTextBox = static_cast<SVGInlineTextBox*>(*last);
+ SVGInlineTextBox* firstTextBox = toSVGInlineTextBox(*first);
+ SVGInlineTextBox* lastTextBox = toSVGInlineTextBox(*last);
// Reordering is only necessary for BiDi text that is _absolutely_ positioned.
if (firstTextBox->len() == 1 && firstTextBox->len() == lastTextBox->len()) {
« no previous file with comments | « Source/core/rendering/svg/SVGRenderTreeAsText.cpp ('k') | Source/core/rendering/svg/SVGTextQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698