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

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

Issue 207783002: Omit "int" when using "unsigned" modifier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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/dom/MessagePort.cpp ('k') | Source/core/editing/MarkupAccumulator.cpp » ('j') | 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) 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 if (!m_selectInsertedText) 220 if (!m_selectInsertedText)
221 setEndingSelection(VisibleSelection(endingSelection().end(), endingSelec tion().affinity(), endingSelection().isDirectional())); 221 setEndingSelection(VisibleSelection(endingSelection().end(), endingSelec tion().affinity(), endingSelection().isDirectional()));
222 } 222 }
223 223
224 Position InsertTextCommand::insertTab(const Position& pos) 224 Position InsertTextCommand::insertTab(const Position& pos)
225 { 225 {
226 Position insertPos = VisiblePosition(pos, DOWNSTREAM).deepEquivalent(); 226 Position insertPos = VisiblePosition(pos, DOWNSTREAM).deepEquivalent();
227 227
228 Node* node = insertPos.containerNode(); 228 Node* node = insertPos.containerNode();
229 unsigned int offset = node->isTextNode() ? insertPos.offsetInContainerNode() : 0; 229 unsigned offset = node->isTextNode() ? insertPos.offsetInContainerNode() : 0 ;
230 230
231 // keep tabs coalesced in tab span 231 // keep tabs coalesced in tab span
232 if (isTabSpanTextNode(node)) { 232 if (isTabSpanTextNode(node)) {
233 RefPtr<Text> textNode = toText(node); 233 RefPtr<Text> textNode = toText(node);
234 insertTextIntoNode(textNode, offset, "\t"); 234 insertTextIntoNode(textNode, offset, "\t");
235 return Position(textNode.release(), offset + 1); 235 return Position(textNode.release(), offset + 1);
236 } 236 }
237 237
238 // create new tab span 238 // create new tab span
239 RefPtr<Element> spanNode = createTabSpanElement(document()); 239 RefPtr<Element> spanNode = createTabSpanElement(document());
(...skipping 14 matching lines...) Expand all
254 splitTextNode(textNode, offset); 254 splitTextNode(textNode, offset);
255 insertNodeBefore(spanNode, textNode.release()); 255 insertNodeBefore(spanNode, textNode.release());
256 } 256 }
257 } 257 }
258 258
259 // return the position following the new tab 259 // return the position following the new tab
260 return lastPositionInNode(spanNode.get()); 260 return lastPositionInNode(spanNode.get());
261 } 261 }
262 262
263 } 263 }
OLDNEW
« no previous file with comments | « Source/core/dom/MessagePort.cpp ('k') | Source/core/editing/MarkupAccumulator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698