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

Side by Side Diff: Source/core/editing/spellcheck/TextCheckingHelper.cpp

Issue 1315543002: Introduce createRange(const EphemeralRange&) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ASSERT(m_checkingRange); 159 ASSERT(m_checkingRange);
160 if (!m_paragraphRange) 160 if (!m_paragraphRange)
161 m_paragraphRange = expandToParagraphBoundary(checkingRange()); 161 m_paragraphRange = expandToParagraphBoundary(checkingRange());
162 return m_paragraphRange; 162 return m_paragraphRange;
163 } 163 }
164 164
165 PassRefPtrWillBeRawPtr<Range> TextCheckingParagraph::subrange(int characterOffse t, int characterCount) const 165 PassRefPtrWillBeRawPtr<Range> TextCheckingParagraph::subrange(int characterOffse t, int characterCount) const
166 { 166 {
167 ASSERT(m_checkingRange); 167 ASSERT(m_checkingRange);
168 EphemeralRange range = calculateCharacterSubrange(EphemeralRange(paragraphRa nge().get()), characterOffset, characterCount); 168 EphemeralRange range = calculateCharacterSubrange(EphemeralRange(paragraphRa nge().get()), characterOffset, characterCount);
169 if (range.isNull()) 169 if (range.isNull())
tkent 2015/08/24 09:38:05 We can remove these two lines.
yosin_UTC9 2015/08/24 13:19:22 Done.
170 return nullptr; 170 return nullptr;
171 return Range::create(range.document(), range.startPosition(), range.endPosit ion()); 171 return createRange(range);
172 } 172 }
173 173
174 int TextCheckingParagraph::offsetTo(const Position& position, ExceptionState& ex ceptionState) const 174 int TextCheckingParagraph::offsetTo(const Position& position, ExceptionState& ex ceptionState) const
175 { 175 {
176 ASSERT(m_checkingRange); 176 ASSERT(m_checkingRange);
177 RefPtrWillBeRawPtr<Range> range = offsetAsRange()->cloneRange(); 177 RefPtrWillBeRawPtr<Range> range = offsetAsRange()->cloneRange();
178 range->setEnd(position.computeContainerNode(), position.computeOffsetInConta inerNode(), exceptionState); 178 range->setEnd(position.computeContainerNode(), position.computeOffsetInConta inerNode(), exceptionState);
179 if (exceptionState.hadException()) 179 if (exceptionState.hadException())
180 return 0; 180 return 0;
181 return TextIterator::rangeLength(range->startPosition(), range->endPosition( )); 181 return TextIterator::rangeLength(range->startPosition(), range->endPosition( ));
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 return false; 571 return false;
572 572
573 const Settings* settings = frame->settings(); 573 const Settings* settings = frame->settings();
574 if (!settings) 574 if (!settings)
575 return false; 575 return false;
576 576
577 return settings->unifiedTextCheckerEnabled(); 577 return settings->unifiedTextCheckerEnabled();
578 } 578 }
579 579
580 } 580 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698