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

Side by Side Diff: Source/core/editing/TextCheckingHelper.h

Issue 22859062: Chunk up the text to spell check also when the text is pasted. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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/editing/SpellCheckRequester.cpp ('k') | no next file » | 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, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 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 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 bool isTextEmpty() const { return text().isEmpty(); } 52 bool isTextEmpty() const { return text().isEmpty(); }
53 bool isRangeEmpty() const { return checkingStart() >= checkingEnd(); } 53 bool isRangeEmpty() const { return checkingStart() >= checkingEnd(); }
54 54
55 int checkingStart() const; 55 int checkingStart() const;
56 int checkingEnd() const; 56 int checkingEnd() const;
57 int checkingLength() const; 57 int checkingLength() const;
58 String checkingSubstring() const { return textSubstring(checkingStart(), che ckingLength()); } 58 String checkingSubstring() const { return textSubstring(checkingStart(), che ckingLength()); }
59 59
60 bool checkingRangeCovers(int location, int length) const { return location < checkingEnd() && location + length > checkingStart(); } 60 bool checkingRangeCovers(int location, int length) const { return location < checkingEnd() && location + length > checkingStart(); }
61 PassRefPtr<Range> paragraphRange() const; 61 PassRefPtr<Range> paragraphRange() const;
62 PassRefPtr<Range> checkingRange() const { return m_checkingRange; }
62 63
63 private: 64 private:
64 void invalidateParagraphRangeValues(); 65 void invalidateParagraphRangeValues();
65 PassRefPtr<Range> checkingRange() const { return m_checkingRange; }
66 PassRefPtr<Range> offsetAsRange() const; 66 PassRefPtr<Range> offsetAsRange() const;
67 67
68 RefPtr<Range> m_checkingRange; 68 RefPtr<Range> m_checkingRange;
69 mutable RefPtr<Range> m_paragraphRange; 69 mutable RefPtr<Range> m_paragraphRange;
70 mutable RefPtr<Range> m_offsetAsRange; 70 mutable RefPtr<Range> m_offsetAsRange;
71 mutable String m_text; 71 mutable String m_text;
72 mutable int m_checkingStart; 72 mutable int m_checkingStart;
73 mutable int m_checkingEnd; 73 mutable int m_checkingEnd;
74 mutable int m_checkingLength; 74 mutable int m_checkingLength;
75 }; 75 };
(...skipping 18 matching lines...) Expand all
94 bool unifiedTextCheckerEnabled() const; 94 bool unifiedTextCheckerEnabled() const;
95 }; 95 };
96 96
97 void checkTextOfParagraph(TextCheckerClient&, const String&, TextCheckingTypeMas k, Vector<TextCheckingResult>&); 97 void checkTextOfParagraph(TextCheckerClient&, const String&, TextCheckingTypeMas k, Vector<TextCheckingResult>&);
98 98
99 bool unifiedTextCheckerEnabled(const Frame*); 99 bool unifiedTextCheckerEnabled(const Frame*);
100 100
101 } // namespace WebCore 101 } // namespace WebCore
102 102
103 #endif // TextCheckingHelper_h 103 #endif // TextCheckingHelper_h
OLDNEW
« no previous file with comments | « Source/core/editing/SpellCheckRequester.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698