| OLD | NEW |
| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 m_paragraphRange = expandToParagraphBoundary(checkingRange()); | 153 m_paragraphRange = expandToParagraphBoundary(checkingRange()); |
| 154 return m_paragraphRange; | 154 return m_paragraphRange; |
| 155 } | 155 } |
| 156 | 156 |
| 157 PassRefPtr<Range> TextCheckingParagraph::subrange(int characterOffset, int chara
cterCount) const | 157 PassRefPtr<Range> TextCheckingParagraph::subrange(int characterOffset, int chara
cterCount) const |
| 158 { | 158 { |
| 159 ASSERT(m_checkingRange); | 159 ASSERT(m_checkingRange); |
| 160 return TextIterator::subrange(paragraphRange().get(), characterOffset, chara
cterCount); | 160 return TextIterator::subrange(paragraphRange().get(), characterOffset, chara
cterCount); |
| 161 } | 161 } |
| 162 | 162 |
| 163 int TextCheckingParagraph::offsetTo(const Position& position, ExceptionState& es
) const | 163 int TextCheckingParagraph::offsetTo(const Position& position, ExceptionState& ex
ceptionState) const |
| 164 { | 164 { |
| 165 ASSERT(m_checkingRange); | 165 ASSERT(m_checkingRange); |
| 166 RefPtr<Range> range = offsetAsRange()->cloneRange(ASSERT_NO_EXCEPTION); | 166 RefPtr<Range> range = offsetAsRange()->cloneRange(ASSERT_NO_EXCEPTION); |
| 167 range->setEnd(position.containerNode(), position.computeOffsetInContainerNod
e(), es); | 167 range->setEnd(position.containerNode(), position.computeOffsetInContainerNod
e(), exceptionState); |
| 168 if (es.hadException()) | 168 if (exceptionState.hadException()) |
| 169 return 0; | 169 return 0; |
| 170 return TextIterator::rangeLength(range.get()); | 170 return TextIterator::rangeLength(range.get()); |
| 171 } | 171 } |
| 172 | 172 |
| 173 bool TextCheckingParagraph::isEmpty() const | 173 bool TextCheckingParagraph::isEmpty() const |
| 174 { | 174 { |
| 175 // Both predicates should have same result, but we check both just for sure. | 175 // Both predicates should have same result, but we check both just for sure. |
| 176 // We need to investigate to remove this redundancy. | 176 // We need to investigate to remove this redundancy. |
| 177 return isRangeEmpty() || isTextEmpty(); | 177 return isRangeEmpty() || isTextEmpty(); |
| 178 } | 178 } |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 return false; | 568 return false; |
| 569 | 569 |
| 570 const Settings* settings = frame->settings(); | 570 const Settings* settings = frame->settings(); |
| 571 if (!settings) | 571 if (!settings) |
| 572 return false; | 572 return false; |
| 573 | 573 |
| 574 return settings->unifiedTextCheckerEnabled(); | 574 return settings->unifiedTextCheckerEnabled(); |
| 575 } | 575 } |
| 576 | 576 |
| 577 } | 577 } |
| OLD | NEW |