| Index: Source/core/editing/TypingCommand.cpp
|
| diff --git a/Source/core/editing/TypingCommand.cpp b/Source/core/editing/TypingCommand.cpp
|
| index 7f048416e4a9ccbc6f242f1223dd7233133ebb72..6c52965252495a670836ebd907f4175b8c96c331 100644
|
| --- a/Source/core/editing/TypingCommand.cpp
|
| +++ b/Source/core/editing/TypingCommand.cpp
|
| @@ -20,7 +20,7 @@
|
| * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
| * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| #include "config.h"
|
| @@ -54,7 +54,7 @@ public:
|
| , m_selectInsertedText(selectInsertedText)
|
| , m_text(text)
|
| { }
|
| -
|
| +
|
| void operator()(size_t lineOffset, size_t lineLength, bool isLastLine) const
|
| {
|
| if (isLastLine) {
|
| @@ -66,7 +66,7 @@ public:
|
| m_typingCommand->insertParagraphSeparator();
|
| }
|
| }
|
| -
|
| +
|
| private:
|
| TypingCommand* m_typingCommand;
|
| bool m_selectInsertedText;
|
| @@ -93,7 +93,7 @@ TypingCommand::TypingCommand(Document *document, ETypingCommand commandType, con
|
| void TypingCommand::deleteSelection(Document* document, Options options)
|
| {
|
| ASSERT(document);
|
| -
|
| +
|
| Frame* frame = document->frame();
|
| ASSERT(frame);
|
|
|
| @@ -161,7 +161,7 @@ void TypingCommand::insertText(Document* document, const String& text, Options o
|
|
|
| if (!text.isEmpty())
|
| document->frame()->editor()->updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text[0]));
|
| -
|
| +
|
| insertText(document, text, frame->selection()->selection(), options, composition);
|
| }
|
|
|
| @@ -176,7 +176,7 @@ void TypingCommand::insertText(Document* document, const String& text, const Vis
|
| VisibleSelection currentSelection = frame->selection()->selection();
|
|
|
| String newText = dispatchBeforeTextInsertedEvent(text, selectionForInsertion, compositionType == TextCompositionUpdate);
|
| -
|
| +
|
| // Set the starting and ending selection appropriately if we are using a selection
|
| // that is different from the current selection. In the future, we should change EditCommand
|
| // to deal with custom selections in a general way that can be used by all of the commands.
|
| @@ -253,7 +253,7 @@ void TypingCommand::doApply()
|
| {
|
| if (!endingSelection().isNonOrphanedCaretOrRange())
|
| return;
|
| -
|
| +
|
| if (m_commandType == DeleteKey)
|
| if (m_commands.isEmpty())
|
| m_openedByBackwardDelete = true;
|
| @@ -301,10 +301,10 @@ void TypingCommand::markMisspellingsAfterTyping(ETypingCommand commandType)
|
|
|
| frame->editor()->spellChecker()->cancelCheck();
|
|
|
| - // Take a look at the selection that results after typing and determine whether we need to spellcheck.
|
| + // Take a look at the selection that results after typing and determine whether we need to spellcheck.
|
| // Since the word containing the current selection is never marked, this does a check to
|
| // see if typing made a new word that is not in the current selection. Basically, you
|
| - // get this by being at the end of a word and typing a space.
|
| + // get this by being at the end of a word and typing a space.
|
| VisiblePosition start(endingSelection().start(), endingSelection().affinity());
|
| VisiblePosition previous = start.previous();
|
| if (previous.isNotNull()) {
|
| @@ -375,7 +375,7 @@ void TypingCommand::insertParagraphSeparatorInQuotedContent()
|
| insertParagraphSeparator();
|
| return;
|
| }
|
| -
|
| +
|
| applyCommandToComposite(BreakBlockquoteCommand::create(document()));
|
| typingAddedToOpenCommand(InsertParagraphSeparatorInQuotedContent);
|
| }
|
| @@ -485,14 +485,14 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
|
| ASSERT_NOT_REACHED();
|
| break;
|
| }
|
| -
|
| +
|
| ASSERT(!selectionToDelete.isNone());
|
| if (selectionToDelete.isNone())
|
| return;
|
| -
|
| +
|
| if (selectionToDelete.isCaret() || !frame->selection()->shouldDeleteSelection(selectionToDelete))
|
| return;
|
| -
|
| +
|
| if (killRing)
|
| frame->editor()->addToKillRing(selectionToDelete.toNormalizedRange().get(), false);
|
| // Make undo select everything that has been deleted, unless an undo will undo more than just this deletion.
|
| @@ -578,14 +578,14 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool ki
|
| ASSERT_NOT_REACHED();
|
| break;
|
| }
|
| -
|
| +
|
| ASSERT(!selectionToDelete.isNone());
|
| if (selectionToDelete.isNone())
|
| return;
|
| -
|
| +
|
| if (selectionToDelete.isCaret() || !frame->selection()->shouldDeleteSelection(selectionToDelete))
|
| return;
|
| -
|
| +
|
| if (killRing)
|
| frame->editor()->addToKillRing(selectionToDelete.toNormalizedRange().get(), false);
|
| // make undo select what was deleted
|
|
|