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

Unified Diff: Source/core/editing/RenderedPosition.cpp

Issue 184023003: Make InlineBox::renderer() and related subclass methods return reference. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: No reference reassignment. Created 6 years, 10 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 | « no previous file | Source/core/editing/VisiblePosition.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/RenderedPosition.cpp
diff --git a/Source/core/editing/RenderedPosition.cpp b/Source/core/editing/RenderedPosition.cpp
index a3646533789c49458afc05be60b8bb1f793479d0..beb15ae93a7189fecaab256b44a4b0fb0e438f8c 100644
--- a/Source/core/editing/RenderedPosition.cpp
+++ b/Source/core/editing/RenderedPosition.cpp
@@ -74,7 +74,7 @@ RenderedPosition::RenderedPosition(const VisiblePosition& position)
return;
position.getInlineBoxAndOffset(m_inlineBox, m_offset);
if (m_inlineBox)
- m_renderer = m_inlineBox->renderer();
+ m_renderer = &m_inlineBox->renderer();
else
m_renderer = rendererFromPosition(position.deepEquivalent());
}
@@ -90,7 +90,7 @@ RenderedPosition::RenderedPosition(const Position& position, EAffinity affinity)
return;
position.getInlineBoxAndOffset(affinity, m_inlineBox, m_offset);
if (m_inlineBox)
- m_renderer = m_inlineBox->renderer();
+ m_renderer = &m_inlineBox->renderer();
else
m_renderer = rendererFromPosition(position);
}
@@ -137,7 +137,7 @@ RenderedPosition RenderedPosition::leftBoundaryOfBidiRun(unsigned char bidiLevel
do {
InlineBox* prev = box->prevLeafChildIgnoringLineBreak();
if (!prev || prev->bidiLevel() < bidiLevelOfRun)
- return RenderedPosition(box->renderer(), box, box->caretLeftmostOffset());
+ return RenderedPosition(&box->renderer(), box, box->caretLeftmostOffset());
box = prev;
} while (box);
@@ -154,7 +154,7 @@ RenderedPosition RenderedPosition::rightBoundaryOfBidiRun(unsigned char bidiLeve
do {
InlineBox* next = box->nextLeafChildIgnoringLineBreak();
if (!next || next->bidiLevel() < bidiLevelOfRun)
- return RenderedPosition(box->renderer(), box, box->caretRightmostOffset());
+ return RenderedPosition(&box->renderer(), box, box->caretRightmostOffset());
box = next;
} while (box);
@@ -209,7 +209,7 @@ Position RenderedPosition::positionAtLeftBoundaryOfBiDiRun() const
if (atLeftmostOffsetInBox())
return createLegacyEditingPosition(m_renderer->node(), m_offset);
- return createLegacyEditingPosition(nextLeafChild()->renderer()->node(), nextLeafChild()->caretLeftmostOffset());
+ return createLegacyEditingPosition(nextLeafChild()->renderer().node(), nextLeafChild()->caretLeftmostOffset());
}
Position RenderedPosition::positionAtRightBoundaryOfBiDiRun() const
@@ -219,7 +219,7 @@ Position RenderedPosition::positionAtRightBoundaryOfBiDiRun() const
if (atRightmostOffsetInBox())
return createLegacyEditingPosition(m_renderer->node(), m_offset);
- return createLegacyEditingPosition(prevLeafChild()->renderer()->node(), prevLeafChild()->caretRightmostOffset());
+ return createLegacyEditingPosition(prevLeafChild()->renderer().node(), prevLeafChild()->caretRightmostOffset());
}
IntRect RenderedPosition::absoluteRect(LayoutUnit* extraWidthToEndOfLine) const
« no previous file with comments | « no previous file | Source/core/editing/VisiblePosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698