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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp

Issue 1679253002: Editing: Add EditingState* argument to EditCommand::doApply. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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) 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return next.isNull() || !next.deepEquivalent().anchorNode()->isDescendantOf( node); 65 return next.isNull() || !next.deepEquivalent().anchorNode()->isDescendantOf( node);
66 } 66 }
67 67
68 } // namespace 68 } // namespace
69 69
70 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document) 70 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document)
71 : CompositeEditCommand(document) 71 : CompositeEditCommand(document)
72 { 72 {
73 } 73 }
74 74
75 void BreakBlockquoteCommand::doApply() 75 void BreakBlockquoteCommand::doApply(EditingState*)
76 { 76 {
77 if (endingSelection().isNone()) 77 if (endingSelection().isNone())
78 return; 78 return;
79 79
80 // Delete the current selection. 80 // Delete the current selection.
81 if (endingSelection().isRange()) 81 if (endingSelection().isRange())
82 deleteSelection(false, false); 82 deleteSelection(false, false);
83 83
84 // This is a scenario that should never happen, but we want to 84 // This is a scenario that should never happen, but we want to
85 // make sure we don't dereference a null pointer below. 85 // make sure we don't dereference a null pointer below.
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 // Make sure the cloned block quote renders. 218 // Make sure the cloned block quote renders.
219 addBlockPlaceholderIfNeeded(clonedBlockquote.get()); 219 addBlockPlaceholderIfNeeded(clonedBlockquote.get());
220 220
221 // Put the selection right before the break. 221 // Put the selection right before the break.
222 setEndingSelection(VisibleSelection(positionBeforeNode(breakElement.get()), TextAffinity::Downstream, endingSelection().isDirectional())); 222 setEndingSelection(VisibleSelection(positionBeforeNode(breakElement.get()), TextAffinity::Downstream, endingSelection().isDirectional()));
223 rebalanceWhitespace(); 223 rebalanceWhitespace();
224 } 224 }
225 225
226 } // namespace blink 226 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698