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

Side by Side Diff: Source/core/editing/SurroundingText.cpp

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 m_positionOffsetInContent = Range::create(*document, backwardsRange->endPosi tion(), position)->text().length(); 72 m_positionOffsetInContent = Range::create(*document, backwardsRange->endPosi tion(), position)->text().length();
73 m_contentRange = Range::create(*document, backwardsRange->endPosition(), for wardRange->startPosition()); 73 m_contentRange = Range::create(*document, backwardsRange->endPosition(), for wardRange->startPosition());
74 ASSERT(m_contentRange); 74 ASSERT(m_contentRange);
75 } 75 }
76 76
77 PassRefPtr<Range> SurroundingText::rangeFromContentOffsets(unsigned startOffsetI nContent, unsigned endOffsetInContent) 77 PassRefPtr<Range> SurroundingText::rangeFromContentOffsets(unsigned startOffsetI nContent, unsigned endOffsetInContent)
78 { 78 {
79 if (startOffsetInContent >= endOffsetInContent || endOffsetInContent > conte nt().length()) 79 if (startOffsetInContent >= endOffsetInContent || endOffsetInContent > conte nt().length())
80 return 0; 80 return nullptr;
81 81
82 CharacterIterator iterator(m_contentRange.get()); 82 CharacterIterator iterator(m_contentRange.get());
83 83
84 ASSERT(!iterator.atEnd()); 84 ASSERT(!iterator.atEnd());
85 iterator.advance(startOffsetInContent); 85 iterator.advance(startOffsetInContent);
86 86
87 ASSERT(iterator.range()); 87 ASSERT(iterator.range());
88 Position start = iterator.range()->startPosition(); 88 Position start = iterator.range()->startPosition();
89 89
90 ASSERT(!iterator.atEnd()); 90 ASSERT(!iterator.atEnd());
(...skipping 12 matching lines...) Expand all
103 return m_contentRange->text(); 103 return m_contentRange->text();
104 return String(); 104 return String();
105 } 105 }
106 106
107 unsigned SurroundingText::positionOffsetInContent() const 107 unsigned SurroundingText::positionOffsetInContent() const
108 { 108 {
109 return m_positionOffsetInContent; 109 return m_positionOffsetInContent;
110 } 110 }
111 111
112 } // namespace WebCore 112 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/ReplaceSelectionCommand.cpp ('k') | Source/core/editing/TextCheckingHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698