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

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

Issue 24253004: Cleanup: Start using toFoo methods as part of newly adopted coding guideline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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/RenderTheme.cpp ('k') | Source/core/rendering/svg/SVGTextQuery.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) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006 Apple Computer Inc. 3 * Copyright (C) 2006 Apple Computer Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) 2008 Rob Buis <buis@kde.org> 5 * Copyright (C) 2008 Rob Buis <buis@kde.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 InlineTextBox* box = new SVGInlineTextBox(this); 103 InlineTextBox* box = new SVGInlineTextBox(this);
104 box->setHasVirtualLogicalHeight(); 104 box->setHasVirtualLogicalHeight();
105 return box; 105 return box;
106 } 106 }
107 107
108 LayoutRect RenderSVGInlineText::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit*) 108 LayoutRect RenderSVGInlineText::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit*)
109 { 109 {
110 if (!box || !box->isInlineTextBox()) 110 if (!box || !box->isInlineTextBox())
111 return LayoutRect(); 111 return LayoutRect();
112 112
113 InlineTextBox* textBox = static_cast<InlineTextBox*>(box); 113 InlineTextBox* textBox = toInlineTextBox(box);
114 if (static_cast<unsigned>(caretOffset) < textBox->start() || static_cast<uns igned>(caretOffset) > textBox->start() + textBox->len()) 114 if (static_cast<unsigned>(caretOffset) < textBox->start() || static_cast<uns igned>(caretOffset) > textBox->start() + textBox->len())
115 return LayoutRect(); 115 return LayoutRect();
116 116
117 // Use the edge of the selection rect to determine the caret rect. 117 // Use the edge of the selection rect to determine the caret rect.
118 if (static_cast<unsigned>(caretOffset) < textBox->start() + textBox->len()) { 118 if (static_cast<unsigned>(caretOffset) < textBox->start() + textBox->len()) {
119 LayoutRect rect = textBox->localSelectionRect(caretOffset, caretOffset + 1); 119 LayoutRect rect = textBox->localSelectionRect(caretOffset, caretOffset + 1);
120 LayoutUnit x = box->isLeftToRightDirection() ? rect.x() : rect.maxX(); 120 LayoutUnit x = box->isLeftToRightDirection() ? rect.x() : rect.maxX();
121 return LayoutRect(x, rect.y(), caretWidth, rect.height()); 121 return LayoutRect(x, rect.y(), caretWidth, rect.height());
122 } 122 }
123 123
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 FontDescription fontDescription(style->fontDescription()); 238 FontDescription fontDescription(style->fontDescription());
239 239
240 // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt). 240 // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt).
241 fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(& document, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.speci fiedSize(), DoNotUseSmartMinimumForFontSize)); 241 fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(& document, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.speci fiedSize(), DoNotUseSmartMinimumForFontSize));
242 242
243 scaledFont = Font(fontDescription, 0, 0); 243 scaledFont = Font(fontDescription, 0, 0);
244 scaledFont.update(styleResolver->fontSelector()); 244 scaledFont.update(styleResolver->fontSelector());
245 } 245 }
246 246
247 } 247 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTheme.cpp ('k') | Source/core/rendering/svg/SVGTextQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698