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

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

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 Apple Computer, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 Position endPosition = Position(textNode.release(), start.offsetInContainerN ode() + text.length()); 122 Position endPosition = Position(textNode.release(), start.offsetInContainerN ode() + text.length());
123 setEndingSelectionWithoutValidation(start, endPosition); 123 setEndingSelectionWithoutValidation(start, endPosition);
124 if (!selectInsertedText) 124 if (!selectInsertedText)
125 setEndingSelection(VisibleSelection(endingSelection().visibleEnd(), endi ngSelection().isDirectional())); 125 setEndingSelection(VisibleSelection(endingSelection().visibleEnd(), endi ngSelection().isDirectional()));
126 126
127 return true; 127 return true;
128 } 128 }
129 129
130 void InsertTextCommand::doApply() 130 void InsertTextCommand::doApply()
131 { 131 {
132 ASSERT(m_text.find('\n') == notFound); 132 ASSERT(m_text.find('\n') == kNotFound);
133 133
134 if (!endingSelection().isNonOrphanedCaretOrRange()) 134 if (!endingSelection().isNonOrphanedCaretOrRange())
135 return; 135 return;
136 136
137 // Delete the current selection. 137 // Delete the current selection.
138 // FIXME: This delete operation blows away the typing style. 138 // FIXME: This delete operation blows away the typing style.
139 if (endingSelection().isRange()) { 139 if (endingSelection().isRange()) {
140 if (performTrivialReplace(m_text, m_selectInsertedText)) 140 if (performTrivialReplace(m_text, m_selectInsertedText))
141 return; 141 return;
142 deleteSelection(false, true, true, false, false); 142 deleteSelection(false, true, true, false, false);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 splitTextNode(textNode, offset); 264 splitTextNode(textNode, offset);
265 insertNodeBefore(spanNode, textNode.release()); 265 insertNodeBefore(spanNode, textNode.release());
266 } 266 }
267 } 267 }
268 268
269 // return the position following the new tab 269 // return the position following the new tab
270 return lastPositionInNode(spanNode.get()); 270 return lastPositionInNode(spanNode.get());
271 } 271 }
272 272
273 } 273 }
OLDNEW
« no previous file with comments | « Source/core/editing/InputMethodController.cpp ('k') | Source/core/editing/TextInsertionBaseCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698